资源描述:
《频率采样法设计带通滤波器matlab》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、以MATLAB用频率采样法设计一带通数字滤波器。低通带边缘:w1p=0.2*pi,低阻带边缘:w1s=0.35*pi,高通带边缘w2p=0.65*pi,高阻带边缘w2s=0.8*pi;设计过渡带中的频率样本值为T1=0.109021,T2=0.59417456%wp1=0.45*pi;wp2=0.65*pi;ws1=0.3*pi;ws2=0.75*pi;Rp=1;Rs=40%=============双线型变换法=========================================wp1=0.45*pi;wp2=0.65*pi;ws1=0.3*pi;ws2=0.
2、75*pi;Rp=1;Rs=40;Wp1=tan(wp1/2);Wp2=tan(wp2/2);Ws1=tan(ws1/2);Ws2=tan(ws2/2);BW=Wp2-Wp1;W0=Wp1*Wp2;W00=sqrt(W0);WP=1;WS=WP*(W0^2-Ws1^2)/(Ws1*BW);[N,Wn]=cheb1ord(WP,WS,Rp,Rs,'s');[B,A]=cheby1(N,Rp,Wn,'s');[BT,AT]=lp2bp(B,A,W00,BW);[num,den]=bilinear(BT,AT,0.5);[h,omega]=freqz(num,den,64);su
3、bplot(2,2,1);stem(omega/pi,abs(h));xlabel('omega/pi');ylabel('
4、H(z)
5、');subplot(2,2,2);stem(omega/pi,20*log10(abs(h)));xlabel('omega/pi');ylabel('增益.dB');%=============直接法=================================wp1=0.45*pi;wp2=0.65*pi;ws1=0.3*pi;ws2=0.75*pi;Rp=1;Rs=40;Wp=[wp1/pi,wp2/pi];Ws=[ws
6、1/pi,ws2/pi];[N,Wn]=cheb1ord(Wp,Ws,Rp,Rs);[B,A]=cheby1(N,Rp,Wn);[h,omega]=freqz(B,A,64);subplot(2,2,3);stem(omega/pi,abs(h));xlabel('omega/pi');ylabel('
7、H(z)
8、');subplot(2,2,4);stem(omega/pi,20*log10(abs(h)));xlabel('omega/pi');ylabel('增益.dB');%cheby2%%wp1=0.45*pi;wp2=0.65*pi;ws1=0.3*pi
9、;ws2=0.75*pi;Rp=1;Rs=40%=============双线型变换法=========================================wp1=0.45*pi;wp2=0.65*pi;ws1=0.3*pi;ws2=0.75*pi;Rp=1;Rs=40;Wp1=tan(wp1/2);Wp2=tan(wp2/2);Ws1=tan(ws1/2);Ws2=tan(ws2/2);BW=Wp2-Wp1;W0=Wp1*Wp2;W00=sqrt(W0);WP=1;WS=WP*(W0^2-Ws1^2)/(Ws1*BW);[N,Wn]=cheb2ord(WP,W
10、S,Rp,Rs,'s');[B,A]=cheby2(N,Rs,Wn,'s');[BT,AT]=lp2bp(B,A,W00,BW);[num,den]=bilinear(BT,AT,0.5);[h,omega]=freqz(num,den,64);subplot(2,2,1);stem(omega/pi,abs(h));xlabel('omega/pi');ylabel('
11、H(z)
12、');subplot(2,2,2);stem(omega/pi,20*log10(abs(h)));axis([01-1000]);xlabel('omega/pi');ylabel('
13、增益.dB');%=============直接法=================================wp1=0.45*pi;wp2=0.65*pi;ws1=0.3*pi;ws2=0.75*pi;Rp=1;Rs=40;Wp=[wp1/pi,wp2/pi];Ws=[ws1/pi,ws2/pi];[N,Wn]=cheb2ord(Wp,Ws,Rp,Rs);[B,A]=cheby2(N,Rs,Wn);[h,omega]=freqz(B,A,64);subplot(2,2,3);stem(omega/pi,ab