### 5.23.3 Convolution of two signals : convolution

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 :

z_{k}= | | v_{i} w_{k−i}, k=0,1,…,N−1, |

such that v_{j}=0 for j≥ n and w_{j}=0 for j≥ m . For example, input :

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

Output :

[1.0,1.0,2.0,-2.0,1.0,-3.0]