1、1%用脉冲响应不 变法设计一个椭圆数字滤波器wp1=0.3*pi;wp2=0.7*pi;ws1=0.1*pi;ws2=0.9*pi;Rp=1;As=15;Fs=2000;T=1/Fs;Omgp1=wp1*Fs;Omgp2=wp2*Fs;Omgp=Omgp1,Omgp2;Omgs1=ws1*Fs;Omgs2=ws2*Fs;Omgs=Omgs1,Omgs2;bw=Omgp2-Omgp1; w0=sqrt(Omgp1*Omgp2);N,Omgn=ellipord(Omgp,Omgs,Rp,As,s)z0,p0,k0=ellipap(N,Rp,As);ba1=k0*real(poly(z0);aa1=
2、real(poly(p0);ba,aa=lp2bp(ba1,aa1,w0,bw);bd,ad=impinvar(ba,aa,Fs)H,w=freqz(bd,ad);dbH=20*log10(abs(H)+eps)/max(abs(H);subplot(2,2,1),plot(w/pi,abs(H);subplot(2,2,2),plot(w/pi,angle(H)/pi);subplot(2,2,3),plot(w/pi,dbH);subplot(2,2,4),zplane(bd,ad);该系统的传递函数是 zzzzH 654321 54321 2917.016.98.07.94.0325.
3、687)( 2%用脉冲响应不 变法设计一个切比雪夫型数字带阻滤波器wp1=0.1*pi;wp2=0.9*pi;ws1=0.3*pi;ws2=0.7*pi;Rp=1;As=40;Fs=2000;T=1/Fs;Omgp1=wp1*Fs;Omgp2=wp2*Fs;Omgp=Omgp1,Omgp2;Omgs1=ws1*Fs;Omgs2=ws2*Fs;Omgs=Omgs1,Omgs2;bw=Omgp2-Omgp1; w0=sqrt(Omgp1*Omgp2);N,Omgn=cheb2ord(Omgp,Omgs,Rp,As,s);z0,p0,k0=cheb2ap(N,As);ba1=k0*real(poly
4、(z0);aa1=real(poly(p0);ba,aa=lp2bs(ba1,aa1,w0,bw);bd,ad=impinvar(ba,aa,Fs);%模拟滤 波器与数字 滤波器的冲击响应t=0:T:(30*T); nt=length(t);ha=impulse(ba,aa,t);h=impz(bd,ad,nt);subplot(2,1,1),plot(t,ha*T,r);hold on;stem(t,h,k);title(模拟滤 波器与数字滤波器的冲击响应 );%模拟滤 波器与数字 滤波器的幅频响应wb=0:Fs*2*pi;Ha=freqs(ba,aa,wb);H=freqz(bd,ad,wb/Fs);subplot(2,1,2),plot(wb/(2*pi),abs(Ha)/max(abs(Ha),r);hold on;plot(wb/(2*pi),abs(H)/max(abs(H),k);title(模拟滤 波器与数字滤波器的幅频响应 );