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=vw of length n+m−1 given by

zk=
k
i=0
vi wki,   k=0,1,…,N−1, 

such that vj=0 for jn and wj=0 for jm.

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

+∞


−∞
f(tg(xtdt 

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=vw 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