How many multiplications in one convolution
4 ビュー (過去 30 日間)
古いコメントを表示
C = [1;2;3]; % i.e. a column vector, hence named "C"
R = [1 2 3]; % i.e. a row vector, "R"
F = [1 4 6 4 1; 4 16 24 16 4; 6 24 36 24 6; 4 16 24 16 4; 1 4 6 4 1];
Let "*" denote the convolution operator.
J = C * R * F
How many multiplications are required for the above convolution to get J?
2 件のコメント
Jonas
2022 年 5 月 4 日
are you interested in the 2d convolution of those variables? and if not, how is your convolution defined between a row and a column vector, respectively between a row vector and a matrix?
採用された回答
Walter Roberson
2022 年 5 月 4 日
編集済み: Walter Roberson
2022 年 5 月 4 日
For a 1D convolution, one step in a convolution involves as many multiplications as min() of the lengths of the two parameters (and then a sum.) The shorter vector is then moved one step to the right and another set of multiplication is done, and then the window is moved again, and so on.
The exact number of steps will depend upon which boundary conditions you are using, "full", "valid" or "same". Also, the exact number of multiplications will depend upon how you implement the boundary conditions: if you are currently positioned so that (say) 3 entries from the shorter vector are "off the edge" then those entries can be thought of as being multiplied by 0... but do you count those multiplications or do you say that the implementation of the convolution is strong enough that it does not perform those multiplications with 0 (even though that is the fasted way to implement) ?
A 2D convolution is similar, but once one row is finished then the convolution moves down and processes the next row; and you have to worry about the boundary conditions for vertical movement as well.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!