1 year ago
#301432
LECS
Confusion understanding MATLAB implementation of convolution?
I am trying to implement convolution in MATLAB without using built in command. I have obtained a code from google and some how understood it but still there is some confusion especially regarding the highlighted line and more specifically about the red encircled term, i know that we are using nested for loops for limits of integral but i am unable to understand the logic behind the red encircled term, how is this term relating to our formula of convolution. If i remove this term,my results are not valid any more
Also in typical theory formula of convolution we see input is multiplied with shifted impulse or shifted input is mulltiplied with impulse but here they are being multiplied without any apparent shift
My code is below:
clear
x=[1 2]
h=[3 4 5]
N = length(x);
M = length(h);
length_out=N+M-1;
y=zeros(1,length_out);
for i = 1:N
for k = 1:M
y(i+k-1) = y(i+k-1) + h(k)*x(i);
end
end
matlab
convolution
0 Answers
Your Answer