
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
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 sec ...
, and
neurophysiology. The cross-correlation is similar in nature to the
convolution of two functions. In an
autocorrelation
Autocorrelation, sometimes known as serial correlation in the discrete time case, is the correlation of a signal with a delayed copy of itself as a function of delay. Informally, it is the similarity between observations of a random variable ...
, 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 and
statistics
Statistics (from German language, German: ''wikt:Statistik#German, Statistik'', "description of a State (polity), state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of ...
, 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
In statistics, correlation or dependence is any statistical relationship, whether causal or not, between two random variables or bivariate data. Although in the broadest sense, "correlation" may indicate any type of association, in statistic ...
of
. If each of
and
is a scalar random variable which is realized repeatedly in a
time series, 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 mathematical formalization of a quantity or object which depends on random events. It is a mapping or a function from possible outcomes (e.g., the po ...
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 (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