Fourier Coefficient of the given Function
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
##(Given Function) f(x)=1/2(sin x + sin x) xє[-π , π]
##I obtain the bellow Fourier Coefficient of the given function .
##f(x) = 1/π Σ 2((cos(nπ)-1)/nπ)
##Now I am using the below Matlab code But I think the Fourier Coefficient or the MatLab code is wrong . Please someone check.
##MatLab code
x=linspace(-pi,pi);
f=2*((cos(x)-1)/pi);
g=abs(x);
N=10;
for i=2:N
f=f+(2*((cos(i*x)-1)/pi*(i));
end
c=f+pi/2;
figure;
plot(x,c,'r',x,g,'b')
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Discrete Fourier and Cosine Transforms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!