e3gyp2002 发表于 2007-12-5 10:39:14

matlab加窗函数减少频谱泄露的问题

clc;
clear all;
fs=2000;
dt=1./fs;
N=512;
n=0:1:N-1;
t=n*dt;
Wd=hamming(N);
f=n*fs./N;
s=2*cos(2*30*t);
sc=s.*Wd;
figure(1)
subplot(211)
plot(t,s)
subplot(212)
plot(t,sc)
s1=fft(s);
s2=fft(sc);
figure(2)
subplot(211)
plot(f-fs/2,abs());
axis([-400,400,0,500]);
subplot(212)
plot(f-fs/2,abs());
axis([-400,400,0,500]);

出现错误:
??? Error using ==> unknown
Matrix dimensions must agree.

Error in ==> Untitled at 22
sc=s.*Wd;

我是初学者。请问信号与窗函数是怎么乘的?是不是产生窗函数的方法错了?
谢谢!-%-40740-%-

norika 发表于 2007-12-5 11:08:10

恩,可以查找一下附有程序代码的文献,我用matlab写过这方面的程序,不难

qizi1209 发表于 2010-10-8 17:17:06

0000xiexie
页: [1]
查看完整版本: matlab加窗函数减少频谱泄露的问题

招聘斑竹