MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   为什么这个程序在7.0中没有频谱? (https://www.labfans.com/bbs/showthread.php?t=7123)

梦龙 2009-03-27 10:41

为什么这个程序在7.0中没有频谱?
 
r=0.02;
t=-2:r:2;
f=Heaviside(t+1)-Heaviside(t-1);
W1=2*pi*5;
N=500;K=0:N;W=K*W1/N;
F=f*exp(-j*t'*W)*r;
F=real(F);
W=[-fliplr(W),W(2:501)];
F=[fliplr(F),F(2:501)];
subplot(2,1,1);plot(t,f);

xlabel('t');ylabel('f(t)');
title('f(t)=u(t+1)-u(t-1)');
subplot(2,1,2);plot(W,F);
xlabel('w');ylabel('F(w)');
title('f(t)的傅立叶变换F(w)');

梦龙 2009-03-27 14:42

回复: 为什么这个程序在7.0中没有频谱?
 
为什么没有人帮忙啊!

songzy41 2009-03-29 16:07

回复: 为什么这个程序在7.0中没有频谱?
 
很不明白楼主提问的意思“为什么这个程序在7.0中没有频谱”,猜想在楼主的程序中用了Heaviside函数在MATLAB 7.0中没有带,是不是这个意思?该函数在6.5中也没有带。现给 你附上该函数:
function f=heaviside(t)
f=(t>0);


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

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