1、用双线性变换法设计切比雪夫 II 型的数字 IIR 带通滤波器用双线性变换法设计原型低通为切比雪夫 II 型的数字 IIR 带通滤波器,要求通带边界频率为 400Hz, 500Hz,阻带边界频率分别为 350Hz,550Hz ,通带最大衰减 1dB,阻带最小衰减 40dB,抽样频率为 2000Hz,用 MATLAB 画出幅频特性,画出并分析滤波器传输函数的零极点;信号 经过该滤波器,其中 450Hz,)2sin()si()()121 tftftxtx 1f600Hz,滤波器的输出 是什么?用 Matlab 验证你的结论并给出2f y的图形。,(,1ttMatlab 详细设计:% Design
2、of a Cheb II Bandpass Digital Filter by using bilinear methodclc;clear all;Rp = 1; % bandpass attenuation in dBRs = 40; % bandstop attenuation in dBOmegaS1_1=350; OmegaS1_2=550;OmegaP1_1=400; OmegaP1_2=500;Fp=2000; % samling frequencyWp1=2*pi*OmegaP1_1/Fp; Wp2=2*pi*OmegaP1_2/Fp; Ws1=2*pi*OmegaS1_1/F
3、p; Ws2=2*pi*OmegaS1_2/Fp; OmegaP1=2*Fp*tan(Wp1/2); % nonlinearlizationOmegaP2=2*Fp*tan(Wp2/2); % nonlinearlizationOmegaS1=2*Fp*tan(Ws1/2); % nonlinearlizationOmegaS2=2*Fp*tan(Ws2/2); % nonlinearlizationOmegaP0=sqrt(OmegaP1*OmegaP2);% equivalent mid frequencyBw=OmegaP2-OmegaP1; % bandwithEta_P0=Omega
4、P0/Bw; % NormalizationEta_P1=OmegaP1/Bw; % NormalizationEta_P2=OmegaP2/Bw; % NormalizationEta_S1=OmegaS1/Bw; % NormalizationEta_S2=OmegaS2/Bw; % NormalizationLemta_P_EquivalentLowPass=Eta_P2/(Eta_P22-Eta_P02); % change to the equivalent Lowpass patameterLemta_S1_EquivalentLowPass=-Eta_S1/(Eta_S12-Et
5、a_P02); % change to the equivalent Lowpass patameterLemta_S2_EquivalentLowPass=Eta_S2/(Eta_S22-Eta_P02); % change to the equivalent Lowpass patameterLemta_S_EquivalentLowPass=min(Lemta_S1_EquivalentLowPass,Lemta_S2_EquivalentLowPass); % get the smallest % Estimate the Filter OrderN, Wn=cheb2ord(Lemt
6、a_P_EquivalentLowPass, Lemta_S_EquivalentLowPass, Rp, Rs,s); % Design the Filternum1,den1=cheby2(N,Rs,Wn,s); num2,den2=lp2bp(num1,den1,OmegaP0,Bw);num,den=bilinear(num2,den2,Fp);% Compute the gain responsew = 0:pi/255:pi;h = freqz(num,den,w);g = 20*log10(abs(h);% Plot the gain responsefigure;plot(w/
7、pi,g);grid axis(0 1 -60 5);xlabel(omega /pi); ylabel(Gain in dB);title(Gain Response of a Cheb II Bandpass Filter);%Plot the poles and zerosz,p,k=tf2zp(num,den);figure;zplane(z,p); %title()f1=450;f2=600;t=0:0.0001:1x1=sin(2*pi*f1*t);x2=sin(2*pi*f2*t);x=x1+x2;figure;subplot(2,2,1)%x1plot(x1);grid on;
8、axis(0,50*pi,-3,3);xlabel(t);ylabel(x1(t);title(x1);subplot(2,2,2)%x1plot(x2);grid on;axis(0,50*pi,-3,3);xlabel(t);ylabel(x2(t);title(x2);subplot(2,2,3)%xplot(x);grid on;axis(0,50*pi,-3,3);xlabel(t);ylabel(x(t);title(x)%X=fft(x);y=filter(num,den,x);%subplot(2,2,4);%yplot(real(y);grid on;axis(0,50*pi
9、,-3,3);xlabel(t);ylabel(y);title(y);测试结果:图三 实验程序截图运行结果如下:0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-60-50-40-30-20-100 /Gain in dBGain Response of a Cheb II Bandpass Filter-1 -0.5 0 0.5 1-1-0.8-0.6-0.4-0.200.20.40.60.81Real PartImaginaryPart传传传传传传传传0 50 100 150-202tx1(t)x1传传传0 50 100 150-202tx2(t)x2传传传0 50 100 150-202tx(t)传传传传 x传传传0 50 100 150-202ty传传传传传 y传传传