Professional Documents
Culture Documents
Submitted By
Objective:
Code:
x= [2,6,2,2]
h= [4,2,1,1]
a=length(x)
b=length(h)
X=[x,zeros(1,b)]
H=[h,zeros(1,a)]
for i=1:(a+b)-1
y(i)=0
for j=1:a
if (i-j+1)>0
y(i)= y(i)+X(j)*H(i-j+1)
else
end
end
end
subplot(3,2,1)
stem(X)
subplot( 3,2,2)
stem(H)
subplot(3,2,3)
stem(y)
Steps:
Generate code in Matlab and execute it using the given inputs, the convolution product will be shown on the graphs.
Observations and Results:
Conclusion:
Through this lab we learned how to execute discrete convolution in Matlab.
Marks Distribution:
------------------------------------