Fourier Coefficient of the given Function
1 次查看(过去 30 天)
显示 更早的评论
##(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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spline Postprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!