MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   【求助】fft的问题 ,谢谢! (https://www.labfans.com/bbs/showthread.php?t=1628)

ffhhaa 2008-03-10 17:41

【求助】fft的问题 ,谢谢!
 
实现y=5*cos((pi/8)*t+(pi)/4)的2-fft变换
程序如下:
T0=16;N=16;T=1;
t=0:1:16;
x=5*cos((pi/8)*t+(pi)/4);
X=1/N*fft(x,N);
f=1/T/N*(-N/2:N/2);
subplot(3,1,1);plot(t,x);
subplot(3,1,2);stem(f,abs(fftshift(X)));
subplot(3,1,3);stem(f,angle(fftshift(X)));

画出了 时域图 可是画不出频域的幅度和响频谱
提示的时“??? Error using ==> stem
The length of X must match the number of rows of Y.”
我就是这里搞不懂“ f=1/T/N*(-N/2:N/2);”时什么意思
请高手能不能帮我解释下,谢谢!

ffhhaa 2008-03-11 15:44

我现在知道了 谢谢~就是改变一下 频率间隔和频带宽度


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

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