The cross correlation of two complex vectors v=[v1,…,vn] and w=[w1,…,wm] is the complex vector z=v⋆ w of length n+m−1 given by
zk= |
|
| wi∗, k=0,1,…,N−1, |
where
v∗=[v0,v1,…,vn−1, |
| ] and w∗=[ |
| ,w0,w1,…,wm−1]. |
Cross-correlation is typically used for measuring similarity between signals.
The cross_correlation command computes the cross correlation of two vectors.
Examples.
⎡ ⎣ | 6.0,11.0,14.0,5.0 | ⎤ ⎦ |
v:=[2,1,3,2]:; w:=[1,-1,1,2,2,1,3,2,1]:; |
round(cross_correlation(v,w)) |
⎡ ⎣ | 2,1,0,8,9,12,15,18,13,11,5,2 | ⎤ ⎦ |