1
$\begingroup$

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:

clc
clear all
close all
x=[2,4,1]
p=[5,1,8]
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?

$\endgroup$
2
$\begingroup$

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

$$y[n]=\sum_{k=-\infty}^{\infty}x[k]p[n-k]\tag{1}$$

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:

$$y[n]=\sum_{k=0}^{n}x[k]p[n-k]\tag{2}$$

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}$$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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