内容发布更新时间 : 2024/11/14 13:02:10星期一 下面是文章的全部内容请认真阅读。
[h1,w1]=freqz(b,a,1000);
plot(w/(2*pi),20*log10(abs(h)),'b');hold on; plot(w1*1000/(2*pi),20*log10(abs(h1)),'r:');
axis([0,500,-30,0]);title('冲激响应不变法IIR的系统的对数幅频响应'); xlabel('频率/Hz');ylabel('幅值/dB'); h=legend('AF','DF');grid on;
(2)双线性映射法
??p?????p?tan???0.3249,?s?tan?s??1.37638,仍有?p?3dB,?P?20dB;
2???2??p?s????????1?9,得令,s??4.2363,得N?1.5?p,p?pp1G(p)=p2?2p?1G(s)?G(p)p?s?p,
?p20.32492=2。 s?0.4595s?0.32492=s2?2?ps??p20.06745z?2?0.1349z?1?0.06745则H(z)=G(s)s?z?1=。
0.4128z?2?1.143z?1?1z?1程序:
c=[0.3249^2*2000^2]; %形成向量c;
d=[1,0.4595*2000,0.3249^2*2000^2]; %形成向量d; [h,w]=freqs(c,d,1000);
b=[0.06745,0.1349,0.06745]; %形成向量b; a=[1,-1.143,0.4128]; %形成向量a; [h1,w1]=freqz(b,a,1000);
plot(w/(2*pi),20*log10(abs(h)),'b');hold on; plot(w1*1000/(2*pi),20*log10(abs(h1)),'r:');
axis([0,350,-30,0]);title('双线性映射法的系统的对数幅频响应'); xlabel('频率/Hz');ylabel('幅值/dB'); h=legend('AF','DF');grid on;
3(1)、窗函数法 ??jM?设
定
Hej??=??e2d?????0??0其他?c?(?p??s)/2?(0.2??????????????;
,
0??Msin??c?n?2?求单位抽样响应:hd?n???M????n??2?????????M?sin?0.4??n?2???M????n??2????????;
截断:由?s?20dB,查表知矩形窗满足要求,其表达式为:
??n??RN?n???sin??10?n?M?0.4??n?5???hn?,取M=10,得d??; ?0其他程序:
Wp=0.2; %归一化截止频率,相当于除以π Ws=0.6; %归一化截止频率 Wc=(Wp+Ws)/2; %-6dB截止频率 delta_w=Ws-Wp; %过渡带宽 N=10;
b=fir1(N-1,Wc,'low',rectwin(N));
omega=linspace(0,pi,512); %频率抽样512个点 mag=freqz(b,1,omega); %计算频率响应 magdb=20*log10(abs(mag)); figure;
stem([0:N-1],b,'.'); grid on;
axis([0,N,-0.2,0.5]);
xlabel('n');ylabel('h(n)');title('单位抽样响应'); figure;
plot(omega/pi,magdb);
??n?5?grid on;
axis([0,1,-100,10]);set(gca,'xtick',[0:0.2:1]);
xlabel('\\omega/\\pi');ylabel('dB');title('幅度频率响应');
(2)频率抽样法
阻带最小衰减?p?20dB,过渡带宽???0.4?,
?c?(?p??s)/2?(0.2??????????????
确定需增加的过渡带抽样点数m。当m=1时,满足?p?20dB的要求,所以取m=1。
估算频域抽样点数N。 N??m?1?2?????1?1?2?0.4??10,取N为奇数,取N=11。
构造所希望的频率响应函数 Hd(ej?)?Hd???e????j????j??????,??0.4???e ????????????频域抽样,求得H(k),首先计算kc通带内抽样点数为kc+1。 kc??cN?2.2 取整为2 ??取一点过度带的值为0.38,则有
?10k?0,1,2,8,9,10?1?k????11Hk??0.38k?3,7 ?k???0????11?k??k?4,5,6?????k?0,1,2,3
k?????????由此得频率抽样为
k???j1011e??10?jk??0.38e11???0?10?jk??0.38e11?10??j11k??ek?0,1,2k?3k?4,5,6 k?7k?8,9,10H?k??Hkej?k求解h(n)。对H(k)做11点离散傅立叶变换,即得
140knh?n??IDFT?Hk?H(k)W,n?0,1,...,10 ????41??110分析所设计滤波器的频域性能。将H(k)代入内插公式并化简得 H?ej????11???11??11??sin?sin??k?sin??k??2????????222?????????e?j20?????? ??k??k????????????sin??k?111sin???11sin???????2??2???????????