现代信号处理课程大作业
选择【二、三、四】
二、试用用奇阶互补法设计两带滤波器组(高、低通互补),进而实现四带滤波器组;并画出其频响。滤波器设计参数为:Fp=1.7KHz, Fr=2.3KHz, Fs=8KHz, Armin≥70dB。
1、设计步骤:
(1)对Fp、Fr进行预畸
?Fp);Fs ?Fr?'r?tg();Fs?'p?tg((2)计算?'c??'p*?'r,判断?'c是否等于1,即该互补滤波器是否为互补镜像滤波器
(3)计算相关系数
k1?[(10k??'p?'r0.1Apmin?1)(100.1Armin?1)];1-12;k'?1?k2;11?k'q0?;'21?k5913q?q0?2q0?15q0?150q0;N?lg(k12/16)/lgq;?i;( N为奇数) ?u??1i?;(N为偶数)??22q?i'?12m?0
?(?1)?m?1?mqm(m?1)sin(21?2?(?1)mqm(2m?1)?u)N;
2m?cos(u)N?N??N?N2???;N1????N2;
?4??2?vi?(1?k?i'2)(1??i'2/k);?i?2v2i?1;i?1,?N1 '21??2i?1?i?2v2i;i?1,?N2
1??'22i
(4)互补镜像滤波器的数字实现
Ai?2??i2??i;Bi?; 2??i2??iAi?Z?2Bi?Z?2?1H1(Z)??;i?1,?N1H2(Z)?Z?;i?1,?N2 ?2?21?AZ1?BZiiii1HL(Z)?[H1(Z)?H2(Z)];2
2、程序:
function filter2()
Fp=1700;Fr=2300;Fs=8000; Wp=tan(pi*Fp/Fs); Wr=tan(pi*Fr/Fs); Wc=sqrt(Wp*Wr); k=Wp/Wr;
k1=sqrt(sqrt(1-k^2)); q0=0.5*(1-k1)/(1+k1);
q=q0+2*q0^5+15*q0^9+150*q0^13; N=11;
N2=fix(N/4); M=fix(N/2); N1=M-N2; for jj=1:M a=0;
for m=0:5
a=a+(-1)^m*q^(m*(m+1))*sin((2*m+1)*pi*jj/N);%N is odd, u=j end a
b=0;
for m=1:5
b=b+(-1)^m*q^(m^2)*cos(2*m*pi*jj/N); end b
W(jj)=2*q^0.25*a/(1+2*b);
V(jj)=sqrt((1-k*W(jj)^2)*(1-W(jj)^2/k)); end
for i=1:N1
alpha(i)=2*V(2*i-1)/(1+W(2*i-1)^2); end
for i=1:N2
beta(i)=2*V(2*i)/(1+W(2*i)^2);
end
for i=1:N1
a(i)=(1-alpha(i)*Wc+Wc^2)/(1+alpha(i)*Wc+Wc^2); end
for i=1:N2
b(i)=(1-beta(i)*Wc+Wc^2)/(1+beta(i)*Wc+Wc^2); end
w=0:0.0001:0.5;
LP=zeros(size(w));HP=zeros(size(w)); for n=1:length(w)
z=exp(j*w(n)*2*pi); H1=1; for i=1:N1
H1=H1*(a(i)+z^(-2))/(1+a(i)*z^(-2)) ; end H2=1/z; for i=1:N2
H2=H2*(b(i)+z^(-2))/(1+b(i)*z^(-2)); end
LP(n)=abs((H1+H2)/2); HP(n)=abs((H1-H2)/2); end
plot(w,LP,'k',w,HP,'m'); %hold on;
xlabel('数字频率'); ylabel('幅度');
3、实验结果:
图1.两带滤波器
4、四带滤波器组程序: function filterfour