程序应该是对的,我修改一下技术指标, 发现出来的 带通滤波器图像很好,但用下面的指标出来的图像感觉不像带通滤波器
wp1=0.25*pi;wp2=0.65*pi;wp0=0.45*pi;ws1=0.2*pi;ws2=0.8*pi;Rp=1;As=60;
T=0.001;
Wp1=(2/T)*tan(wp1/2);Wp2=(2/T)*tan(wp2/2);
Ws1=(2/T)*tan(ws1/2);Ws2=(2/T)*tan(ws2/2);Wp=(2/T)*tan(wp0/2);
BW=Wp2-Wp1;
W0=Wp1*Wp2;
WP=1;
WS=WP*(W0^2-Ws1^2)/(Ws1*BW);
[N,Wn]=cheb1ord(WP,WS,Rp,As,'s');
[B1,A1]=cheby1(N,Rp,Wn,'s');
[h1,w1]=freqs(B1,A1);
subplot(3,2,1);
plot(w1/pi,20*log(abs(h1)));grid on;
xlabel('w(rad)');
ylabel('|H(jw)|.dB');
title('模拟低通滤波器幅频特性曲线');
[B2,A2]=lp2bp(B1,A1,Wp,BW);
[h2,w2]= freqs(B2,A2);
subplot(3,2,2);
plot(w2,20*log(abs(h2)));
axis([0,3,-400,50]);grid on;
xlabel('w(rad)');
ylabel('|H(jw)|.dB');
title('模拟带通滤波器幅频特性曲线');
[B3,A3]=bilinear(B2,A2,0.5);
[h,w]=freqz(B3,A3,64);
phz=unwrap(angle(h));
subplot(3,2,3);
plot(w/pi,abs(h));
xlabel('w(rad)');ylabel('|H(z)|');
title('数字带通滤波器幅频特性曲线');
subplot(3,2,4);
plot(w/pi,20*log10(abs(h)));
axis([-1,2,-250,50]);
xlabel('w(rad)');ylabel('|H(z)|.dB');
title('数字带通滤波器幅频特性曲线');
subplot(3,2,5);
plot(w/pi,phz);grid on;
xlabel('w(rad)');ylabel('H(z)');
title('数字带通滤波器相频特性曲线');
-
楼主说的是带通滤波器吧
一周热门 更多>