2、〃)+25(〃-1)+35(〃一2)+4/(粒一3)+5J(n-4)(6)序歹必(a?)=5(”)+25(〃-1)+8{n-2)+25{n—3)•3、利用MATLAB编制一个计算两个序列线性卷积的通用程序,计算上述两序列,并绘制卷积后序列的波形。1(1),单位脉冲序列n=0:10;x二[0,1,0,0,0,0,0,0,0,0,0];stem(n,x);gridonUne([0,10],[0,0];color,;r,);xlabel(,n,),ylabel('delta[nj,);axis([0,10,-2,2]);(2)单位阶跃序列n=0:5;x2=[ones(l,6)];st
3、em(n,x2);gridon;line([0,5],[0,0];color,;r,);xlabel('n'),ylabel(*u[n]');axis([0,5,-2,2]);(3)矩形序列n=0:9;x3=[ones(l,8),0,0];stem(n,x3);gridon;line([0,9],[0,0];color,;r,);xlabel('n'),ylabel(*R8[nJ*);axis([0,9,・2,2]);(4)正弦序列A=3;n=-10:30;x4=A*sin(pi/5*n+pi/3);stem(n,x4);gridon;line(卜10,30],[0,0],'c
4、oloF,T‘);line([0,0],[-5,5];color,;r,);xlabel('n'),ylabel('sin[n]^);axis([-10,30,-5,5]);(5)x=[l,2,3,4,5,0,0,0,0,0];n=0:9;stem(n,x);gridon;line([0,9],[0,0],'color','r1);xlabel('n'),yl^bel('x(n)');axis([0,9,0,5]);(6)x=[1,2,1,2,0,0,0,0,0,0];n=0:9;stem(n,x);gridon;line([0,9],[0,0];colorr);xlabel
5、('n'),ylabel('h(n)*);axis([0,9,0,4]);(壬5o.::As4J>CO2(5)移位x=[1,2,3,4,5,0,0,0,0,0];m=2;nl=O:(length(x)-l);n2=0:(length(x)-1+m);x1=zeros(1,m+length(x));fork=m+l:m+length(x)xl(k)=x(k-m);end;subplot(2,lJ),stem(n1,x);axis([0,9,0,5]);grid;xlabel(h),ylBbel('x[n]');subplot(2,1,2),stem(n2,xl);axis([0,
6、9,0,5]);grid;xlabel(h),ylabel('xl[n]);n(5)反转x=[l,2,3,4,5,0,0,0,0,0];y=fliplr(x);n1=0:9;n2=-fliplr(nl);subplot(2,l,l),stem(nl,x);axis(卜9,9,-1,5]);grid;xlabel(h),ylabel('x[n]');subplot(2,l,2),stem(n2,y);axis([-9,9,-l,5]);grid;xlabelCnXylabeK/ytn]');LL“、Y.尸b■■YT[才€43O-8-6-2O28L*LL••▲7'FD▽D••111
7、I43-8-2O28冬21(6)移位x=[l,2,l,2,0,0,0,0,0,0];m=2;nl=0:(length(x)-I);n2=0:(length(x)-l+m);x1=zeros(l,m+length(x));fork=m+1:m+length(x)xl(k)=x(k-m);end;subplot(2J,l),stem(n1,x);axis([0,9,0,5]);grid;xlabel(h),ylabelCx[n]);subplot(2,l,2),stem(n2,x1);axis(