I need help in Matlab. I need to write this in MATLAB. please help me write this
ID: 3662548 • Letter: I
Question
I need help in Matlab. I need to write this in MATLAB. please help me write this in matlab, don't write it in java or C. Thank you very much
4.2 Symbolic Integration and Fourier Analysis Using MAPLE, MATLAB can evaluate Fourier Series analysis integrals such as (2). Here is an example: syms t xt XNt ak wwk k omega TO xt. sin (2*pi. *t/TO) wwk exp (-j* (2*pi. *k/T 0) *t) ak (1 /TO int xt wwk, t, 0, T0/2) ak simplify ak xNt fourier synth ak, N, TO); ezplot (xNt, C-TO/2, 2 TOJ) grid on Note that we first obtain a symbolic expression ak for the coefficients by doing an integral followed by a simplification. Then we synthesize the signal. Attempting to run this code as is will result in an error, in the simplify part of the last line of fourier synth. Why? Remove the word 'simplify from the last line of fouriersynth. This line should now be: xt. ak num wwk; inner product Type in this program and run it. Give an equation valid over one period for the exact signal that is Fourier analyzed by the above integration. What is the fundamental period and the fundamental frequency? The semicolon is omitted from the expression for ak above, so the general expression for the Fourier coefficients will be typed out. Write the mathematical formula that is the general expression for ak in this case. Try larger or smaller values of N to see the convergence of the approximate synthesis.Explanation / Answer
You used simplify keyword, which results to error since in previous ak
"int" was used.. so it results to error.
after modification
---------------------
function xt = fouriersynth( ak, N, T0 )
syms t k wwk
kk = -N:N;
ak_num = subs( ak, k, kk+((kk==0)+sign(kk))*1e-9 )
wwk = exp(j*(2*pi*kk'/T0)*t);
xt = simplify( ak_num*wwk ); %-- inner product
ezplot(xt, kk);grid on
end
k=9
ck = sin(k)/k
xt = fouriersynth( ck, 4, pi );
--------------------------------------------------------------------------------
fundamental frequency is lowest frequency of periodic waveform.
Fundamental period is small +ve real number which periodic equation holds true.
The mathematical form is : subs( ak, k, kk+((kk==0)+sign(kk))*1e-9 )
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.