How to Calculate the Convolution?

Hi there,

I can recommend this excellent video to get familiar with 1D conv from a perspective of system and control theory:

Especially the interpretation of results from min 25 on is quite helpful.

Afterwards 2D convolution is straight forward.
As you are pointing out correctly, there are different ways how to deal with the size / boundary areas. This is a question of definition, e.g. with respect to ‘zero padding’, meaning filling in zeros till size requirements are fulfilled. Feel free to take a look at this source: 2-D convolution - MATLAB conv2
Under input argument ‘shape options’ are outlined on how to get:

  • full 2-D convolution.
  • central part of the convolution
  • only parts of the convolution that are computed without zero-padded edges.

When comparing results, please ask yourself which definition of conv is meant / applied and what you need.

Hope that helps!

Best regards

1 Like