资源描述:
《用双线性法设计IIR数字滤波器》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实验任务:采用双线性变换法设计一个切比雪夫II型数字带通滤波器,要求:通带fpl=200Hz,fp2=300Hz,Rp=ldB;阻带fs1=150Hz,fs2=350Hz,As=20dB,滤波器采样频率Fs=1000Hzo列出传递函数并作频率响应曲线和零极点分布图。实验程序:fpl=200;fp2=300;fsl=150;fs2=350;Rp=l;As=20;ripple=l0A(-Rp/20);Attn=10A(-As/20);Fs=1000;T=l/Fs;wpl=fpl/Fs*2*pi;wp2=fp2/Fs*2*pi;wsl=fs1/Fs*2*pi;ws2=fs2/Fs*2*pi;Omgp
2、l=(2/T)*tan(wpl/2);Omgp2=(2/T)*tan(wp2/2);0mgp=[0mgpl,0mgp2J;Omgs1=(2/T)*tan(wsl/2);Omgs2=(2/T)*tan(ws2/2);Omgs=[Omgs1,Omgs2];bw=Omgs2-Omgs1;wO=sqrt(Omgsl*Omgs2);[n,Omgn]=cheb2ord(Omgp,Omgs,Rp,As,'s')[zO,pO,kO]=cheb2ap(n,As);ba1=kO*real(poly(zO));aal=real(poly(pO));[ba,aa]=lp2bp(ba1,aa1,wO,bw);[bd,a
3、d]=bilinear(ba,aa,Fs)[H,w]=freqz(bd,ad);dbH=20*logl0((abs(H)+eps)/max(abs(H)));subplot(2,2,l),plot(w/2/pi*Fs,abs(H),,k,);axis([0,Fs/2,0,1.1]);titleC幅度响应');ylabel('
4、H
5、‘);set(gca;XTickModeVmanualVXTick[0,150,200,300,350,Fs⑵);set(gca,'YTickMode*,'manual','YTick[0,Attn,ripple,1]);gridsubplot(2,2,2),pl
6、ot(w/2/pi*Fs,angle(H)/pi*180,k);axis([0,Fs/2,-l80,180]);title('相位响应,);ylabel(,phi,);setCgca/XTickMode1,'manual','XTick^O,150,200,300,350,Fs⑵);set(gca,'YTickMode*,'manual','YTick',[-180,0,180]);gridsubplot(2,2,3),plot(w/2/pi*Fs,dbH);axis([0,Fs/2,-40,5]);title(*幅度响应(dB)');ylabelCdB');xlabel('频率(pi)*
7、);set(gca,'XTickMode*,'manual','XTick^O,150,200,300,350,Fs⑵);set(gca/YTickMode','iTianuar/YTick,,[-50r20,-1,0]);gridsubplot(2,2,4),zplane(bd,ad);axis([・1.1,1.1,・1.1,1.1]);title('零极图');运行结果:n=3Omgn二1.0e+003*1.13323.5299Warning:Matrixisclosetosingularorbadlyscaled・Resultsmaybeinaccurate.RCOND=2.082625
8、e-032.>Inbilinearat89InHRat18Warning:Matrixisclosetosingularorbadlyscaled・Resultsmaybeinaccurate.RCOND=2.082625e-032.>Inbilinearat90InHRat18bd=0.13970.0000-0.09110.0000ad=1.0000-0.00001.1454-0.0000实验图象:0.0911-0.0000-0.13970.7275-0.00000.1205幅度响应相位响应零极图10.50-0.5c/殳:x飞/::齐4i-4>:::、'丿M01RealPart