收藏 分享(赏)

东南大学信号与系统MATLAB实践第三次作业.doc

上传人:精品资料 文档编号:9796369 上传时间:2019-09-04 格式:DOC 页数:21 大小:116.50KB
下载 相关 举报
东南大学信号与系统MATLAB实践第三次作业.doc_第1页
第1页 / 共21页
东南大学信号与系统MATLAB实践第三次作业.doc_第2页
第2页 / 共21页
东南大学信号与系统MATLAB实践第三次作业.doc_第3页
第3页 / 共21页
东南大学信号与系统MATLAB实践第三次作业.doc_第4页
第4页 / 共21页
东南大学信号与系统MATLAB实践第三次作业.doc_第5页
第5页 / 共21页
点击查看更多>>
资源描述

1、练习三实验三五1help windowWINDOW Window function gateway.WINDOW(WNAME,N) returns an N-point window of type specifiedby the function handle WNAME in a column vector. WNAME canbe any valid window function name, for example:bartlett - Bartlett window.barthannwin - Modified Bartlett-Hanning window. blackman -

2、Blackman window.blackmanharris - Minimum 4-term Blackman-Harris window.bohmanwin - Bohman window.chebwin - Chebyshev window.flattopwin - Flat Top window.gausswin - Gaussian window.hamming - Hamming window.hann - Hann window.kaiser - Kaiser window.nuttallwin - Nuttall defined minimum 4-term Blackman-

3、Harris window.parzenwin - Parzen (de la Valle-Poussin) window.rectwin - Rectangular window.tukeywin - Tukey window.triang - Triangular window.WINDOW(WNAME,N,OPT) designs the window with the optional input argumentspecified in OPT. To see what the optional input arguments are, see the helpfor the ind

4、ividual windows, for example, KAISER or CHEBWIN.WINDOW launches the Window Design w = window(blackmanharris,N);w1 = window(hamming,N);w2 = window(gausswin,N,2.5);plot(1:N,w,w1,w2); axis(1 N 0 1);legend(Blackman-Harris,Hamming,Gaussian);See also bartlett, barthannwin, blackman, blackmanharris, bohman

5、win, chebwin, gausswin, hamming, hann, kaiser, nuttallwin, parzenwin, rectwin, triang, tukeywin, wintool.Overloaded functions or methods (ones with the same name in other directories)help fdesign/window.mReference page in Help browserdoc window2.N = 128;w = window(rectwin,N);w1 = window(bartlett,N);

6、w2 = window(hamming,N);plot(1:N,w,w1,w2); axis(1 N 0 1);legend(矩形窗,Bartlett,Hamming);20 40 60 80 100 12000.10.20.30.40.50.60.70.80.91信 信 信BartlettHamming3.wvtool(w,w1,w2)20 40 60 80 100 12000.20.40.60.81SamplesAmplitudeTime domain0 0.2 0.4 0.6 0.8-120-100-80-60-40-200204060Normalized Frequency ( rad

7、/sample)Magnitude (dB)Frequency domain六ts=0.01;N=20;t=0:ts:(N-1)*ts;x=2*sin(4*pi*t)+5*cos(6*pi*t);g=fft(x,N);y=abs(g)/100;figure(1):plot(0:2*pi/N:2*pi*(N-1)/N,y);grid;0 1 2 3 4 5 600.050.10.150.20.250.30.350.40.45ts=0.01;N=30;t=0:ts:(N-1)*ts;x=2*sin(4*pi*t)+5*cos(6*pi*t);g=fft(x,N);y=abs(g)/100;figu

8、re(2):plot(0:2*pi/N:2*pi*(N-1)/N,y);grid;0 1 2 3 4 5 6 700.10.20.30.40.50.60.7ts=0.01;N=50;t=0:ts:(N-1)*ts;x=2*sin(4*pi*t)+5*cos(6*pi*t);g=fft(x,N);y=abs(g)/100;figure(3):plot(0:2*pi/N:2*pi*(N-1)/N,y);grid;0 1 2 3 4 5 6 700.10.20.30.40.50.60.70.80.91ts=0.01;N=100;t=0:ts:(N-1)*ts;x=2*sin(4*pi*t)+5*co

