Biomedical Engineering Reference
In-Depth Information
does not matter which function is shifted with respect to
the other, although shifting the reference waveform is
more common. The correlation operations of Eq. 2.4.28
then become a series of correlations over different time
shifts or lags. For continuous signals, the time shifting can
be continuous and the correlation becomes a continuous
function of the time shift. This leads to an equation for
cross-correlation that is an extension of Eq. 2.4.28 that
adds a time shift variable, s:
can be described as having 'memory', because it must
remember past values of the signal (or input) and use this
information to shape the signal's current values. The
longer the memory, the more the signal will remain
partially correlated with shifted versions of itself. Just as
memory tends to fade over time, the autocorrelation
function usually goes to zero for large enough time shifts.
To perform an autocorrelation, simply substitute the
same variable for x and y in Eq. 2.4.31 or Eq. 2.4.32 :
ð T
ð T
Autocorrelation ¼ r xxð s Þ ¼ 1
Cross - correlation ¼ r xyð s Þ ¼ 1
xðtÞxðt þ s Þdt
yðtÞxðt þ s Þdt
T
0
T
0
[Eq. 2.4.33]
[Eq. 2.4.31]
N X
N
r xx ðmÞ¼ 1
xðkÞxðk þ mÞ
[Eq. 2.4.34]
The variable s is a continuous variable of time used to
shift x ( t ) with respect to y ( t ). The variable s is a time
variable, but not the time variable (which is t ). To em-
phasize this s is sometimes curiously referred to as
a dummy time variable. The correlation is now a function
of the time shift, s, also known as lag. Cross-correlation is
often abbreviated as r xy , where x and y are the two
functions being correlated. Again, this equation can be
converted to a discrete form by substituting summation
for integration and the integers i and k for the continuous
variables t and s :
k ¼ 1
Figure 2.4-10 shows the autocorrelation of several dif-
ferent waveforms. In all cases, the correlation has a max-
imum value of 1 at zero lag (i.e., no time shift) because
when the lag (s or n ) is zero, this signal is being correlated
with itself. The autocorrelation of a sine wave is another
sinusoid ( Figure 2.4-10A ) because the correlation varies
sinusoidally with the lag, or phase shift.
In Figure 2.4-10A , the sinusoidal pattern produced by
autocorrelation falls off with increasing lags because this
sinusoid had finite length. If the sinusoid were infinite in
length, the autocorrelation function would be a constant
amplitude cosine. A rapidly varying signal ( Figure 2.4-
10C ) decorrelates quickly; that is, the self-correlation falls
off rapidly for even small shifts of the signal with respect
to itself. One could say that this signal has a very poor
memory of its past values and was probably the product of
a process with a short memory. For slowly varying signals,
the correlation falls slowly ( Figure 2.4-10B ). Nonetheless,
for all of these signals, there is some time shift for which
the signal becomes completely decorrelated with itself.
For a random signal, the correlation falls to zero instantly
for all positive and negative lags ( Figure 2.4-10D ). This
indicates that each instant of the random signal (each
instantaneous time point) is completely uncorrelated
with the next instant. A random signal has no memory of
its past and could not be the product of, or altered by,
a process with memory.
Because shifting the waveform with respect to itself
produces the same results regardless of which way the
function is shifted, the autocorrelation function will be
symmetrical about lag zero. Mathematically, the auto-
correlation function is an even function:
N X
N
r xy ðmÞ¼ 1
yðkÞxðk þ mÞ
[Eq. 2.4.32]
1
Figure 2.4-9A (lower plot) shows the cross-correlation
function for a sinusoid and a triangle waveform. The
cross-correlation shows that they are most similar (i.e.,
have the highest correlation) when one signal is shifted
0.18 seconds with respect to the other. This is demon-
strated by shifting one of the functions by that amount in
Figure 2.4-9B to provide a visual demonstration of this
similarity. This also suggests a useful application of
cross-correlation-alignment of similar waveforms that
are shifted with respect to each other.
It is also possible to shift one function with respect
to itself, a process called autocorrelation. The autocor-
relation function describes how the value of the variable
at one time depends on the values at other times. This
will show how well a signal correlates with various shifted
versions of itself. Another way of looking at autocorre-
lation is that it shows how the signal correlates with
neighboring portions of itself. As the shift variable s in-
creases, the signal is compared with more distant
neighbors. A signal's autocorrelation function provides
some insight into how the signal was generated or altered
by intervening processes. For example, a signal that re-
mains highly correlated with itself over a long time shift
must have been produced, or modified, by a process that
took into account past values of the signal. Such a process
r xx ð s Þ¼r xx ð s Þ
[Eq. 2.4.35]
In addition, the value of the function at lag zero, where the
waveform is correlatedwith itself, will be as large, or larger
than, any other value. If the autocorrelation is normalized
by the variance, the value will be 1. (Because only one
Search WWH ::




Custom Search