实验六离散线性时不变系统分析实验报告

实验六离散线性时不变系统分析实验报告  实验六 离散线性时不变系统分析 1. 设系统冲激响应为,0 5[ ]0,n nh nothers? ? ?? ??,输入信号为1,0 5[ ]0,nx not

实验六离散线性时不变系统分析实验报告 实验六离散线性时不变系统分析1.设系统冲激响应为,0 5[]0,nnhnothers??????,输入信号为1,05[]0,nx nothers??????,(1)求输出1[][][]ynxnhn?? ;主程序如下: n=[-5:20];u1=stepseq(0,-5,20);u2=stepseq(6,-5,20); x=u1-u2;h=n.*x;subplot(3,1,1);stem(n,x);axis([-5200 2]);title("InputSequence");ylabel("x[n]"); subplot(3,1,2);stem(n,h);axis([-52006]);title("Inpulse Response");ylabel("h[n]");[y1,ny]=convm(x,n,h,n); subplot(3,1,3);stem(ny,y1);title("Output Sequence");xlabel("n");ylabel("y1[n]");Stepseq.m的源程序 如下: function[x,n]=stepseq(n0,n1,n2);ifnargin~=3 disp("Usage:Y=stepseq(n0,n1,n2)");elseif((n0n2)|(n1>n2)); endn=[n1:n2];x=[(n-n0)>=0];convm.m的源程序如下: function[y,cy]=convm(x,nx,h,nh)ifnargin~=4 disp("Usage:Y=convm(x,nx,h,nh)");return;end; nyb=nx(1)+nh(1);nye=nx(length(x))+nh(length(x)); ny=[nyb:nye];y=conv(x,h); (2)求输出2[][][5]ynxnhn???n=-10:20; u1=stepseq(0,-10,20);u2=stepseq(6,-10,20);x=u1-u2; u3=stepseq(-5,-10,20);u4=stepseq(1,-10,20);x1=u3-u4; h=(n+5).*x1;subplot(3,1,1);stem(n,x);axis([-10200 2]);title("Inputsequence");ylabel("x[n]");

腾讯文库实验六离散线性时不变系统分析实验报告