www.pudn.com > 现代信号处理教程.rar > exa070301.m


%-------------------------------------------------------------------------- 
%  exa070301 , for example 7.3.1 and fig 7.3.3; 
%  计算和显示利用Johnston优化设计方法所得到的滤波器的频率响应 
%  滤波器序号:16A 
% ------------------------------------------------------------------------- 
clear; 
 
h0=[0.001050167,-0.005054526,-0.002589756,0.0276414,-0.009666376,-0.09039223,... 
    0.09779817,0.4810284,0.4810284,0.09779817,-0.09039223,-0.009666376,... 
    0.0276414,-0.002589756,-0.005054526,0.001050167]; 
Fs=1; 
 
h1=qmf(h0,1); 
 
[H0,w]= freqz(h0,1,256,Fs); 
[H1,w]= freqz(h1,1,256,Fs); 
 
subplot(221) 
h0=abs(H0); 
h1=abs(H1); 
ah0=20*log10(h0+0.000000001); 
ah1=20*log10(h1+0.000000001); 
plot(w,ah0,'k-',w,ah1,'b-'); 
grid on; 
 
sumh=h0.*h0+h1.*h1; 
sum=10*log10(sumh); 
subplot(222) 
plot(w,sum);grid;