|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
我编了个滤波器,滤波效果很差,哪位能指点一下怎么修改?问题出在哪?
%滤波器设计
%x=sin(2*pi*5*t)+2*sin(2*pi*10*t)+randn(size(t))
clc;clear;
fs=1000;
t=0:1/fs:2;
x=sin(2*pi*5*t)+2*sin(2*pi*10*t)+randn(size(t));
fcuts=[3 4 6 7 8 9 11 12];
mags=[0 1 0 1 0];
devs=[0.01 0.01 0.01 0.01 0.01];
[n,wn,beta,ftype]=kaiserord(fcuts,mags,devs,fs);
b=fir1(n,wn,ftype,kaiser(n+1,beta),'scale');
h=filter(b,1,x);
subplot(211)
plot(t,x);
subplot(212)
plot(t,h);
|
|