Conv Prog
Conv Prog
and its range h = [3 5 2 -4 -5 -2]; nh = -1:4; %define sequence h[n] and its range nmin = min(nx)+min(nh); %specify the lower bound of convolved sequences nmax = max(nx)+max(nh); %specify the upper bound of convolved sequences y = conv(x,h); n = nmin:nmax; %compute convolution and specify its range stem(n,y); grid %plot the resulting sequence y[n] title('convolution of two sequences'); %add title to the plot ylabel('y[n]=x[n]*h[n]') %label the y-axis xlabel('index, [n]') %label the horizontal axis Ans : n: -4 -3 58 -2 92 -1 47 0 1 2 -78 3 11 4 41 5 6 6 7
y(n): 15
-60 -128
-17 -10
Plot of y(n) is :
convolution of two sequences 100
50
y[n]=x[n]*h[n]
-50
-100
-150 -4
-2
2 index, [n]