Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

Digital Signal Processing

Lecture 6
Cross-correlation and Auto-
correlation Functions

1
Correlations of signals
• A measure of similarity between a pair of signals.
• There are applications where it is necessary to compare
one reference signal with one or more signals to
determine the similarity between the pair and to determine
additional information based on the similarity.
• In digital communications, a set of data symbols are
represented by a set of unique discrete-time sequences. If
one of these sequences has been transmitted, the receiver
has to determine which particular sequence has been
received, by comparing the received signal with every
member of possible sequences from the set.
• Radar, sonar, digital communication, other areas of
science and engineering. 2
Cross-correlation and Auto-correlation Sequences

• Suppose that we have two signal sequences x[n] and


y[n] each of which has finite energy. The cross-
correlation of x[n] and y[n] is a sequence defined as:
 k = 0, 1, 2, 3, …… (1)
rxy  k    x[n]y[n  k ]
n  

or, equivalently, as

k = 0, 1, 2, 3, … (2)
rxy [ k ]   x[n  k ] y[n]
n  

3
Crosscorrelation and Autocorrelation Sequences (cont.)
• If we reverse the roles of x[n] and y[n] in (1) and (2)
and hence reverse the order of indices xy, we obtain
the crosscorrelation sequence
 k = 0, 1, 2, 3, …… (3)
ryx  k    y[n]x[n  k ]
n  

or, equivalently, as

] = 0, 1, 2, 3, …
ryx [ k ]   y[ n , k ] x[ nk (4)
n  

By comparing (1) and (4) or (2) and (3), we conclude that


rxy[k] = ryx[-k] (5)
Therefore, ryx[k] is simply the folded version of rxy[k],
where folding is done with respect to k = 0. 4
• Example 5: Determine the crosscorrelation
sequence of the sequences

x[n] = {…,0, 0, 2, -1, 3, 7, 1, 2, -3, 0, 0,…}

y[n] = {…,0, 0, 1, -1, 2, -2, 4, 1, -2, 5, 0, 0,…}

Solution: See next slide

5
1 -1 2 -2 4 1 -2 5
1 -1 2 -2 4 1 -2 5
1 -1 2 -2 4 1 -2 5
1 -1 2 -2 4 1 -2 5
1 -1 2 -2 4 1 -2 5
1 -1 2 -2 4 1 -2 5
1 -1 2 -2 4 1 -2 5
1 -1 2 -2 4 1 -2 5
2 -1 3 7 1 2 -3
1 -1 2 -2 4 1 -2 5
1 -1 2 -2 4 1 -2 5
1 -1 2 -2 4 1 -2 5
1 -1 2 -2 4 1 -2 5
Rxy[k] ={ 10, -9, 19, 36, 1-14,
-1 33,
2 -20, 4 1 -2 5
7, 13, -18, 16, -7, 5, -3}
6
Example : Find the correlation b/w the two sequences x[n]
and y[n] given by, x[k] = [3 1 2] y[k] = [3 2 1].

Solution:

= {3, 7, 13, 7, 6}


ryx  k    y[n]x[n  k ] = { 6, 7, 13, 7, 3}
n  

Comparing the two establishes that:

rxy[k] = ryx[-k]
7
Autocorrelation Function
• The Autocorrelation Function of x[n] is defined as

rxx  k    x[n]x[n  k ]
n  

or, equivalently, as

rxx[k ]   x[n  k ]x[n]
n  

When k=0,  2

rxx [0]   | x[n] |


n  
 Ex

Notice that rxx(k) = rxx(-k)


That is, the autocorrelation function is an even
function.
8
Properties of Autocorrelation and
Crosscorrelation Sequences
Let us assume that we have two sequences x[n] and
y[n] with finite energy from which we form the linear
Combination ax[n] + by[n-k]
where a and b are arbitrary constants and k is some
time shift. The energy in this signal is
 2   
  ax[n]  by[n  1]  a  x  n   b  y [n  k ]  2ab  x[n]y[n  k ]
2 2 2 2
n   n   n   n  

 a 2 rxx  0   b 2 ryy  0   2abrxy  k 


Note that rxx(0) = Ex and ryy(0) = Ey, the energies of x[n] and y[n]
respectively.
9
It is obvious that

a rxx  0  b ryy  0  2abrxy  k   0


2 2

Now, assuming that b  0, we divide the above


equation by b2 to obtain
2
a a
rxx (0)   2rxy [k ]   ryy  0  0
b b
This is a quadratic equation. Since the quadratic
is non-negative, its discriminant must be non-
positive. That is,

2
4 rxy [k ]  rxx ( 0)ryy ( 0)  0 
Therefore, the crosscorrelation sequence satisfies
the condition that
rxy  k   rxx  0  ryy  0   ExEy (6)
10
In the special case where y[n] = x[n], (6) reduces
to
rxx  k   rxx  0  E x (7)

This means that the autocorrelation sequence of a signal


attains its maximum value at zero lag.
• If any one or both of the signals involved are scaled, the
shape of the cross correlation sequence does not change;
only the amplitudes of the crosscorrelation sequence are
scaled accordingly.
• It is often desirable in practice to normalize the
autocorrelation and crosscorrelation sequences to the
range from -1 to 1. 11
• The normalized autocorrelation sequence is defined
as,
r k 
 xx  k   xx
rxx  0 

Similarly, we define the normalized crosscorrelation


Sequence
rxy  k 
 xy  k  
rxx  0  ryy  0 

Recovering a repeating pattern, or any periodic signal


from its highly-noisy version

12
Tutorial 3
Q1: Compute the correlation sequences for the following pair
of signals:
(a) x[n] = [0, 1, -2, 3, -4], y[n] = [1/2, 1, 2, 1, 1/2]

(b) x[n] =[1, 2, 3, 4], y[n] = [1, 2, 3, 4]

13
Classification of LTI Discrete Time systems
• LTI discrete time systems are usually classified either
according to the length of their impulse response sequences
or according to the method of calculation employed to
determine the output samples.
• Classification based on impulse response length:
(a) Finite Impulse Response:
If h[n] is of finite length, then it is known as a finite impulse response
(FIR) discrete-time system. In this case the convolution sum reduces to
N2 N2
y[ n]  or
 h[k ]x[n  k ] y[ n]   x[k ]h[ n  k ]
k  N1 k  N1

Note that the above convolution sum, being a finite


sum, can be used to calculate y[n] directly.
14
Infinite Impulse response
• If h[n] is of infinite length, then it is known as an infinite
impulse response (IIR) discrete time system.

y[ n]   x[k ]h[n  k ] (8)
k  

• Classification based on the output calculation


process
- Non-Recursive System:
If the output sample can be calculated sequentially, knowing
only the present and past input samples, the system is said
to be a “non-recursive” discrete time system.
The system given below is non-recursive , because it
depends only on present and past values of the input.
n
(does not include past o/p values). y[ n]   x[k ]
k  
15
- Recursive Discrete-Time System

If the computation of the output of a discrete


time system involves past output samples in
addition to the present and past input samples,
it is known as a “recursive discrete time
system”.
Example: y[n] = x[n] – x[n-6] + y[n-1]

16

You might also like