How convolution with 'same' parameter select the first item?

2 ビュー (過去 30 日間)
yu chen
yu chen 2018 年 7 月 22 日
回答済み: Image Analyst 2018 年 7 月 22 日
In the example of 'same' shape,
u = [-1 2 3 -2 0 1 2];
v = [2 4 -1 1];
w = conv(u,v,'same')
w =
15 5 -9 7 6 7 -1
The full convolution is [-2 0 15 5 -9 7 6 7 -1 2]. Why start from the 3rd item 15? Not 2nd item 0?

回答 (1 件)

Image Analyst
Image Analyst 2018 年 7 月 22 日
The full convolution has more numbers because the window can "go off" the edge of the data. Do you understand that part? If so, the answer should be obvious. Where do you think the 15 should go? Remember there are no negative indexes or zero indexes.

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by