9、s(6*pi*t);g=fft(x,N);y=abs(g)/100;figure(4):plot(0:2*pi/N:2*pi*(N-1)/N,y);grid;0 1 2 3 4 5 6 700.511.522.5ts=0.01;N=150;t=0:ts:(N-1)*ts;x=2*sin(4*pi*t)+5*cos(6*pi*t);g=fft(x,N);y=abs(g)/100;figure(5):plot(0:2*pi/N:2*pi*(N-1)/N,y);grid;0 1 2 3 4 5 6 700.511.522.53实验八1%冲激响应 clear;b=1,3;a=1,3,2;sys=tf(

10、b,a);impulse(sys);结果:0 1 2 3 4 5 600.10.20.30.40.50.60.70.80.91信信信BartlettHmmingImpulse ResponseTime (sec)Amplitude%求零输入响应 A=1,3;0,-2;B=1;2;Q=ABQ =4-1 clearB=1,3;A=1,3,2;a,b,c,d=tf2ss(B,A)sys=ss(a,b,c,d);x0=4;-1;initial(sys,x0);grid;a =-3 -21 0b =10c =1 3d =00 1 2 3 4 5 600.20.40.60.811.21.4 Respons

11、e to Initial ConditionsTime (sec)Amplitude2.%冲激响应 clear;b=1,3;a=1,2,2;sys=tf(b,a);impulse(sys)0 1 2 3 4 5 6-0.200.20.40.60.811.2 Impulse ResponseTime (sec)Amplitude%求零输入响应 A=1,3;1,-2;B=1;2;Q=ABQ =1.6000-0.2000 clearB=1,3;A=1,2,2;a,b,c,d=tf2ss(B,A)sys=ss(a,b,c,d);x0=1.6;-0.2;initial(sys,x0);grid;a =-

12、2 -21 0b =10c =1 3d =00 1 2 3 4 5 6-0.200.20.40.60.811.21.41.6 Response to Initial ConditionsTime (sec)Amplitude3.%冲激响应 clear;b=1,3;a=1,2,1;sys=tf(b,a);impulse(sys)0 5 10 1500.20.40.60.811.21.4 Impulse ResponseTime (sec)Amplitude%求零输入响应 A=1,3;1,-1;B=1;2;Q=ABQ =1.7500-0.2500 clearB=1,3;A=1,2,1;a,b,c,

13、d=tf2ss(B,A)sys=ss(a,b,c,d);x0=1.75;-0.25;initial(sys,x0);grid;a =-2 -11 0b =10c =1 3d =00 5 10 1500.20.40.60.811.21.41.6 Response to Initial ConditionsTime (sec)Amplitude二 clear;b=1;a=1,1,1,0;sys=tf(b,a);subplot(2,1,1);impulse(sys);title(冲击响应);subplot(2,1,2);step(sys);title(阶跃响应 );t=0:0.01:20;e=sin

14、(t);r=lsim(sys,e,t);figure;subplot(2,1,1);plot(t,e);xlabel(Time);ylabel(A);title(激励信号);subplot(2,1,2);plot(t,r);xlabel(Time);ylabel(A);title(响应信号);0 2 4 6 8 10 12 14 16 18 2000.511.5 信信信信Time (sec)Amplitude0 2 4 6 8 10 12 14 16 18 2005101520 信信信信Time (sec)Amplitude0 2 4 6 8 10 12 14 16 18 20-1-0.500

15、.51TimeA信 信 信 信0 2 4 6 8 10 12 14 16 18 20-10123TimeA信 信 信 信三1. clear;b=1,3;a=1,3,2;t=0:0.08:8;e=exp(-3*t);sys=tf(b,a);lsim(sys,e,t);0 1 2 3 4 5 6 7 800.10.20.30.40.50.60.70.80.91 Linear Simulation ResultsTime (sec)Amplitude2. clear;b=1,3;a=1,2,2;t=0:0.08:8;sys=tf(b,a);step(sys)0 1 2 3 4 5 600.20.40

16、.60.811.21.41.6 Step ResponseTime (sec)Amplitude3 clear;b=1,3;a=1,2,1;t=0:0.08:8;e=exp(-2*t);sys=tf(b,a);lsim(sys,e,t);0 1 2 3 4 5 6 7 800.10.20.30.40.50.60.70.80.91 Linear Simulation ResultsTime (sec)AmplitudeDoc:1. clear;B=1;A=1,1,1;sys=tf(B,A,-1);n=0:200;e=5+cos(0.2*pi*n)+2*sin(0.7*pi*n);r=lsim(sys,e);stem(n,r); 0 20 40 60 80 100 120 140 160 180 200-30-20-1001020302. clear;B=1,1,1;A=1,-0.5,-0.5;sys=tf(B,A,-1);e=1,zeros(1,100);n=0:100;r=lsim(sys,e);stem(n,r); 0 10 20 30 40 50 60 70 80 90 10000.511.522.5

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 企业管理 > 管理学资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报