Digital Signal Processing Reference
In-Depth Information
Correlation can be performed with convolution, by reversing one signal. Instead
of considering signal y[k] being indexed from 0 to some positive limit K, we will
ip it around the zeroth sample, and consider that it starts atK. For example,
if y[n] =f5, 3, 1, 6g, we interpret this as y[0] = 5;y[1] = 3;y[2] = 1, and y[3] = 6.
If we ip this signal around, we would have y[3] = 6, y[2] = 1, y[1] = 3, and
y[0] = 5. When we convolve y with x, we would sum x[n]y[nk]. Using the
ipped version of y, the only thing to change is the index, e.g., x[n]y[n(k)]
or simply x[n]y[n + k].
The output signal from correlation is known as cross-correlation, except in the
case where the same signal is used for both inputs, which is called autocorrelation
[12]. However, the number of data samples inuences the cross-correlation, so the
cross-correlation should be divided by N, the number of data samples [14].
N1
X
s
x;y
[k]
1
N
x[n]y[n + k]
n=0
The above equation gives an approximation for s
x;y
[k], since it does not take
the signal's average into account, and assumes that it is 0 for both x and y. If the
signal averages are nonzero, we need to use the following equation (cross-covariance)
instead:
P
P
N1
X
N1
N1
x[n]y[n + k]
(
n=0
x[n])(
n=0
y[n])
s
x;y
[k] =
:
N
n=0
Obtaining a good estimate for the cross-correlation means that we must nd the
autocovariance as well:
P
N1
X
N1
n=0
x[n])
2
N
x[n]
2
(
s
x;x
=
:
n=0
To nd s
y;y
, use the above equation for s
x;x
, and replace x with y.
The cross-correlation is estimated to be:
s
x;y
[k]
p
x;y
[k] =
s
x;x
s
y;y
:
For the autocorrelation, replace y with x. s
x;x
[k] can be found by substituting x for
both parameters in the equation for s
x;y
[k].