Previous Up Next

15.2.8 Convolution of two signals or functions: convolution

The convolution of two real vectors v=[v1,…,vn] and w=[w1,…,wm] is the complex vector z=v∗ w of length n+m−1 given by

zk=
k
∑
i=0
vi wk−i,  k=0,1,…,N−1, 

such that vj=0 for j≥ n and wj=0 for j≥ m.

The convolution of two real functions f(x) and g(x) is the integral

∫
+∞


−∞
f(t) g(x−t) dt 

variable x as an optional third argument, in which case the convolution takes two arguments, a real vector v of length n and a real vector w of length m , and returns their convolution z=v∗w which is the vector of length N=n+m−1 defined as:

The convolution command finds the convolution of two vectors or two functions.

For the convolution of two vectors:


Example.
Input:

convolution([1,2,3],[1,-1,1,-1])

Output:

⎡
⎣
1.0,1.0,2.0,−2.0,1.0,−3.0⎤
⎦

For the convolution of two functions:


Examples.


Previous Up Next