Session 2 : Correlation
Correlation
Ir. Dadang Gunawan, Ph.DElectrical Engineering
University of Indonesia
Session 2 : Correlation
The Outline2.1 State-of- the-art2.2 Philosophy of Correlation2.3 Auto and Cross Correlation2.4 Example of Correlation (j=0)2.5 Correlation with phase differences2.6 Example of Correlation (lag j=3)2.7 Auto correlation2.8 Cyclic-cross Correlation
(Cont’d… )
Session 2 : Correlation
The Outline
2.9 Example of Cyclic-cross Correlation2.10 Example of Graphic Correlation2.11 Cross-correlation of two noisy waveform2.12 Applications of Correlation2.13 Review
Session 2 : Correlation
State of the art
• Correlation is one of the key of DSP• Require simple arithmetic operations• The purpose :To determine how is the correlation between two
signals in a systems.Correlation is used together with convolutionIf two signals are the same, the value of its
correlation is 1 ( one ), look at the equation on next page
2.1
Session 2 : Correlation
Philosophy of Correlation
• Correlation is an integral part of convolution• Correlations of two waveforms is the sum of the
products of the corresponding pairs of points• Note that x1(n) and x2(n) are the corresponding
pairs of 2 waveforms
∑−
=
=1
02112 )()(1 N
nnxnx
Nr
2.2
Session 2 : Correlation
Auto and Cross-correlation
2.3
Auto Correlation
Cross Correlation
Correlation with himself
Correlation with other waveform
Session 2 : Correlation
Example of Correlation (j=0)
n 1 2 3 4 5 6 7 8 9
x1 4 2 -1 3 -2 -6 -5 4 5x2 -4 1 3 7 4 -2 -8 -2 1
( ) ( ) ( ) ( )[ ]( ) 50
15...1244910
12
12
=
×++×+−×=
r
r
2.4
Session 2 : Correlation
Correlation with phase differences (shift or lag one of the waveforms)
• Look at the figure 2.1 below• This is equivalent to changing x1(n) to x2(n+j), where
j represents the amount of lag, shifted to the left
2.5
Figure 2.1
Session 2 : Correlation
Alternative shifted to right
• It is equivalent,but different in direction• The formula a lag of j , are :
∑
∑−
=
−
=
−=−
+=
1
01221
1
02112
)()(1)(
)()(1)(
N
n
N
n
jnxnxN
jr
jnxnxN
jr
2.5
Session 2 : Correlation
Example of Correlation ( lag of j=3)
n 1 2 3 4 5 6 7 8 9
x1 4 2 -1 3 -2 -6 -5 4 5x2 7 4 -2 -8 -2 1
( ) ( ) ( ) ( )[ ]( ) 667.23
16...4274913
12
12
=
×−++×+×=
r
r
2.6
Session 2 : Correlation
Auto correlation
• Occur when x1(n)=x2(n), and the waveform is then cross-correlated with itself
• The formula is :
• It has a property :
( ) ∑−
=
+=1
01111 )()(1 N
njnxnx
Njr
( ) ∑−
=
==1
0
2111 )(10
N
nSnx
Nr
Remember that ( ) ( )jrr 1111 0 ≥
2.7
Session 2 : Correlation
Autocorrelation (cont’d)• That is a very useful property that S is the
normalized energy of the waveform• This provides a method for calculating the energy
of the signal, look at the figure 2.2 below :
2.7
j
r11
Figure 2.2
Session 2 : Correlation
Cyclic-cross correlation
• rab (j) is cyclic, repeating every n lag• For example, if the sequence of a is 4 and b is 3,
then n = 4 + 3 – 1 = 6• So that, n = N1 + N2 - 1• That is rab (j) has the same period as that of the
shorter sequence b• Look at the example on the next slide
2.8
Session 2 : Correlation
Example of cyclic cross-correlation
Sequence Lag rab(j)4 3 1 6 0 05 2 3 0 0 0 0 292 3 0 0 0 5 1 173 0 0 0 5 2 2 120 0 0 5 2 3 3 300 0 5 2 3 0 4 170 5 2 3 0 0 5 355 2 3 0 0 0 6 29
etc etc etc
rab(j)repeat
a
b
2.9
Session 2 : Correlation
Example of Graphic correlation
• Look at the figure 2.3 below, the waveform v1(t)and v2(t)
2.10
v1(t) v2(t)Figure 2.3
Session 2 : Correlation
Graphic correlation (cont’d)
• Here is the cross-correlation r12(-τ) between two waveforms (previous figure) on period 0-T
2.10
Figure 2.4
Session 2 : Correlation
Cross Correlation of two noisy waveforms
• Consider two waveforms be {s1(t) + q1(t)} and {s2(t) + q2(t) }
• Then the correlation become :
• Look at each component, it is very useful to determine the noisy signal
( ) ( ) ( ) ( ) ( )jrjrjrjrjr qqsqqsss 2121212112 +++=
2.11
Session 2 : Correlation
The autocorrelation function of noisy signal (related to previous slide)
2.11
2sq+q2
Figure 2.5
rvv(j)
Session 2 : Correlation
Applications of Correlation
1. Calculations of energy spectral density and energy content of waveforms
The total energy of two waveform v1(n) and v2(n)are:
Remember that ( ) Er =011
( ) ( ) ( )0200 2121 vvvvv rrrE ++=
2.12
Session 2 : Correlation
Applications of Correlation (cont’d)
2. Detection and estimation of periodic signals in noise.It will be done by making an adjustable template signal
2.12
Explain how can be done ?
Session 2 : Correlation
Applications of Correlation (cont’d)
3. Correlation detection implementation of matched filter
4. The determination of the impulse response of electrical systems
5. Determination of the SNR for a periodic noisy signal
2.12
Explain how can be done ?
Session 2 : Correlation
Special Review
• An application of correlation is to control attitude of a spacecraft, to ensure that the solar panel always faces the sun.
2.13
EXPLAIN CLEARLYand describe its graphic !
Session 2 : Correlation
Review
1. Do the special review on previous slides.2. Explain about end-effect clearly.3. Explain about correlation detection implemen-
tation of matched filter. Look at other reference: internet, journal, etc.
4. The exercise from text book [Ifeachor] is postponed. You will do after Session 3, Convolution.
2.13
Top Related