对 MATLAB 卷积实现的理解感到困惑?
我正在尝试在 MATLAB 中实现卷积而不使用内置命令。我已经从谷歌获得了一段代码以及一些如何理解它的代码,但仍然存在一些困惑,特别是关于突出显示的行,更具体地说是关于红色圆圈术语,我知道我们正在使用嵌套 for 循环来限制积分,但我无法了解红色圆圈项背后的逻辑,该项与我们的卷积公式有何关系。如果我删除这个术语,我的结果不再有效此外
,在典型的卷积理论公式中,我们看到输入与移位脉冲相乘或移位输入与脉冲相乘,但在这里它们在没有任何明显移位的情况下相乘
我的代码如下:
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论