Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

EEE 3105: Signals and Linear Systems: Cross Correlation Function

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

11/18/2021

EEE 3105: Signals and Linear Systems

2.7.2 Cross Correlation Function


Cross-correlation is the measure of similarity between two different
signals. Cross-correlation is two types: (i) linear cross-correlation
and (ii) circular cross-correlation.

(i) Linear Cross-Correlation


Consider two signals x(t) and y(t). The linear cross-correlation of
these two signals given is given by

Rxy ( )    x(t ) y (t  )dt [ ve shift] (2.7.9)

   x(t   ) y (t )dt [ ve shift] (2.7.10)
If signals are complex then

Rxy ( )    x(t ) y  (t  )dt [ ve shift] (2.7.11)

   x(t   ) y  (t )dt [ ve shift] (2.7.12)

R yx ( )    y (t ) x  (t  ) dt [ ve shift] (2.7.13)

   y (t   ) x  (t )dt [ ve shift] (2.7.14) 2

1
11/18/2021

Similarly, the linear cross-correlation of the discrete time signals x[n]


and y[n] is expressed as

Rxy [k ]   x[n]y[n  k ] [ ve shift] (2.7.15)
k  

R yx [k ]   x[n  k ] y[n] [ ve shift] (2.7.16)
k  

If the signal is complex then linear cross-correlation function is


given by

Rxy [k ]   x[n]y  [n  k ] [ ve shift] (2.7.17)
k  

R yx [k ]   x  [n  k ] y[n] [ ve shift] (2.7.18)
k  

Expressions of Autocorrelation for Energy and Power signals

2
11/18/2021

Example: Linear cross-correlation of the signal x[n] = {-3, 2, -1, 1}


and y[n] = {-1, 0, -3, 2} can be computed as shown by Figure.

Rxy = {-6, 13, -8, 8, -5, 1, -1} 6

3
11/18/2021

Here, the first set of samples (in the first row of every table) refers to the
signal x[n] and the second set refers to the samples (in the second row of
every table) of the signal y[n].
Next, the samples shown in blue color—those in the third row—are
obtained by multiplying the corresponding samples of the first two rows.
Finally, we add the samples in the last row (contained within the curly
brackets) so as to obtain the samples of the cross-correlated signal.
Thus, here we see that the samples of the cross-correlated signal Rxy
are obtained as {-6, 13, -8, 8, -5, 1, -1}, where 8 is the zeroth sample.
Further, the example presented shows that the sample of the cross-
correlated signal is at its highest peak, with value 13, when the last two
samples of y[n] overlap with the first two samples of x[n]. This is because,
in this case, the second signal overlaps with the first at its best, as the two
samples in each of the signals are identical.
Hence, it can be concluded that the cross-correlation reaches its
maximum when the two signals considered become most similar to each
other.
7

Tabular Method of Cross Correlation: Cross-correlate the signals


x[n] = {-3, 2, -1, 1} and y[n] = {-1, 0, -3, 2} using Tabular method.

The tabular convolution method involve with time reversal, whereas no time reversal is needed
in correlation. But if we time reverse the 2nd sequence, then it form the method of convolution.

x[n] = { -3, 2, -1, 1} and y[-n] = {2, -3, 0, -1}


• Total number of terms in cross correlation are {(4) + (4) -1} = 7.
• Range = -3 to 3
Interchanging Column and Row:

Rxy =x[n]*y[-n]= {-6, 13, -8, 8, -5, 1, -1} Rxy =y[-n]*x[n]= {-6, 13, -8, 8, -5, 1, -1}
8

4
11/18/2021

Tabular Method of Cross Correlation: Cross-correlate the signals


x[n] = {-3, 2, -1, 1} and y[n] = {-1, 0, -3, 2} using Tabular method.

Here, y[-n] = {2, -3, 0, -1}


Location 0 1 2 3 • Total number of terms in cross
Value
correlation are {(4) + (4) -1} = 7.
-3 2 -1 1
• Sum of indexes at zero marked = 2 + 2 = 4
Location 3 2 1 0
Value -1 0 -3 2 • Range = -4 to 3

Interchanging Column and Row:

Rxy = x[n]*y[-n]= {-6, 13, -8, 8, -5, 1, -1} Rxy = y[-n]*x[n]= {-6, 13, -8, 8, -5, 1, -1}
9

Example: Find the cross-correlation function between the two signals


x(t) = ej2fot and y(t) = ej4fot.

10

5
11/18/2021

11

Alternative Solution:

12

6
11/18/2021

(ii) Circular Cross-Correlation


Circular cross-correlation with period N is defined as follows:
N 1
R xy [k ]   x[n]y[( n  k ) N ] [ ve shift] (2.7.19)
k 0
The notation: (n)N has another way of writing “n mod N.” For example, if
N = 3,
(0)N = 0 mod 3 = 0 (1)N = 1 mod 3 = 1 (2)N = 2 mod 3 = 2
(3)N = 3 mod 3 = 0 (4)N = 4 mod 3 = 1 (5)N = 5 mod 3 = 2
This notation allows the circular way counting from 0 to N-1 and then
repeat, starting at 0.
We can consider the circular cross-correlation as a subset of a linear
correlation where the signals are periodic with period N (i.e. repeating
every N samples) and we sum only over one period. We call this the linear
correlation for periodic signals or periodic correlation which is defined as
N 1
R( xy ) N [k ]   x[n]y[( n  k )] [ ve shift] (2.7.20)
k 0
We distinguish this from the linear correlation with the N subscript. 13

Circular cross-correlation method represents the two given sequence x[n]


and y[n] in matrix form.

• The y[n] sequence is repeated (raw-wise/clockwise) via circular shift of


one sample at a time to form a N  N matrix.

• The another sequence x[n] is represented as column matrix.

• The multiplication of two matrices gives the result of circular cross-


correlation.

Example-A: Circular cross-correlation of the signal x[n] = {-3, 2, -1, 1}


and y[n] = {-1, 0, -3, 2} can be computed as shown by matrices:
 - 1 0 - 3 2  - 3  (-3)  (-1)  (2)  (0)  (-1)  (-3)  (1)  (2)  3  0  3  2  8 
 2 - 1 0 - 3   2 (-3)  (2)  (2)  (-1)  (-1)  (0)  (1)  (-3)  6  2  0  3  11
     
 3 2 - 1 0  - 1  (-3)  (3)  (2)  (2)  (-1)  (-1)  (1)  (0)  9  4  1  0  4 
     
 0 - 3 2 - 1   1  (-3)  (0)  (2)  (-3)  (-1)  (2)  (1)  (-1)  0  6  2  1  8 

14

7
11/18/2021

Example-B: Circular cross-correlation of the signal x[n] = {1, 1, 2, 1}


and y[n] = {2, 3, 1, 1} can be computed as shown by matrices:

2 3 1 1  1  (1)  (2)  (1)  (3)  (2)  (1)  (1)  (1)  2  3  2  1  8 


1 2 3 1  1  (1)  (1)  (1)  (2)  (2)  (3)  (1)  (1)  1  2  6  1  10 
     
1 1 2 3  2  (1)  (1)  (1)  (1)  (2)  (2)  (1)  (3)  1  1  4  3  9 
     
3 1 1 2   1 (1)  (3)  (1)  (1)  (2)  (1)  (1)  (2)  3  1  2  2  8 

15

You might also like