Вы находитесь на странице: 1из 3

Biometrics and Speech Processing

DSP Tools and Techniques

MELE0021

DISCRETE CORRELATION
An operation which is similar in form to the convolution summation is the discrete
correlation.
For causal, finite duration signals (energy signals) of length N, the correlation functions
are
Cross-correlation
r xy ( m ) =

N 1

x ( n ) y ( n + m ),

for

m = 0 , 1 , 2 ,...., ( N 1 )

n=0

Autocorrelation
r xx ( m ) =

N 1

x ( n ) x ( n + m ),

for

m = 0 , 1 , 2 ,...., ( N 1 )

n=0

The autocorrelation is an even function, i.e. rxx(m) = rxx(-m). Therefore it suffices to


compute rxx(m) for m > 0.
To determine cross-correlation of two causal finite duration discrete signals x(n) and
y(n),
1) Display x(n) Vs n
2) Display y(n) Vs n
3) Multiply the corresponding terms of x(n) and y(n)and sum the individual term
products x(n) y(n) to generate the value for rxy(0).
4) For m < 0, y(n) is shifted to right relative to x(n) by m units and the process in (3)
is repeated to generate the value of rxy(m) for m < 0.
5) For m > 0, y(n) is shifted to left relative to x(n) by m units and the process in (3) is
repeated to generate the value of rxy(m) for m > 0.

x(n) = {x0, x1, x2, x3}, y(n) = {y0, y1, y2, y3}
n
x(n)
m = 0,y(n + 0)

-4

-3

-2

-1

rxy(0) =

0
1
2
3
x1
x2
x3
x0
y0
y1
y2
y3
----------------------------------x0y0 + x1 y1 + x2y2 + x3y3

y1
y2
y3
y0
--------------------------------------------0 + x0 y1 + x1y2 + x2y3 + 0

m = 1, y(n + 1)
rxy(1) =
m = -1, y(n - 1)

y0
y1
y2
y3
----------------------------------------0 + x1 y0 + x2y1 + x3y2 + 0

rxy(-1) =

Circular Correlation
The circular correlation of two signals x(n) and y(n) of the same length N is defined as
r xy ( m ) =

N 1

x ( n ) y ( n + m ),

for

m = 0 ,1 , 2 ,...., ( N 1 )

n=0

where y ( N + n) = y (n)
To perform this correlation the samples of the two signals are displayed clockwise on two
circles. The correlation is obtained by summing the products of the corresponding values
of the two signals on the two circles. The successive values in the correlation are
generated by rotating the circle of y(n) counter-clockwise (or the circle of x(n) clockwise)
1 unit at a time and repeating the process.
To perform linear correlation using this technique, M-1 zeroes must be added to the end
of the sequence with length N, and N-1 zeroes must be added to the end of the sequence
with length M.

x n = {x0, x1, x2, x3}, yn = {y0, y1, y2, y3}

y2

y3

y0

x3

x3

x2

x0

y0

and

x2

x0

x1

x1

y1

y2

r0=x0y0 + x1 y1 + x2y2 + x3y3

Theorem:

y3

y1

r1=x0y1 + x1 y2 + x2y3 + x3y0

N 1

DFT x(n) y (n + m) = X ( N k )Y (k )
n = 0

N 1

DFT x(n) x(n + m) = X ( N k ) X (k )


n = 0

since, xn is real X ( N k ) = X (k )

N 1
2
Therefore, DFT x(n) x(n + m) = X (k ) X (k ) = X (k )
n = 0

For complex signals, circular correlation is defined as


Cross-correlation
r xy ( m ) =

N 1

x ( n ) y ( n + m ),

m = 0 ,1 , 2 ,...., ( N 1 )

n=0

r xx ( m ) =

Autocorrelation

N 1

x ( n ) x ( n + m ),

for

m = 0 ,1 , 2 ,...., ( N 1 )

n=0

N 1
x ( n ) y ( n + m ) = X ( k )Y ( k )

n = 0
N 1

2
DFT [r xx ( m ) ] = DFT x ( n ) x ( n + m ) = X ( k ) X ( k ) = X ( k )

n = 0

In this case. DFT r xy ( m ) = DFT


and

for

Вам также может понравиться