|
楼主 |
发表于 2007-10-24 11:37
|
显示全部楼层
QQ
clf;
N=3;
Wo=200;
[b,a]=besself(N,Wo);
[H,W]=freqs(b,a);
magH=abs(H);
dt=0.001;
t=0:dt:2;
x1=cos(2*pi*2*t);
H=[tf(b,a)];
[y1,t1]=lsim(H,x1,t);
figure(1)
plot(t1,y1);title('滤波后余弦波信号')
%运行到下面的语句总是提示时间矩阵不对。怎么修改呢?
ya=y1.*hamming(length(t1))';%海明窗
yb=y1.*hanning(length(t1))';%汉宁窗
yc=y1.*kaiser(length(t1))';%凯赛窗
yd=y1.*boxcar(length(t1))';%矩形窗
figure(2)
subplot(2,2,1),plot(t1,ya),title('海明窗')
subplot(2,2,2),plot(t1,yb),title('汉宁窗')
subplot(2,2,3),plot(t1,yc),title('凯赛窗')
subplot(2,2,4),plot(t1,yd),title('矩形窗') |
|