
In
signal processing
Signal processing is an electrical engineering subfield that focuses on analyzing, modifying and synthesizing ''signals'', such as audio signal processing, sound, image processing, images, Scalar potential, potential fields, Seismic tomograph ...
, 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
In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a Scalar (mathematics), scalar as a result". It is also used for other symmetric bilinear forms, for example in a pseudo-Euclidean space. N ...
'' or ''sliding inner-product''. It is commonly used for searching a long signal for a shorter, known feature. It has applications in
pattern recognition
Pattern recognition is the task of assigning a class to an observation based on patterns extracted from data. While similar, pattern recognition (PR) is not to be confused with pattern machines (PM) which may possess PR capabilities but their p ...
,
single particle analysis,
electron tomography,
averaging,
cryptanalysis
Cryptanalysis (from the Greek ''kryptós'', "hidden", and ''analýein'', "to analyze") refers to the process of analyzing information systems in order to understand hidden aspects of the systems. Cryptanalysis is used to breach cryptographic se ...
, and
neurophysiology. The cross-correlation is similar in nature to the
convolution
In mathematics (in particular, functional analysis), convolution is a operation (mathematics), mathematical operation on two function (mathematics), functions f and g that produces a third function f*g, as the integral of the product of the two ...
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.
In
probability
Probability is a branch of mathematics and statistics concerning events and numerical descriptions of how likely they are to occur. The probability of an event is a number between 0 and 1; the larger the probability, the more likely an e ...
and
statistics
Statistics (from German language, German: ', "description of a State (polity), state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying statistics to a s ...
, the term ''cross-correlations'' refers to the
correlations between the entries of two
random vectors and
, while the ''correlations'' of a random vector
are the correlations between the entries of
itself, those forming the
correlation matrix of
. If each of
and
is a scalar random variable which is realized repeatedly in a
time series
In mathematics, a time series is a series of data points indexed (or listed or graphed) in time order. Most commonly, a time series is a sequence taken at successive equally spaced points in time. Thus it is a sequence of discrete-time data. ...
, then the correlations of the various temporal instances of
are known as ''autocorrelations'' of
, and the cross-correlations of
with
across time are temporal cross-correlations. In probability and statistics, the definition of correlation always includes a standardising factor in such a way that correlations have values between −1 and +1.
If
and
are two
independent random variable
A random variable (also called random quantity, aleatory variable, or stochastic variable) is a Mathematics, mathematical formalization of a quantity or object which depends on randomness, random events. The term 'random variable' in its mathema ...
s with
probability density functions
and
, respectively, then the probability density of the difference
is formally given by the cross-correlation (in the signal-processing sense)
; however, this terminology is not used in probability and statistics. In contrast, the
convolution
In mathematics (in particular, functional analysis), convolution is a operation (mathematics), mathematical operation on two function (mathematics), functions f and g that produces a third function f*g, as the integral of the product of the two ...
(equivalent to the cross-correlation of
and
) gives the probability density function of the sum
.
Cross-correlation of deterministic signals
For continuous functions
and
, the cross-correlation is defined as:
which is equivalent to
where
denotes the
complex conjugate of
, and
is called ''displacement'' or ''lag''.
For highly-correlated
and
which have a maximum cross-correlation at a particular
, a feature in
at
also occurs later in
at
, hence
could be described to ''lag''
by
.
If
and
are both continuous periodic functions of period
, the integration from
to
is replaced by integration over any interval