Fourier Coefficient of the given Function

1 vue (au cours des 30 derniers jours)
Tariq Malik
Tariq Malik le 9 Mai 2018
Modifié(e) : Tariq Malik le 9 Mai 2018
##(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')

Réponses (0)

Catégories

En savoir plus sur Spline Postprocessing dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by