How many multiplications in one convolution
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ken
el 3 de Mayo de 2022
Editada: Walter Roberson
el 4 de Mayo de 2022
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 comentarios
Jonas
el 4 de Mayo de 2022
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?
Respuesta aceptada
Walter Roberson
el 4 de Mayo de 2022
Editada: Walter Roberson
el 4 de Mayo de 2022
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!