DSP上机答案final(1)_第1页
DSP上机答案final(1)_第2页
DSP上机答案final(1)_第3页
DSP上机答案final(1)_第4页
DSP上机答案final(1)_第5页
已阅读5页,还剩24页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、1. 已知3阶椭圆IIR数字低通滤波器的性能指标为:通带截止频率0.4兀,通带波纹为0.6dB,放小阻带衰减为32dB。设计一个6阶全通滤波器对其通带的群延时进行均衡。绘制低通滤波器和级联滤波器的群延时。%Ql_solution%ellip(N,Ap,Ast,Wp)%NThe 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(3r0.6/32/0.4);hell

2、ipdfilt.df2(be,ae);f-0:0.001:0.4;ggrpdelay(hellip,fz 2);glmax(g)-g;b,a,tauiirgrpdelay(6,f,0 0.4,gl);hallpassdfilt.df2(b, a);hoverailcascade(hallpass,hellip);hFVTfvtool(hellip,hoverall);set(hFVT,Filter,hellip,hoverall);legend(hFVT,Lowpass Elliptic filter,Compensated filter);/ clear;numl,deni-ellip(3,

3、 0.6, 32,0.4);(GdH,w-grpdelay(numl, deni, 512);plot(w/pi,GdH); gridxlabel(omega八pi); ylabel(* Group delay, samples);F-0:0.001:0.4;g-grpdelay(numl,deni,F,2);% Equalize the passbandGdmax(g)-g;% Design the allpass delay equalizernum2,den2iirgrpdelay(6,F,0,0.4, Gd);(GdAz w grpdelay(num2r den2,512);hold

4、on;plot(w/pi,GdH+GdA, * r *);legend(Original Filter,Compensated filter *);2. 设计巴特沃兹模拟低通滤波器,其滤波器的阶数和3dB截止频率由键盘输入,程序能根据输入的参数,绘制滤波器的增益响应。clear;Ninput(Type in the order N );Wninput (Type in the 3-dB cutoff frequency Wn ); $模拟频率(num,denbutter(N,Wn, * s);w0:2*Wn;hfreqs(num,den,w); plot(w,20*log(abs(h),gri

5、d;3. 已知系统的系统函数为:、l-0.2z_,+0.5z-2H (z) =:;z1 + 3.2z + 1.5z-2 -0.8z-3 +1.4k 用MATLAB进行部分分式展开,并写出展开后的表达式。% Partial-Fraction Expansion of Rational z-Transformnum 0 0 1 -0.2 0.5);den - 1 3.2 1.5 -0.8 1.4;r,p,k residuez(num,den);disp(Residues);disp(r)disp(Poles);disp(p)disp(* Constants);disp(k)4. 设计切比雪夫1型I

6、IR数字高通滤波器,其性能指标为:通带波纹 6Z=0.5dB,般小阻带衰减q=43dB,通带和阻带边缘频率 叫=0.75兀rad和化=0.35龙rad绘制所设计的滤波器增益响应。%a4disp(prcwapping is done,and T=2);Wp = tan(0.75*pi/2);Ws = tan(0.5*pi/2);Rp = 0.5;Rs = 43;N,Wn = chcblord(Ws,Wp,Rp,Rs,s);b,a = chcby 1 (N,Rp,Wn,*s);(bt,at=lp2hp(b,a,Wp);num,dcn=bilincar(bt,at,0.5);h,omega = fr

7、cqz(num,dcn);plot (omcga/pi,20*logl0(abs(h);grid;xlabd(*omcga/pi); ylabcl(Gain);titlc(Type 1 Chebyshev Highpass Filter);lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllclear;(没做预畸变)Rp0.5;Rs43;Wp-0.75;WsO.35;N,Wp-cheblord(Wp,Ws, R

8、p,Rs);(num,den-cheby1(N,Rp,Wp,high);w0:pi/1024:pi;hfreqz(num,den, w);subplot(2,1,1);plot(w/pi,abs(h),grid;title(/Amplitude in linear scale *) subplot(2,1,2);plot(w/pi,20*logl0(abs(h),grid;titie(Amplitude in log scale *)5.已知复指数序列为:xn = 0.2e(0-4+7-5)n,绘制30点该序列的实部和虚部。n0:29;x0.2*exp(0.4+li*0.5)*n);subpl

9、ot(211);stem(n,real(x);xlabel(1n);ylabel (real part);grid on;subplot(212);stem(n,imag(x);xlabel(n1);ylabel(imag part);grid on;6. 设计切比雪夫I型模拟低通滤波器,其滤波器的阶数,3-dB截止频率和通带的波纹由键盘输入,程序能根据输入的参数,绘制滤波器的增益响应。clear;N-input (*滤波器阶数N =,);Wn-input (裁止频率Wn = *);Rp-input (通带波纹Rp = *);(num,denchebyl(N,Rp,Wn,* s1);w0:5*

10、Wn;hfreqs(num,den,w);plot(w,20*logl0(abs(h),grid;xlabel (* Frequency, Hz); ylabel (* Gain, dB);7. 已知系统的系统函数为:H(z) = 0.2 +l + 3.2z_,0.61-2.41.8(1-2.4Z-1)2用MATLAB求系统z变换的有理形式,并写出有理形式的表达式。r=l 0. 6 1. 8:p=-3. 2 2.4 2.4;k=0.2;num, den = residuez(r, p, k)8. 设计巴特沃兹IIR数字带通滤波器,其性能指标为:归一化通带截止频率 为叫i=4兀,叫2 =0.6兀

11、,归一化阻带截止频率为兀, =0.7兀, 通带波纹为0.6dB,址小阻带衰减为35dBo绘制所设计的滤波器增益响应。% Design of HR Butterworth Bandpass FilterWp 0.4 0.6;Ws 0.3 0.7;Rp 0.6;Rs 35;(NrWn buttord(Wp, Ws, Rp, Rs);b,a butter(N,Wn);(hr omega - freqz(b,a,256);plot (omega/pi,abs(h);grid;xlabel(1omega/pi *); ylabel(* Gain *);title ( HR Butterworth Ban

12、dpass Filter *); disp(N);disp(Wn);9.已知指数序列为:4 = 2(0.9),绘制24点该序列。n0:23;x2*0.9.An;stem(nzx,.);grid on;ylabel(Amplitude); xlabel(Time index/n10.设计椭圆模拟低通滤波器,其滤波器的阶数,3-dB截止频率,通带的波 纹和阻带衰减由键盘输入,程序能根据输入的参数,绘制滤波器的增益 响应。clear;Ninput(Type in the order N - );Wninput(Type in the 3-dB cutoff frequency Wn );Rpinpu

13、t(Type in the the passband ripple Rp );Rsinput(*Type in the the minimum stopband attenuation Rs num,denellip(N,Rpz Rs,Wn,s);w0:5*Wn;hfreqs(num,den,w);plot(w,20*logl0(abs(h),grid;xlabel(* Frequency, Hz); ylabel(Gain, dB);11.已知系统的系统函数为:心;一咛+0艺_l + 3.2z +1.5z_ 一 0.8z+1.4z7用MATLAB的impz函数求hn的前30个样本值。clc;

14、A-l 3.2 1.5 0.8 1.4;B-l -0.2 0.5;(H,T-impz(B,A,30); disp(H);%plot(T,H);12.已知5阶椭圆IIR数字低通滤波器的性能指标为:通带截止频率0.357:, 通带波纹为0.8dB,最小阻带衰减为35dBo设计一个10阶全通滤波器对 其通带的群延时进行均衡。绘制低通滤波器和级联滤波器的群延时。%ellip(N,Ap,Ast,Wp)%NThe order of the filter%Ap一ripple in the passband%Ast-a stopband Rs dB down from the peak value in th

15、e passband%Wp-the passband widthbe,ae-ellip(5,0.8r35,0.35);hellipdfilt.df2(be,ae);f-0:0.001:0.4;ggrpdelay(hellip,f,2);glmax(g)-g;b,a,tauiirgrpdelay(10,fr0 0.4,gl);电the first parameter above is the order of the allpasshallpassdfilt.df2(b,a);hoverail-cascade(hallpass,he11ip);hFVTfvtool(hellip,hoverall

16、);set(hFVT,* Filter,(hellip,hoverall);legend(hFVT,Lowpass Elliptic filter,Compensateder *);/ clear;numlr deniellip(5,0.8,35,0.35);(GdH,w-grpdelay(numl,deni,512);plot(w/pizGdH); gridxlabel(omega/pi); ylabel(* Group delay, samples *);F-0:0.001:0.4;ggrpdelay(numl,deni,F,2);% Equalize the passbandGdmax(

17、g)-g;% Design the allpass delay equalizernum2,den2iirgrpdelay(10,F,0,0.4,Gd);(GdAzw grpdelay(num2,den2,512);hold on;plot(w/pi,GdH+GdA, * r *);legend(Original Filter,Compensated filter *);13.编写4点滑动平均滤波器程序。原始未受干扰的序列为:sn=3n(0.8), 加性噪声信号dn为随机序列,幅度0.6,受干扰的序列为:xn= sn十 dn,分别绘制长度为40的原始未受干扰的序列,噪声序列和受干扰序 列,以及

18、滑动平均滤波器的输出。% Program 2_4% Signal Smoothing by a Moving-Average FilterR - 40;d 6/5*(rand(1,R)-0.5);m - 0:1:R-l;s -3.*m.*0.8.m;x s + d;subplot(211);plot(m,d,1r-1,m,sz *b:,m,x,*m)title(1 The sequence with noise);ylabel(Amplitude)legend(dnsnx(n);b ones (4r1)/4;y - fftfilt(b,x);subplot(212);plot(m,s,* r-

19、rmr y,b-)title(1 The original sequence & the output sequence1); legend(snyn);ylabel(Amplitude)14. 绘制长度为10点的矩形序列的16点离散傅立叶变换样本的幅度和相位。xnones(10,1);Xk-fft(xn,16);Xkfabs(Xk);Xkpangle(Xk);subplot(211);stem(0:15,Xkfr1 filled*);xlabel(Time index/n);ylabel(*Magnitude);subplot(212);stem(0:15,Xkp,1 filled);xla

20、bel(Time index/n1);ylabel(Phase)15. 已知系统的系统函数为:,z/、l-0.2z_,+0.5z-2H(z)=:l + 3.2z-,+1.5z-2 -0.8z+1.4Z-4用MATLAB的filter函数求灿n的前20个样本值。num1,-0.2,0.5;den-lz3.2r1.5z-0.8z1.4;xl zeros(1,20-1);yfilter(num, den, x);disp(Coefficients of the power series expansion); disp(y)16. 利用Hermann公式估计FIR低通滤波器的阶数。该滤波器的性能指标

21、为: 通带截止频率为1500Hz,阻带截止频率为1800Hz,通带波纹为=0.015,阻带波纹为4=0.021,抽样频率为5000Hzo% Program 10_1% Estimation of FIR Filter Order Using remezord%fedge input(Type in the bandedges );mval input(* Desired magnitude values in each band dev input(Allowable deviation in each band ); FT input(Type in the sampling frequen

22、cy -);Nr fpts, mag, wt remezord (fedge, mval, dev, FT); fprintf(Filter order is %d n,N);17.编写长度为5的中值滤波器程序。原始未受干扰的序列为:sn=3n(0.8)n,加性噪声信号dn为随机序列,幅度06分别绘制长度为40的受干 扰序列,以及中值滤波器的输出。% Program 2_5% Illustration of Median Filtering%N input(*Median Filter Length *);R - 40;b 6/5*(rand(1,R)-0.5); % Generate imp

23、ulse noise m 0:R-l;s 3*m.*(0.8.Am); % Generate signalx s + b; % Impulse noise corrupted signaly medfiltl(x,N); % Median filteringsubplot(2,1,1)stem(m,x);axis(0 50 -1 8);grid on;xlabel(1n);ylabel(Amplitude);title(Impulse Noise Corrupted Signal *); subplot(2,1,2)stem(m,y);grid on;xlabel(n);ylabel(*Amp

24、litude);title (1 Output of Median Filter);18.已知16点序列xn的DFT为:k/i6 0kl5绘制序列xn的实部和虚部。Xk-(0:15)/16;xnifft(Xk); xnrereal(xn);xnimimag(xn);subplot(2,1,1);stem(0:15,xnre,.);grid on;title(The real part of the sequence *);subplot(2,1,2);stem(0:15zxnim,.);grid on;title(The imaginary part of the sequence *);19

25、.已知系统的系统函数为:H =;2:+0:5z:1+3.2z +1.5z-2 + 0.8z-3 +1 Az-4用MATLAB测试该系统的稳定性。num1 -0.2 0.5;den-l 3.2 1.5 0.8 1.4;zplane(num, den);grid on;20.利用Remez算法设计一个等波纹线性相位FIR低通滤波器。该滤波器的性能指标为:通带截止频率为1500Hz,阻带截止频率为1800Hz,通带波纹为 =0.015,阻带波纹为=0.021,抽样频率为5000Hzo% Program 10_2% Design of Equiripple Linear-Phase FIR Filte

26、rs% format longfedge input(* Band edges in KHz *);FT input(Sampling frequency in Hz );mval input(* Desired magnitude values in each banddev input(Desired ripple in each band id (in linear units) N,fpts,mag,wt remezord(fedge,mval,dev,FT);b remez(N,fpts,magzwt);disp(FIR Filter Coefficients); disp(b) h

27、,w freqz(brlf256); subplot(2,lz1);plot(w/pi,20*logl0(abs(h);grid;xlabel(omega八pi,); ylabel(* Gain, dB);subplot(2,1,2); plot(w/piz 20*logl0(abs(h);grid; axis(O 0.4 0.7 0.7);xlabelomega八pi,); ylabel(Gain, dB*); title(1 detail in passband)21. 已知序列 /? = 2.2,3,-1.5,4.2,-1.8,x2h = 0.8,-1,1.6,0.8,计算两个 序列的卷

28、积4w = x1w*x2w,并绘制序列x“。clc;clear;xl-2.2 3 -1.5 4.2 -1.8;x2-0.81.6 0.8;x-conv (xl, x2)$结果在主界面输出stem(x,* filled);grid on;xlabel(* Time index/n *);ylabel(*Amplitude *);title(The output convolution);22. 已知序列xn为xn = cos伽/2), 0n15 ,绘制序列xn的DFT 和DTFT的幅度。n0:15;xcos(pi*n*0.5);X- fft(x);subplot(2,1,1);stem(nzX,

29、.);titie(Magnitude of DFT*)xlabel(n); ylabel(Magnitude)%circulating DTFTk0:499;w pi/500*k;XI- x*(exp +1.5e2 - 0.8e-3 +1 Ae绘制该系统的幅频特性和相频特性。clc;clear;B-l0.2 0.5 20.6;%分子系数A-l 3.2 1.5 -0.8 1.4 ; $分母系数freqz(BzA);26.已知序列 x = 2.2,3,-1.5,4.2,-1.8,忑=0.8,-1,1.6,0.8,基于 DFT 计算两个序列的卷积%/? = x1w*x2/?,并绘制基于DFT计算得到

30、的屯。clc;clear;xl-2.2 3 1.5 4.2 -1.8;x2-0.8 -1 1.6 0.8;nsize(xl, 2);msize(x2,2);Xlfft(xl,n+m-1);X2-fft(x2z n+m-1);X-X1.*X2;x-ifft(X)stemfx,.);27.已知11R滤波器的系统函数为:2 4-4- z2 - 3z3 + 4Z-4 4- 6z5 _ 17 3z“ _ 5z- + 2z$ _ 牡4 +用MATLAB将系统函数表示为级联型结构形式,并写出各级联子系统的 表达式。format short;num 2,5,1,-3,4,6;den -Numfactors f

31、actorize (num);Denfactors factorize(den);disp(Numerator Factors 1),disp(Numfactors)disp(Denominator Factors),disp(Denfactors)28.用Kaisers窗函数设计FIR数字高通滤波器,其滤波器的性能指标为: 通带截止频率0.55兀,阻带截止频率0.457:,通带和阻带波纹6=0.04。绘制 出该滤波器的增益响应。% Program 10_5% Lowpass Filter Design Using the Kaiser Windowclc%delta_s50;%阻带哀减del

32、ta_p0.04;$通带哀減%alpha_s10A(-delta_s/20);alpha_p1-10 A(-delta_p/20);fpts 0.45 0.55;令截止频率1,截止频率2mag - 0 1);$截止频率1对应的幅度藪止频率2对应的幅度 dev - alpha_p alpha_p ; $通带衰减阻带衰减(线性) Nr Wn,beta,ftypekaiserord(fpts,mag,dev);b firl(N,Wn,high,kaiser(N+lzbeta);(h,omega freqz(b,1,512);plot(omega/pi,20*logl0(abs(h);grid;xla

33、bel(1omega/pi); ylabel(Gain, dB);29. 绘制6点滑动平均滤波器的幅频特性和相频特性。h ones(1,6)/6;(Hrw freqz(h, lr 256);subplot(211)p1ot(w/piz abs(H);ylabel(Magnitude); xlabel(1omega/pi);subplot(212)ph angle(H)*180/pi;plot(w/piz angle(H)*180/pi);ylabel(1 Phase, degrees 1);xlabel(1omega/pi1);30. 原始序列为:sn=3n(0.8y,加性噪声dn为随机序列,

34、幅度0.6,受干扰的序列为:xn= sn+ dn,使用重叠相加法实现5点滑动平均滤波器 对xn的处理。绘制未受干扰的序列sn和滤波器输出的有噪序列(利用 fltfilt 函数)。% Program 2_4% Signal Smoothing by a Moving-Average FilterR - 40;d 6/5*(rand(1,R)-0.5);m 0:1:R-l;s -3.*m.*0.8.m;x - s + d;subplot(211);plot(m,d,r-*,m,s,*b:,m,x,m-)title(1 The sequence with noise);ylabel(* Amplit

35、ude *)legend(*dn*sn*xn);b ones (5,1)/5;y - fftfilt(b,x);subplot(212);plot(m,s,r-,m,y,b-*)title(The original sequence & the output sequence);legend(* sn,yn);ylabel(Amplitude *)31. 已知IIR滤波器的系统函数为:H(z)=2 4- 5z 4- z2 - 3z3 +4- 6z51 + 3z_, - 5z2 + 2z-3 - 4z + 3z-5用MATLAB对系统进行并联结构I型和并联结构II型分解。num = input(

36、Numerator coefficient vector =);den = input(Denominator coefficient vector = *);rl,pl,kl = residuez(num,den);r2,p2,k2 = residue(num,den);dispCParallel Form I) disp(Residues are);disp(rl); disp(Poles are at);disp(pl); disp(Constant value);disp(kl);disp(Parallel Form IF)disp(Residues are);disp(r2);dis

37、pCPoles are at);disp(p2);disp(Constant value*);disp(k2);到时直接按回车输入分子分母即可,注意0! ! !32. 用海明窗设计多频带FIR滤波器,该滤波器满足如下条件。在频率范围0到0.32兀内幅度为0.6,在频率范围0.35兀到0.65兀内幅度为0.2,在频率范围0.68兀到兀内幅度为0.8。绘制出该滤波器的幅频特性。fpts = O 0.32 0.35 0.65 0.68 1;mval = 0.6 0.6 0.2 0.2 0.8 0.8;b = fir2( 100,fpts,mval);h,omega = freqz(b,l,512);

38、plot(omega/pi,abs(h);grid;xlabeI(omegaApi); ylabel(*Magnitude);33. 已知滤波器的差分方程和输入信号为:yn = -6.76195xw + 13.456335xn-1-6.76195x/?2x/z = cos(0.b?) + cos(0.4n)z/n绘制该系统的输入序列和输出序列的包络。a=l;b=-6.76195 13.456335 -6.76195;n=0:100;x=cos(0.1 .*n)+2*cos(0.4.*n);y=filter(b,a,x); y(l,l:2)=0; subplot(211) stem(n,x,.)

39、 title(,xnj,) subplot(212) stem(n,y,.) titleCytn*)34. 已知系统的系统函数为:1-0.2z14-0.5z24-2z3-0.6z4=1 + 3.2+1.5z_ - 0.8z* +1 .4z7绘制该系统的零极点分布图。num= 1 -0.2 0.5 2 -0.6;den=l 3.2 1.5 -0.8 1.4;zplane(num,den)35. 已知全通系统的系统函数为:3-4z14-2z2-5z34-3z44-z5=+ 3/ _ 5z,+ 2z$ _+ 3才5用MATLAB求全通系统进行级联格型结构的乘法器系数。num= 1 0.4 0.18

40、-0.2; k=poly2rc(num)得到的依次是KI, K2, K336.已知有限长序列为:4 = sin(25H/64),0 /? 63 ,求该序列的64 点离散傅立叶变换Xk,绘制出Xk的幅度。 N=64;n=0:l:63;x=sin(25*pi*n/N);k=512;w = 0:pi/(k-l):pi;h = freqz(x, 1, w);subplot(211);plot(w/pi,abs(h);grid titIe(Magnitude Spectrum) xlabel(omegaApi); ylabel(Magnitude) X=fft(x,64);subplot(212)ste

41、m(n,X,T)37. 设计4阶巴特沃兹模拟低通滤波器,其3dB截止频率为1,绘制滤波器 的增益响应。N = input(Type in filter order =);Wn = input(3-dB cutoff angular frequency =);% Detenuine the transfer functionnum,den = butter(N,Wn,s*);% Compute and plot the frequency responseomega = 0: 200: 12000*pi;h = freqs(num,den,omega);plot (omega/(2*pi ),2

42、0* log 10(abs(h);xlabelfFrequency, Hz); ylabel(Gain, dB);38. 已知系统的零极点分别如下:Z = 2.2, z? = 1 + j,z、 1 j,z4 =1.4P =3.7 + J2,2 =3.7-y2,=-2.1-y,/74 =-2.1 + j求系统的系统函数H(z)。fbnnat longzr = input(Type in the zeros as a row vector =);pr = input(Type in the poles as a row vector =);% Transpose zero and pole row

43、 vectorsz = zr*;p = pr;k = input(Type in the gain constant =);num, den = zp2tf(z, p, k);disp(Numerator polynomial coefficients); disp(num); dispCDenominator polynomial coefiicients); disp(den);39. 设计椭圆IIR数字低通滤波器,其性能指标为:通带截止频率为1000Hz,阻带截止频率为1250Hz,通带波纹为0.4dB,域小阻带衰减为45dB,抽样频率为5000Hzo绘制所设计的滤波器增益响应。Fp =

44、 input(passband edge in Khz =);Fs = input(stopband edge in Khz =);Ft = input(Sampling rate in Khz =);Rp = input(Passband ripple in dB =);Rs = inputCMinimum stopband attenuation in dB =);Wp=2*Fp/Ft;Ws=2*Fs/Ft;N,Wn = ellipord(Wp,Ws,Rp,Rs);b,a = ellip(N,Rp,Rs,Wn);h,omega = freqz(b,a,256);plot (omega/pi

45、,20 *log 10(abs(h);grid;xlabeI(omegaApi); ylabel(Gain, dB);title(IIR Elliptic Lowpass Filter*);%figure(2);%subplot(2,1,1);%plot(omega/pi,20*log 10(abs(h); grid;%axis(0 1 -60 5);%subplot(2,l,2);%plot(omega/pi,20*log 10(abs(h); grid;%axis(0 0.4 -0.6 0.2);40.编写总体均值滤波器程序。原始未受干扰的序列为:sn=3n(0.8)n,加性 噪声信号dn

46、为随机序列,幅度0.6,受干扰的序列为:xn= sn+ dn, 绘制噪声序列和60次检测结果的总体平均的序列。% Program 2_4% Signal Smoothing by a Moving-Average FilterR - input(R -);d 6/5* (rand(l,R)-0.5);m 0:1:R-l;s 3.*m.*0.8.Am;x s + d;subplot(211);plot(m,d,r-,m,s” *b:,m,x,m)title(The sequence with noise *);ylabel(Amplitude)legend(dn,sn*xn*);b ones(R

47、r1)/R;y - fftfilt(b,x);subplot(212);plot(m,s,* r-*y,*b-*)titie(1 The original sequence & the output sequence *);IlllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllPl.已知两序列xn = 0.8iz-un-5, “ = 1,1,1,1,1计算两序列的卷积并绘制其波形。function alfor

48、i=l:5x(i)=0.8A(i-l);endh=l 1111;y=conv(x,h)m=0:8;stcm(m,y,filled)P2已知复指数序列x/z = 1.2eu-5+y2)绘制20点该序列的实部和虚部。n=0:19;x= 1.2*cxp( 1.54j*2)*n);subplot(211);stcm(n,rcal(x);ylabclCrcal part);xlabel(*n);lcgcnd(*xn);subploi(212);stcm(n.imag(x);ylabel(*imag part);xlabcl(n);lcgendCxn);P3.编写长度为5的中值滤波器程序。原始未受干扰的序

49、列为: sn=3n(0.5) %加性噪声信号dn为随机序列,幅度0.4,分别绘制长度为40的受干扰序列, 以及中值滤波器的输出。% Program 2_5% Illustration of Median FilteringN = 5;R = 40;a = 0. 8*rand(l, R)-0.4:b = round(a); % Generate impulse noisem = 0:R-l;s =3*m. *(0. 5. *m) ; % Generate signalx = s + b; % Impulse noise corrupted signaly = medf订tl(x,N); % Median filteringsubplot (2, 1, 1)stem(m, x):xlabel ( n) ;ylabel (* Amplitude*);title(*Impulse Noise Corrupted Signal*):subplot (2, 1, 2)stem(m, y);xlabel C n*):ylabel ( Amplitude*): title( Output of Median Filter*):P4.已知序列 xln=2.2,3,1.5,4.2,1.8,x2n= 0.8,1,1.6,0.8, xn=xln*x2n(卷积),分别绘制序 列 xln ,x2n和 x

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论