您好,欢迎访问三七文档
实验三(1)、fp=0.3KHz,Ap=0.8dB,fr=0.2KHz,Ar=20dB,T=1ms;设计一Chebyshev高通滤波器;观察其通带损耗和阻带衰减是否满足要求。fp=300;fr=200;fs=1000;ap=0.8;ar=20;wp=2*fs*tan(2*pi*fp/(2*fs));wr=2*fs*tan(2*pi*fr/(2*fs));[N,wn]=cheb1ord(wp,wr,ap,ar,'s');[b,a]=cheby1(N,Q,wn,'high','s');[bz,az]=bilinear(b,a,fs);[h,w]=freqz(bz,az);figure(1)f=2*w/pi*fs;plot(f,abs(h))grid;xlabel('频率/Hz');ylabel('幅度/db');(2)、fp=0.2KHz,Ap=1dB,fr=0.3KHz,Ar=25dB,T=1ms;分别用脉冲响应不变法及双线性变换法设计一Butterworth数字低通滤波器,观察所设计数字滤波器的幅频特性曲线,记录带宽和衰减量,检查是否满足要求。比较这两种方法的优缺点。ap=1;ar=25;fp=200;fr=300;fs=1000;%脉冲响应不变法wp1=2*pi*fp;wr1=2*pi*fr;[N1,wn1]=buttord(wp1,wr1,ap,ar,'s');[b1,a1]=butter(N1,wn1,'s');[bz1,az1]=impinvar(b1,a1,fs);[h1,w1]=freqz(bz1,az1);%双线性变换法wp2=2*fs*tan(0.2*pi);ws2=2*fs*tan(0.3*pi);[N2,wn2]=buttord(wp2,ws2,ap,ar,'s');[b2,a2]=butter(N2,wn2,'s');[bz2,az2]=bilinear(b2,a2,fs);[h2,w2]=freqz(bz2,az2);figure(1)f1=2*w1/pi*fs;f2=2*w2/pi*fs;subplot(2,1,1);plot(f1,abs(h1),'r')grid;xlabel('频率/Hz');ylabel('幅度/db');title('脉冲响应不变法');%plot(f,abs(h1),'r',f,abs(h2),'y');subplot(2,1,2);plot(f2,abs(h2),'y')grid;xlabel('频率/Hz');ylabel('幅度/db');title('双线性变换法');(3)、利用双线性变换法分别设计满足下列指标的Butterworth型、Chebyshev型和椭圆型数字低通滤波器,并作图验证设计结果。fp=1200;fr=2000;fs=8000;ap=0.5;ar=40;wp=2*fs*tan(2*pi*fp/(2*fs));wr=2*fs*tan(2*pi*fr/(2*fs));[N1,wn1]=buttord(wp,wr,ap,ar,'s');[b1,a1]=butter(N1,wn1,'s');[bz1,az1]=bilinear(b1,a1,fs);[h1,w]=freqz(bz1,az1);wp2=2*fp/fs;wr2=2*fr/fs;[N2,wn2]=cheb1ord(wp2,wr2,ap,ar);[b2,a2]=cheby1(N2,ap,wn2);[h2,w]=freqz(b2,a2);[N3,wn3]=ellipord(wp,wr,ap,ar,'s');[b3,a3]=ellip(N3,ap,ar,wn3,'s');[bz3,az3]=bilinear(b3,a3,fs);[h3,w]=freqz(bz3,az3);f=2*w/pi*fs;plot(f,abs(h1),f,abs(h2),f,abs(h3))grid;xlabel('频率/Hz');ylabel('幅度/db');(4)、利用双线性变换法设计一Butterworth型数字带通滤波器,已知fs=30KHz,其等效的模拟滤波器指标为fp1=2000;fp2=3000;fr1=1500;fr2=6000;ap=3;ar=20;fs=30000;wp1=2*fs*tan(2*pi*fp1/(2*fs));wp2=2*fs*tan(2*pi*fp2/(2*fs));wr1=2*fs*tan(2*pi*fr1/(2*fs));wr2=2*fs*tan(2*pi*fr2/(2*fs));[N,wn]=buttord([wp1,wp2],[wr1,wr2],ap,ar,'s');[b,a]=butter(N,wn,'s');[bz,az]=bilinear(b,a,fs);[h,w]=freqz(bz,az);figure(1)f=2*w/(pi*fs);plot(f,abs(h))grid;xlabel('频率/Hz');ylabel('幅度/db');
本文标题:MATLAB实验
链接地址:https://www.777doc.com/doc-6521641 .html