This is my input signal:
clcclear all syms L psi f(x) t L=2*pi;psi=pi;f(x)=(t-psi)^2; ezplot(f(x),[0,2*pi])xlabel ('period 0,2*pi')ylabel ('amplitude')title ('input signal')pretty(f(x))
I'm trying to plot the Fourier using this code:
clcclear all syms n m L t psi x L=2*pi;psi=pif(x)=(t-psi)^2 A0=int(f(x),t,0,2*pi)/Lezplot(A0,[0,2*pi])hold on for m=1:10 An=int(f(x)*cos(n*t),t,0,L)*(L/1); An=subs(An,n,m); Bn=int(f(x)*sin(n*t),t,0,L)*(L/1); Bn=subs(Bn,n,m); Fo=A0+sum((An*cos(n*pi)/L)*f(x)+(Bn*sin(n*pi)/L)*f(x)) Fo=subs(Fo,n,m); ezplot(Fo,[0,2*pi]) ylim auto hold onend
I've tried numerous attempts but cant seen to generate the simulated input???? what a I doing wrong? Regards J
Best Answer