您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 信息化管理 > IIR数字滤波器的设计实验
附录:实验2IIR数字滤波器的设计1、程序一:fc=300;fr=200;fs=1000;rp=0.8;rs=20;wc=2*fs*tan(2*pi*fc/(2*fs));wt=2*fs*tan(2*pi*fr/(2*fs));[N,wn]=cheb1ord(wc,wt,rp,rs,'s');[B,A]=cheby1(N,rp,wn,'high','s');[bz,az]=bilinear(B,A,fs);[h,w]=freqz(bz,az);f=w*fs/(2*pi);plot(f,20*log10(abs(h)));axis([0,fs/2,-80,10]);grid;xlabel('频率/Hz');ylabel('幅度/dB')图2-1切比雪夫高通滤波器幅频响应2、程序二:fc=200;fr=300;fs=1000;rp=1;rs=25;wc=2*pi*fc;wt=2*pi*fr;[N,wn]=buttord(wc,wt,rp,rs,'s');[B,A]=butter(N,wn,'s');[bz1,az1]=impinvar(B,A,fs);[h1,w]=freqz(bz1,az1);wc2=2*fs*tan(2*pi*fc/(2*fs));wt2=2*fs*tan(2*pi*fr/(2*fs));[N,wn]=buttord(wc2,wt2,rp,rs,'s');[B,A]=butter(N,wn,'s');[bz2,az2]=bilinear(B,A,fs);[h2,w]=freqz(bz2,az2);f=w*fs/(2*pi);plot(f,20*log10(abs(h1)),'-.',f,20*log10(abs(h2)),'-');axis([0,fs/2,-80,10]);grid;xlabel('频率/Hz');ylabel('幅度/dB')图2-2巴特沃思低通滤波器幅频响应3、程序:(1)切比雪夫型数字低通滤波器fc=1200;fr=2000;fs=8000;rp=0.5;rs=40;wc=2*fs*tan(2*pi*fc/(2*fs));wt=2*fs*tan(2*pi*fr/(2*fs));[N,wn]=cheb1ord(wc,wt,rp,rs,'s');[B,A]=cheby1(N,rp,wn,'s');[bz,az]=bilinear(B,A,fs);[h,w]=freqz(bz,az);f=w*fs/(2*pi);plot(f,20*log10(abs(h)));axis([0,fs/2,-80,10]);grid;xlabel('频率/Hz');ylabel('幅度/dB')图2-3(a)切比雪夫低通滤波器幅频响应(2)巴特沃思型数字低通滤波器fc=1200;fr=2000;fs=8000;rp=0.5;rs=40;wc=2*fs*tan(2*pi*fc/(2*fs));wt=2*fs*tan(2*pi*fr/(2*fs));[N,wn]=buttord(wc,wt,rp,rs,'s');[B,A]=butter(N,wn,'s');[bz,az]=bilinear(B,A,fs);[h,w]=freqz(bz,az);f=w*fs/(2*pi);plot(f,20*log10(abs(h)));axis([0,fs/2,-80,10]);grid;xlabel('频率/Hz');ylabel('幅度/dB')图2-3(b)巴特沃思型数字低通滤波器幅频响应(3)椭圆型数字低通滤波器clear;fc=1200;fr=2000;fs=8000;rp=0.5;rs=40;wc=2*fs*tan(2*pi*fc/(2*fs));wt=2*fs*tan(2*pi*fr/(2*fs));[N,wn]=ellipord(wc,wt,rp,rs,'s');[B,A]=ellip(N,rp,wn,'low','s');[bz,az]=bilinear(B,A,fs);[h,w]=freqz(bz,az);f=w*fs/(2*pi);plot(f,20*log10(abs(h)));axis([0,fs/2,-80,10]);grid;xlabel('频率/Hz');ylabel('幅度/dB')图2-3(c)椭圆型数字低通滤波器幅频响应
本文标题:IIR数字滤波器的设计实验
链接地址:https://www.777doc.com/doc-2877236 .html