看看这滤波器设计对没

2019-07-17 14:20发布

load x;
wp=0.3*pi;ws=0.4*pi;
ap=1;as=20;
wap=tan(wp/2);was=tan(ws/2);
[n,wc]=buttord(wap,was,ap,as,'s');
[z,p,k]=buttap(n);
[bp,ap]=zp2tf(z,p,k);
[bs,as]=lp2lp(bp,ap,wc);
[bz,az]=bilinear(bs,as,0.5);
y=filter(bz,az,x);
freqz(y);
figure:plot(abs(freqz(y)));低通
load x;
wp=0.8*pi;ws=0.7*pi;
ap=1;as=15;
wap=tan(wp/2);was=tan(ws/2);
wap1=1;was1=wap/was;
[n,wn]=buttord(wap1,was1,ap,as,'s');
[z,p,k]=buttap(n);
[bp,ap]=zp2tf(z,p,k);
[bs,as]=lp2hp(bp,ap,wap);
[bz,az]=bilinear(bs,as,0.5);
y=filter(bz,az,x);
freqz(y);
figure:plot(abs(freqz(y)));高通
load x;
wp1=0.4*pi;wp2=0.6*pi;
ap=1,as=40;
ws1=0.3*pi;ws2=0.7*pi;
wap1=tan(wp1/2);wap2=tan(wp2/2);
was1=tan(ws1/2);was2=tan(ws2/2);
wp0=1;ws0=(was2-was1)/(wap2-wap1);
w0=(wap1*wap2).^(1/2);
bw=wap2-wap1;
[n,wn]=buttord(wp0,ws0,ap,as,'s');
[bp,ap]=butter(n,wn,'s');
[bs,as]=lp2bp(bp,ap,w0,bw);
[bz,az]=bilinear(bs,as,0.5);
y=filter(bz,az,x);
freqz(y);
figure:plot(abs(freqz(y)));带通
x信号 x信号
x信号 x信号
带通 带通
带通1 带通1
低通 低通
低通1 低通1
高通 高通
高通1 高通1
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。