Discrete Convolution

6.7k Views Asked by At

Does someone know the equation for the discrete convolution? I found here that the formula is:

$$\{x*h\}[k]=\sum_{t=-\infty}^{+\infty}{x[t]\cdot h[k-t]}$$

But when using in Matlab/Octave the command below:

 conv(a,b)

With a = [1:3] and b = [5:8] I get that the answer is [5, 16, 34, 40, 37, 24]. But I can't find any initial value for "t" to get that result. Is the equation correct? What are the values for "t"?

Thanks in advance!

1

There are 1 best solutions below

0
On BEST ANSWER

When all else fails, read the manual :)

Let m = length(u) and n = length(v). Then w [the output of conv(u,v) is the vector of length m+n-1 whose kth element is $$w(k)=\sum_j u(j)v(k-j+1)$$ The sum is over all the values of j which lead to legal subscripts for u(j) and v(k+1-j), specifically j = max(1,k+1-n) : min(k,m).

In your example, $m=3$ and $n=4$. With $k=2$ (for instance), the summation is over j=1 : 2
$$w(2) = u(1)v(2)+u(2)v(1)=1\cdot 6+2\cdot 5=16$$