In: Computer Science
Comment the code explaining what each line is doing. The first line has been done for you.
x=[0 0 -1 2 3 -2 0 1 0 0]; %input discrete-time signal
x dtx= -2:7;
y=[1 -1 2 4];
dty=8:11;
z=conv(x,y);
dtz=6:18;
subplot(1,3,1), stem(dtx,x)
subplot(1,3,2), stem(dty,y)
subplot(1,3,3), stem(dtz,z)
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
x=[0 0 -1 2 3 -2 0 1 0 0]; %input discrete-time signal
dtx= -2:7; % it basically makes a vector from -2 to 7 with
increment of 1 and store in variable dtx
y=[1 -1 2 4];% a vector y with elements 1, -1,2 and 4
dty=8:11;% a vector dty with elements from 8 to 11 with increments
of 1
z=conv(x,y)% it is basically giving the coefficients of resulting
polynomial coming from multiplication of polunomials with
coefficients x and y
dtz=6:18;% a vector dty with elements from 6 to 18 with increments
of 1
subplot(1,3,1), stem(dtx,x)% it gives a dicrete plot of x vs dtx
where dtx on x axis and x on y axis
subplot(1,3,2), stem(dty,y)% it gives a dicrete plot of y vs dty
where dty on x axis and y on y axis
subplot(1,3,3), stem(dtz,z)% it gives a dicrete plot of z vs dtz
where dtz on x axis and z on y axis
Kindly revert for any queries
Thanks.