How are two signals multiplied? And how is it different from convolving two signals??

I have read the above question on dsp stack exchange and i also tried it in my matlab , code is as follow:

clear all
close all
y1=x.*p   % result of multiplicaton
y2=conv(x,p) % result of convolution

But Matlab gives answer as given in that link but i am confused,about convolution steps, why only 5(first element of 2nd vector ) is multiplied with all there 3 element of first vector making up 3 different terms of final answer(as shown in attached photo) but 2nd element(blue under line) & 3rd element(red under line) of 2nd matrix do not repeat the same steps as followed for first element?why they are not multiplied by all elements of first vector as was the case with 5

enter image description here?


1 Answer 1


Just write down the convolution sum to see what's going on:


where we define the elements of the sequences $x[n]$ and $p[n]$ as equal to zero for the index $n$ outside the range of non-zero values, i.e., outside $n\in[0,2]$. Taking into account those zero values, we can rewrite $(1)$ with finite summation limits:


because for $k<0$ all $x[k]$ are zero, and for $k>n$ the elements $p[n-k]$ are zero. Now you see that as $n$ increases from $0$ to $2$ (outside that range the term $x[k]$ will be zero), you'll get more terms in the sum $(2)$:

$$\begin{align}y[0]&=x[0]\cdot p[0]\\ y[1]&=x[0]\cdot p[1]+x[1]\cdot p[0]\\ y[2]&=x[0]\cdot p[2]+x[1]\cdot p[1]+x[2]\cdot p[0]\end{align}$$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.