Crosscorrelation
In signal processing, crosscorrelation is a measure of similarity of two waveforms as a function of a timelag applied to one of them. This is also known as a sliding dot product or sliding innerproduct. It is commonly used for searching a long signal for a shorter, known feature. It has applications in pattern recognition, single particle analysis, electron tomographic averaging, cryptanalysis, and neurophysiology.
For continuous functions f and g, the crosscorrelation is defined as:
where f* denotes the complex conjugate of f and t is the time lag.
Similarly, for discrete functions, the crosscorrelation is defined as:
The crosscorrelation is similar in nature to the convolution of two functions.
In an autocorrelation, which is the crosscorrelation of a signal with itself, there will always be a peak at a lag of zero unless the signal is a trivial zero signal.
In probability theory and statistics, correlation is always used to include a standardising factor in such a way that correlations have values between −1 and +1, and the term crosscorrelation is used for referring to the correlation corr(X, Y) between two random variables X and Y, while the "correlation" of a random vector X is considered to be the correlation matrix (matrix of correlations) between the scalar elements of X.
If and are two independent random variables with probability density functions f and g, respectively, then the probability density of the difference is formally given by the crosscorrelation (in the signalprocessing sense) ; however this terminology is not used in probability and statistics. In contrast, the convolution (equivalent to the crosscorrelation of f(t) and g(−t) ) gives the probability density function of the sum .
Contents
Explanation
As an example, consider two real valued functions and differing only by an unknown shift along the xaxis. One can use the crosscorrelation to find how much must be shifted along the xaxis to make it identical to . The formula essentially slides the function along the xaxis, calculating the integral of their product at each position. When the functions match, the value of is maximized. This is because when peaks (positive areas) are aligned, they make a large contribution to the integral. Similarly, when troughs (negative areas) align, they also make a positive contribution to the integral because the product of two negative numbers is positive.
With complexvalued functions and , taking the conjugate of ensures that aligned peaks (or aligned troughs) with imaginary components will contribute positively to the integral.
In econometrics, lagged crosscorrelation is sometimes referred to as crossautocorrelation.^{1}
Properties
 The crosscorrelation of functions f(t) and g(t) is equivalent to the convolution of f*(−t) and g(t). I.e.:
 If f is Hermitian, then
 Analogous to the convolution theorem, the crosscorrelation satisfies:
where denotes the Fourier transform, and an asterisk again indicates the complex conjugate. Coupled with fast Fourier transform algorithms, this property is often exploited for the efficient numerical computation of crosscorrelations. (see circular crosscorrelation)
 The crosscorrelation is related to the spectral density. (see Wiener–Khinchin theorem)
 The cross correlation of a convolution of f and h with a function g is the convolution of the crosscorrelation of f and g with the kernel h:
Time series analysis
In time series analysis, as applied in statistics and signal processing, the cross correlation between two time series describes the normalized cross covariance function.
Let represent a pair of stochastic processes that are jointly wide sense stationary. Then the cross correlation is given by
where and are the means of and respectively.
The cross correlation of a pair of jointly wide sense stationary stochastic process can be estimated by averaging the product of samples measured from one process and samples measured from the other (and its time shifts). The samples included in the average can be an arbitrary subset of all the samples in the signal (e.g., samples within a finite time window or a subsampling of one of the signals). For a large number of samples, the average converges to the true crosscorrelation.
Time delay analysis
Crosscorrelations are useful for determining the time delay between two signals, e.g. for determining time delays for the propagation of acoustic signals across a microphone array.^{2}^{3} After calculating the crosscorrelation between the two signals, the maximum (or minimum if the signals are negatively correlated) of the crosscorrelation function indicates the point in time where the signals are best aligned, i.e. the time delay between the two signals is determined by the argument of the maximum, or arg max of the crosscorrelation, as in
Normalized crosscorrelation
For imageprocessing applications in which the brightness of the image and template can vary due to lighting and exposure conditions, the images can be first normalized. This is typically done at every step by subtracting the mean and dividing by the standard deviation. That is, the crosscorrelation of a template, with a subimage is
 .
where is the number of pixels in and , is the average of f and is standard deviation of f. In functional analysis terms, this can be thought of as the dot product of two normalized vectors. That is, if
and
then the above sum is equal to
where is the inner product and is the L² norm. Thus, if f and t are real matrices, their normalized crosscorrelation equals the cosine of the angle between the unit vectors F and T, being thus 1 if and only if F equals T multiplied by a positive scalar.
Normalized correlation is one of the methods used for template matching, a process used for finding incidences of a pattern or object within an image. It is also the 2dimensional version of Pearson productmoment correlation coefficient.
Nonlinear systems
Caution must be applied when using cross correlation for nonlinear systems. In certain circumstances, which depend on the properties of the input, cross correlation between the input and output of a system with nonlinear dynamics can be completely blind to certain nonlinear effects.^{4} This problem arises because some moments can go to zero and this can incorrectly suggest that there is little correlation between two signals when in fact the two signals are strongly related by nonlinear dynamics.
See also
 Autocorrelation
 Autocovariance
 Coherence (signal processing)
 Convolution
 Correlation
 Crosscovariance
 Crossspectrum
 Digital image correlation
 Phase correlation
 Scaled correlation
 Spectral density
 Wiener–Khinchin theorem
References
 ^ Campbell; Lo; MacKinlay (1996). The Econometrics of Financial Markets. NJ: Princeton University Press. ISBN 0691043019.
 ^ Rhudy, Matthew; Brian Bucci, Jeffrey Vipperman, Jeffrey Allanach, and Bruce Abraham (November 2009). "Microphone Array Analysis Methods Using CrossCorrelations". Proceedings of 2009 ASME International Mechanical Engineering Congress, Lake Buena Vista, FL.
 ^ Rhudy, Matthew (November 2009). "Real Time Implementation of a Military Impulse Classifier". University of Pittsburgh, Master's Thesis.
 ^ Billings S.A. "Nonlinear System Identification: NARMAX Methods in the Time, Frequency, and SpatioTemporal Domains". Wiley, 2013
Further reading
 Tahmasebi, Pejman; Hezarkhani, Ardeshir; Sahimi, Muhammad (2012). "Multiplepoint geostatistical modeling based on the crosscorrelation functions". Computational Geosciences 16 (3): 779–797. doi:10.1007/s1059601292871.
External links
 Cross Correlation from Mathworld
 http://scribblethink.org/Work/nvisionInterface/nip.html
 http://www.phys.ufl.edu/LIGO/stochastic/sign05.pdf
 http://www.staff.ncl.ac.uk/oliver.hinton/eee305/Chapter6.pdf

HPTS  Area Progetti  EduSoft  JavaEdu  N.Saperi  Ass.Scuola..  TS BCTV  TS VideoRes  TSODP  TRTWE  