Fourier Coefficient of the given Function
이전 댓글 표시
##(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개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!