MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB基础] 【信号处理】离散时间序列的DTFT与DTF问题 (https://www.labfans.com/bbs/showthread.php?t=12008)

Liero 2010-08-26 11:36

【信号处理】离散时间序列的DTFT与DTF问题
 
我用两种方法算出来的结果不一样,频率有两倍的关系,不知道哪里错了,望高人指点!谢谢!代码如下:

%DTFT:
x=[1,2,3,4,5,6,6,5,4,3,2,1];
for i=1:1:200
w(i)=(i-1)/10;
G(i)=0;
for k=0:1:11
G(i)=G(i)+x(k+1)*exp(-1j*w(i)*k);
end
end
figure;
plot(w,abs(G));
title('幅度频谱');
figure;
plot(w,angle(G));
title('相位频谱');

%DFT:
x=[1,2,3,4,5,6,6,5,4,3,2,1];
G=fft(x,50);
w =linspace(0,11,50);
figure;
stem(w,abs(G));
title('幅度频谱');
figure;
stem(w,angle(G));
title('相位频谱');


所有时间均为北京时间。现在的时间是 06:38

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.