Convolution is very useful and powerful concept. It appears quite frequently in DSP discussion. It is begun with a rather twisted definition (folding before shifting), but it then becomes the representation of linear systems, and is linked to the Fourier transform and the z-transform.
As for convolution, correlation is defined for both analog and digital signals.
Correlation of two signals measure the degree of their similarity. But correlation of a signal with itself also has meaning and application. The strength of convolution lies in the fact that if applies to signals as well as systems, whereas correlation only applies to signals. Correlation is used in many areas such as radar, geophysics, data communications, and, especially, random processes.
Cross-correlation and auto-correlation
Cross-correlation, or correlation for short, between two discrete-time signals x(n) and v(n), assumed real-valued, is defined as
or equivalently
Notice that correlation at index n is the summation of the product of one signal and other signal shifted.
When the signals x(n) and v(n) are interchanged, we get
or equivalently
Thus
This result shows that one correlation is the flipped version (mirror-imaged) of the other, but otherwise contains the same information.
The evalution of correlation is similar to that of convolution expect no signal flipping is need, hence the computing steps are
slide (shift) – multiply – add. The
method of sequence (vector), as for the convolution (
section ), is one of the possible ways.
Find the cross-correlation of the following signals
The figures in bold face are samples at origin.
Solution
First we choose the shorter sequence, in this case v(n), to be shifted, and the longer sequence, x(n), to stay stationary. Next the evaluate the correlation at m = 0 (no shifting yet), then the correlation at m = 1, 2, 3 … (shifting v(n) to the right) until v(n) has gone past x(n) completely. Next, we evaluate the correlation at = -1, -2, -3 … (shifting v(n) to the left) until v(n) has gone past x(n) completely. At each value of m, we do the multiplication and summing. The evaluation is arranged as follows. Remember to align the values of x(n) and v(n) at origin at be beginning.
Final result :
Given two signals
Compute the cross-corelation.
Solution
The cross-correlation is
The summation is divided into two ranges of of m depending on the shifting direction of v(n) with respect to x(n).
- For m<0, v(n) is shifted to the left of x(n), the summation lower limit is n = 0 :