thumb|400px|Visual comparison of convolution, cross-correlation and [[autocorrelation. For the operations involving function , and assuming the height of is 1.0, the value of the result at 5 different points is indicated by the shaded area below each point. Also, the vertical symmetry of is the reason f*g and f \star g are identical in this example.]]
thumb|400px|Visual comparison of convolution, cross-correlation and [[autocorrelation. For the operations involving function , and assuming the height of is 1.0, the value of the result at 5 different points is indicated by the shaded area below each point. Also, the vertical symmetry of is the reason f*g and f \star g are identical in this example.]]
In signal processing, cross-correlation is a measure of similarity of two series as a function of the displacement of one relative to the other. This is also known as a sliding dot product or sliding inner-product. It is commonly used for searching a long signal for a shorter, known feature. It has applications in pattern recognition, single particle analysis, electron tomography, averaging, cryptanalysis, and neurophysiology. The cross-correlation is similar in nature to the convolution of two functions. In an autocorrelation, which is the cross-correlation of a signal with itself, there will always be a peak at a lag of zero, and its size will be the signal energy.
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).