cross_correlation takes two arguments, a complex vector v of length n and a complex vector w of length m . The returned value is the complex vector z=v⋆w of length N=n+m−1 which is the cross-correlation of the two input vectors, i.e. such that the following holds :
|] and w∗=[|
Cross-correlation is typically used for measuring similarity between signals.
For example, input :
Observe that the cross-correlation of v and w is peaking at position 8 with the value 18, indicating that the two signals are best correlated when the last sample in v is aligned with the eighth sample in w. Indeed, there is an occurrence of v in w precisely at that point.