1.已知3阶椭圆IIR数字低通滤波器的性能指标为:通带截止频率
0.4π,通带波纹为0.6dB,最小阻带衰减为32dB。设计一个6阶
全通滤波器对其通带的群延时进行均衡。绘制低通滤波器和级联滤波器的群延时。
%Q1_solution
%ellip(N,Ap,Ast,Wp)//双线性法设计低通滤波器
%N--->The order of the filter
%Ap-->ripple in the passband
%Ast->a stopband Rs dB down from the peak value in the passband
%Wp-->the passband width
[be,ae]=ellip(3,0.6,32,0.4);
hellip=dfilt.df2(be,ae);
f=0:0.001:0.4;
g=grpdelay(hellip,f,2);
g1=max(g)-g;
[b,a,tau]=iirgrpdelay(6,f,[0 0.4],g1);
hallpass=dfilt.df2(b,a);//级联
hoverall=cascade(hallpass,hellip);
hFVT=fvtool([hellip,hoverall]);
set(hFVT,'Filter',[hellip,hoverall]);
legend(hFVT,'Lowpass Elliptic filter','Compensated
filter');//添加图例的标注
clear;
[num1,den1]=ellip(3,0.6,32,0.4);
[GdH,w]=grpdelay(num1,den1,512);
plot(w/pi,GdH); grid
xlabel('\omega/\pi'); ylabel('Group delay, samples');
F=0:0.001:0.4;
g=grpdelay(num1,den1,F,2); % Equalize the passband
Gd=max(g)-g;
% Design the allpass delay equalizer
[num2,den2]=iirgrpdelay(6,F,[0,0.4],Gd);
[GdA,w] = grpdelay(num2,den2,512);