x=[1,2,0,-1,3,2];h=[1,-1,1];
y1=x*h(1);
y2=x*h(2);
y3=x*h(3);
Y1=[0,0,y1];
Y2=[0,y2,0];
Y3=[y3,0,0];
y=Y1+Y2+Y3;
L=-2:1:5;
figure(1);
subplot(211);stem(L,y,'*');
xlabel('L');ylabel('y');title('(1)');
X=x.';X=X';
r1=X*y(1);r2=X*y(2);r3=X*y(3);r4=X*y(4);
r5=X*y(5);r6=X*y(6);r7=X*y(7);r8=X*y(8);
R1=[0,0,0,0,0,0,0,r1];R2=[0,0,0,0,0,0,r2,0];
R3=[0,0,0,0,0,r3,0,0];R4=[0,0,0,0,r4,0,0,0];
R5=[0,0,0,r5,0,0,0,0];R6=[0,0,r6,0,0,0,0,0];
R7=[0,r7,0,0,0,0,0,0];R8=[r8,0,0,0,0,0,0,0];
R=R1+R2+R3+R4+R5+R6+R7+R8;
n=-7:5;
subplot(212);stem(n,R);title('(2)');
标签:
ketang
上传时间:
2020-11-10
上传用户: