In Matlab, there is an implemented convolution functions. In this article, I will introduce some implementation of basic convolutions.

For random vector x and y, i.e.,

x = rand(1,50) * 100;

y = rand(1,50) * 100;

will create the size-of-50-sequence.

In this situation, If you want the linear convolution is calculated, Use the implemented function in Matlab,

conv(x,y)

that result convolution sequence will have the size of 50+50-1 = 99.

There is another function called circular convolution. In general, if you want the circular convolution is exist, then the two sequence that is calculated must have the same size. In this example, x and y have same size. So, there is no problem if you write the next function: