资源描述:
《matlab上机完美版》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、1.已知3阶椭圆IIR数字低通滤波器的性能指标为:通带截止频率0.4π,通带波纹为0.6dB,最小阻带衰减为32dB。设计一个6阶全通滤波器对其通带的群延时进行均衡。绘制低通滤波器和级联滤波器的群延时。%Q1_solution%ellip(N,Ap,Ast,Wp)%N--->Theorderofthefilter%Ap-->rippleinthepassband%Ast->astopbandRsdBdownfromthepeakvalueinthepassband%Wp-->thepassbandwidth[be,ae]=
2、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,[00.4],g1);hallpass=dfilt.df2(b,a);hoverall=cascade(hallpass,hellip);hFVT=fvtool([hellip,hoverall]);set(hFVT,'Filter',[hellip,hoverall]);legend(h
3、FVT,'LowpassEllipticfilter','Compensatedfilter');clear;[num1,den1]=ellip(3,0.6,32,0.4);[GdH,w]=grpdelay(num1,den1,512);plot(w/pi,GdH);gridxlabel('omega/pi');ylabel('Groupdelay,samples');F=0:0.001:0.4;g=grpdelay(num1,den1,F,2);%EqualizethepassbandGd=max(g)-g;%Des
4、igntheallpassdelayequalizer[num2,den2]=iirgrpdelay(6,F,[0,0.4],Gd);[GdA,w]=grpdelay(num2,den2,512);holdon;plot(w/pi,GdH+GdA,'r');legend('OriginalFilter','Compensatedfilter');2.设计巴特沃兹模拟低通滤波器,其滤波器的阶数和3-dB截止频率由键盘输入,程序能根据输入的参数,绘制滤波器的增益响应。clear;N=input('TypeintheorderN
5、=');Wn=input('Typeinthe3-dBcutofffrequencyWn=');%模拟频率[num,den]=butter(N,Wn,'s');w=0:2*Wn;h=freqs(num,den,w);plot(w,20*log(abs(h))),grid;3.已知系统的系统函数为:用MATLAB进行部分分式展开,并写出展开后的表达式。%Partial-FractionExpansionofRationalz-Transformnum=[001-0.20.5];den=[13.21.5-0.81.4];[r,
6、p,k]=residuez(num,den);disp('Residues');disp(r')disp('Poles');disp(p')disp('Constants');disp(k)4.设计切比雪夫I型IIR数字高通滤波器,其性能指标为:通带波纹,最小阻带衰减,通带和阻带边缘频率和绘制所设计的滤波器增益响应。%a4disp('prewappingisdone,andT=2');Wp=tan(0.75*pi/2);Ws=tan(0.5*pi/2);Rp=0.5;Rs=43;[N,Wn]=cheb1ord(Ws,Wp,
7、Rp,Rs,'s');[b,a]=cheby1(N,Rp,Wn,'s');[bt,at]=lp2hp(b,a,Wp);[num,den]=bilinear(bt,at,0.5);[h,omega]=freqz(num,den);plot(omega/pi,20*log10(abs(h)));grid;xlabel('omega/pi');ylabel('Gain');title('TypeIChebyshevHighpassFilter');clear;%预畸变Rp=0.5;Rs=43;Wp=0.75;Ws=0.35;
8、[N,Wp]=cheb1ord(Wp,Ws,Rp,Rs);[num,den]=cheby1(N,Rp,Wp,'high');w=0:pi/1024:pi;h=freqz(num,den,w);subplot(2,1,1);plot(w/pi,abs(h)),grid;title('Amplitudein