matlab-Lab1.doc_第1页
matlab-Lab1.doc_第2页
matlab-Lab1.doc_第3页
matlab-Lab1.doc_第4页
matlab-Lab1.doc_第5页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

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

文档简介

Assignment of Signals and Systems Lab 1 1.4 Properties of Discrete-Time SystemsBasic ProblemsIntroduction: In these problems,we need to tell and demonstrate which property a given system does not satisfy.Use MATLAB vectors to represent the inputs and outputs,and plot figures to construct a reasoned argument that can demonstrate our judgement.(a) The system yn=Sin(/2)xn) is not linear.Use the signals x1n= n and x2n=2 n to demonstrate how the system violates linearity.Solution:MATLAB code:n=-10:10;x1=zeros(1,10),1,zeros(1,10);x2=zeros(1,10),2,zeros(1,10);y1=sin(pi/2)*x1);y2=sin(pi/2)*x2);x=2*x1+3*x2;y=2*y1+3*y2;yn=sin(pi/2)*x);subplot(121);stem(n,y);xlabel(n);ylabel(y);title(y=2*y1+3*y2);subplot(122);stem(n,yn);xlabel(n);ylabel(yn);title(yn=sin(pi/2)*x);Basic problem aWe suppose a=1,b=1,x1nsin(pi/2)*x1n),x2n-sin(pi/2)*xn);Suppose xn=x1n+x2n;from the figure: yn is not equel to y;So it is not linear.(b) The system yn=xn+xn+1 is not causal.Use the signals xn=un to demonstrate this .Define the MATLAB vectors x and y to represent the input on the interval -5n9,and the output on the interval -6n9 ,respectively.Solution:MATLAB code:u = inline(n = 0);n = -5:9;x = u(n);y = u(n) + u(n + 1);stem(n, y);axis(-5 9 -6 9);We know that yn is not only determined by xn, but also xn+1.So the system is not causal.Intermediate ProblemsIntroduction: In these problems,we need to discover an input or pair of input signals that can demonstrate why the system does not satisfy the property.(c)The system yn=log(xn) is not stable.Solution:MATLAB code:x=0:100;y=log(x);stem(x,y);So when the input is infinity,the output should be infinity too.So the system is not stable.(d)The system yn=Sin(/2)xn) is not invertible.Solution:MATLAB code:x1=0:100;x2=4:104;y1=sin(0.5*pi)*x1);y2=sin(0.5*pi)*x2);subplot(2,1,1),stem(y1);subplot(2,1,2),stem(y2);So we can see the outputs are the same even the inputs are different.And we know the system is not invertible.Advanced ProblemsIntroduction: In these problems,we need to state whether or not the system is linear,time-invariant,causal,stable,and invertible.And we need to construct a counter-argument for each property that the system is not satisfied.(e)yn=x3nSolution:n=-30:30;x=n;y=x.3;stem(n,y);This system is not linear,stable,but invertible ,causal and time-invariant.This system is not linear because it does not satisfy the equation “yax1+bx2=ayx1+byx2”.This system is not stable because when the input is infinity,the output should be infinity too.(f) yn=n xnSolution:This system is not invertible and time -varying, not stable ,but linear.(1) time-varyingMATLAB code:u = inline(n = 0);n = -3:3;x1 = u(n);x2 = u(n - 1);y1 = n .* x1;y2 = n .* x2;subplot(2, 1, 1),stem(n,y1);subplot(2, 1, 2),stem(n,y2);We know that y2ny1n-1 when x1n= n and x2n=x1n-1So the system is time-varying.(2) not invertibleMATLAB code:n = -6:6;x = n;y = n .* x; stem(n, y);We can find the same output when inputs are different.So the system is not invertible.(g)yn=x 2nSolution:This system is not causal and not invertible ,but time-invariant ,linear and stable.MATLAB code:x = inline(n);n = -6:6;y1 = x(2 * n);y2 = x(n);subplot(2, 1, 1),stem(n, y1);subplot(2, 1, 2),stem(n, y2);We know the output on the interval n0 is not 0,so the system is not causal.We can also find that we cant get xn from x2n,so the system is not invertible.1.5 Implementing a First-Order Difference EquationIntroduction:This assignment is about implementing a First-Order Difference Equation.Advanced Problemsa) Write a function y=diffeqn(a,x,yn1) which computes the output yn of the causal system determined by Eq.(1.6). The input vector x contains sn for 0=n=N-1 and yn1 supplies the value of y-1. The output vector y contains yn for 0=n=N-1. The first line poof your M-file should readfunction y = diffeqn(a,x,yn1)Hint:Note that y-1 is necessary for computing y0, which is the first step of the autoregression. Use a for loop in your M-file to compute yn for successively larger values of n, starting with n=0MATLAB code:function y = diffeqn(a,x,yn1)y(1)=yn1;for n=0:30 y(n+2)=a*y(n+1)+x(n+1);endb) Assume that a =1,y-1=0,and that we are only interested in the output over the interval 0=n=30. Use your function to compute the response due to x1n=n and x2n=un,the unit impulse and unit step, respectively. Plot each response using stem.MATLAB code:a=1;yn1=0;x1=1 zeros(1,30);y=diffeqn(a,x1,yn1);stem(-1:30,y);c) Assume again that a=1, but that y-1=-1. Use your function to compute yn over 0=n=30 when the inputs are x1n=un and x2n=2un.Define the outputs produced by the two signals to y1n and y2n ,respectively. Use stem to display both outputs. Use stem to plot (2y1n-y2n). Given that Eq.(1.6) is a linear difference equation ,why isnt this difference identically zero?MATLAB code:a=1;yn1=-1;x2=1 ones(1,30);y=diffeqn(a,x2,yn1);stem(-1:30,y);Because xn is not identically zero .The system is not linear.MATLAB code:a=1;yn1=-1;x1=1 ones(1,30);y1=diffeqn(a,x1,yn1);x2=2 2*ones(1,30);y2=diffeqn(a,x2,yn1);subplot(3,1,1),stem(-1:30,y1);subplot(3,1,2),stem(-1:30,y2);subplot(3,1,3),stem(-1:30,2*y1-y2);d) The causal systems described by Eq.(1.6) are BIBO(bounded-input bounded-output) stable whenever |a| 1. A property of these stable systems is that the effect of the initial condition becomes insignificant for sufficiently large n. Assume a = 1/2 and that x contains xn=un for 0=n=30. Assuming both y-1=0 and y-1=1/2, compute the two output signals yn for 0=n=3

温馨提示

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

评论

0/150

提交评论