Académique Documents
Professionnel Documents
Culture Documents
&
Parameter Estimation
Wb2301: SIPE lecture 2
Correlation functions in time & frequency domain
Alfred C. Schouten, Dept. of Biomechanical Engineering (BMechE), Fac. 3mE
2/11/2010
Delft
University of
Technology
Contents
Correlation functions in time domain
Autocorrelations (Lecture 1)
Cross-correlations
2 | xx
xx ( ) = E [ x (t )x(t )]
Autocovariance function
Cxx ( ) = E ( x (t ) x )( x (t ) x ) = xx ( ) x2
Autocorrelation coefficient
x (t ) x x (t ) x xx ( ) x2 Cxx ( )
=
rxx ( ) = E
=
2
x
x
Cxx (0)
x
SIPE, lecture 2
3 | xx
Cxx ( ) = E ( x(t ) x )( x (t ) x )
= E [ x(t )x (t )] E [ x (t ) x ] E [ x x (t )] + E x2
= xx ( ) x2 x2 + x2
= xx ( ) x2
If = 0, then autocovariance and autocorrelation functions are identical
At zero lag:
Cxx (0) = E ( x (t ) x ) = x2
SIPE, lecture 2
4 | xx
Example autocovariances
signal
white
5
2
Matlab
demo: Lec2_example_Cuu.m
0
-5
0
0
low-pass
1
0
-1
sinusoid
sin. + noise
-2
-2
0.05
-0.05
-2
0.5
-1
-1
-1
0
tau [s]
-0.5
-2
2
-5
-1
-1
Cuu
2
3
time [s]
-2
-2
SIPE, lecture 2
5 | xx
SIPE, lecture 2
6 | xx
SIPE, lecture 2
7 | xx
Cross-correlation functions
Measure for common structure in two signals:
Cross-correlation
xy ( ) = E [ x (t )y (t )]
Cross-covariance
Cxy ( ) = E ( x (t ) x ) ( y (t ) y ) = xy ( ) x y
Cross-correlation coefficient
x (t )
x
rxy ( ) = E
x
y (t ) y
y
Cxy ( )
=
Cxx (0)Cyy (0)
SIPE, lecture 2
8 | xx
y (t ) = x (t 0 ) + v (t )
Additive noise v(t) is stochastic and uncorrelated to x(t),
SIPE, lecture 2
9 | xx
u(t)
10
15
20
25
time [s]
u
30
35
40
45
50
10
15
20
25
time [s]
30
35
40
45
50
y(t)
5
0
-5
Cuy ()
1
0
-1
-2
-1.5
-1
-0.5
0
[s]
0.5
1.5
SIPE, lecture 2
10 | xx
Noises have zero mean and are independent of the signals and of each
other.
Autocorrelation: zz ( ) = E ( y (t ) + v (t ))( y (t ) + v (t ) )
= yy ( ) + yv ( ) + vy ( ) + vv ( )
= yy ( ) + vv ( )
11 | xx
= xy ( ) + xv ( ) + ny ( ) + nv ( )
= xy ( )
Additive noise will not bias cross-correlation functions!
SIPE, lecture 2
12 | xx
Noise Reduction
Longer recordings
More information, same amount of noise
SIPE, lecture 2
13 | xx
Properties of Estimators
Formula given (autocovariances / spectral densities) are
estimators for the true relations.
What are the properties of these estimators?
bias / variance / consistency
SIPE, lecture 2
14 | xx
1 N
x = xk
N k =1
1 N
2
Estimator for the signal variance: = ( xk x )
N k =1
2
x
SIPE, lecture 2
15 | xx
16 | xx
1 N
( xk x )
xk N xl
k =1
k =1
l =1
1 N 2 2 N
1 N N
= xk xk xl + 2 xl xk
N k =1
N l =1
N l =1 k =1
1
x2 =
N
1
=
N
2 N
1 N N
+
E
x
E
x
x
E
x
x
{
}
{
}
k l
l k
{ k } N
2
N
k =1
l =1
l =1 k =1
1 N 2
2 2 N
1 2 N N
2
2
2
E { x } = x + x x K xk xl 2 x + 2 x K xk xl + x2
N k =1
N
N
l =1
l =1 k =1
1
E { } =
N
2
x
1
1 N 1 2
2
E { x2 } = x2 1 1 + 2 N = x2 1 =
x
N
N
N N
Estimator is biased and consistent
SIPE, lecture 2
17 | xx
(x )
=
biased estimator:
N
N
2
x
k =1
1 N 1 2
E x2 = x2 1 =
x
N N
{ }
unbiased estimator:
(default!)
1 N
2
(
)
=
x
k x
N 1 k =1
2
x
{ }
E x2 = x2
SIPE, lecture 2
18 | xx
xy ( ) = E [ x(t )y (t )]
xy ( ) = lim
2T
x(t )y (t )dt
x(i )y (i )
i=
with i =1, 2, , N
SIPE, lecture 2
19 | xx
xy ( ) = 1
x(i )y (i )
i=
N i =
N
1
N
20 | xx
Additional demos
Calculation of cross-covariance: Lec2_calculation_Cuy.m
N
1
xy ( ) = x (i )y (i )
N i =
SIPE, lecture 2
21 | xx
Input signals:
White noise (WN)
Low pass filtered noise (LP: 1/(0.5s+1) )
SIPE, lecture 2
22 | xx
Cuy (WN)
time delay
1
0.02
0.5
0.01
0
0
0.1
Cuy (LP)
0.05
-0.5
-5
-0.01
-5
0.04
-0.05
-5
0
time [s]
0.2
0.02
0
0
0
-0.1
-5
1
impulse
-0.02
-5
-0.2
-5
10
5
0.5
1
0
0
-5
0
time [s]
0
-5
0
time [s]
-5
-5
SIPE, lecture 2
23 | xx
X ( f ) = ( x (t )) =
x ( t ) e j 2 ft dt
x(t ) = 1 ( X ( f ) ) =
X ( f ) e j 2 tf df
SIPE, lecture 2
25 | xx
Fourier transformation
y(t) is an arbitrary signal
Y ( f ) = y (t )e j 2 ft dt
Euler formula: e
jz
= cos ( z ) + j sin ( z )
SIPE, lecture 2
26 | xx
0.5
-0.5
-1
-1.5
0
0.5
1.5
2.5
3.5
4.5
SIPE, lecture 2
27 | xx
y(t) = sin(0.5t)
1.5
5
4.5
1
4
3.5
0.5
2.5
2
-0.5
1.5
1
-1
0.5
-1.5
0
0.5
1.5
2.5
3.5
4.5
0
-0.5
0.5
1.5
SIPE, lecture 2
28 | xx
U (f ) = ( u(t ) ) = u(t )e
j 2
ft
N
t =1
f =
1
N t
SIPE, lecture 2
29 | xx
u(k );
k [0,1,, N 1]
N 1
U (r );
r [0,1,, N 1]
r 0,1, ,
2
SIPE, lecture 2
30 | xx
Power spectrum or
auto-spectral density
auto-spectral density Sxx is Fourier Transform of autocorrelation
S xx ( ) = ( xx ( ) ) =
)
e
d
xx
S xx ( f ) = ( xx ( ) ) =
2 jf
(
)
e
d
xx
properties:
Real values (no imaginary part)
Symmetry: Sxx(f)=Sxx(-f) => only positive frequencies are analyzed
Cxx(0) = Sxx(f) df = x2
Area under Sxx(f) is equal to variance of signal (Parsevals theorem)
SIPE, lecture 2
31 | xx
Cross-spectrum or
Cross-spectral density
cross-spectral density Sxy:
S xy ( f ) = ( xy ( ) ) =
j 2 f
)
e
d
xy
properties:
Complex values
Sxy*(f)=Sxy(-f) => only positive frequencies are analyzed
Sxy(f) describes the interdependency of signals x(t) and y(t) in
frequency domain (gain and phase)
if xy() = 0, then Sxy(f) = 0 for all frequencies
SIPE, lecture 2
32 | xx
uu ( )e
Suu (f ) =
j 2
f
N
=0
1 N
j 2
( i i )f
N
= e0 = 1
( i )f N
if
N 1
j 2
j 2
1
N
gives: S (f ) =
u(i )e
u(i )e N
uu
N =0
i =
1 *
U (nf )U (nf )
N
Indirect approach
and direct approach
give equal result!
* : complex conjugate:
U * (nf ) = U ( nf )
SIPE, lecture 2
33 | xx
uy ( )e
Suy (f ) =
j 2
f
N
=0
1 *
SIPE, lecture 2
34 | xx
input, output
Fourier
Transformation
x(t), y(t)
cross-correlation
function
xy()
cross-covariance
function
Cxy()
correlation
coefficient
rxy()
Frequency Domain
X(f), Y(f)
Sxy(f)
xy(f)
input, output
cross-spectral
density
coherence
SIPE, lecture 2
35 | xx
Reconstruction
DA conversion
Distortion: Hold Circuits
Sampling
AD conversion
Distortion: "Dirac Comb"
36 | xx
SIPE, lecture 2
37 | xx
u(t)
y (t ) = N (u(t ))
N
y(t)
k1y1 (t ) = N (k1u1 (t ))
k 2 y 2 (t ) = N (k 2u2 (t ))
k1y1 (t ) + k 2 y 2 (t ) = N (k1u1 (t ) + k 2u2 (t ))
SIPE, lecture 2
38 | xx
N ( d ( t , t ) ) = h ( t , t )
u (t ) =
u d ( t k t , t )
k =
SIPE, lecture 2
39 | xx
y (t ) = N (u(t ))
=
u N ( d ( t k t, t ) )
k =
u h ( t k t, t )
k =
Then h(t) is the impulse response function (IRF) and the output
the convolution integral
y (t ) =
h ( ) u ( t )d
SIPE, lecture 2
40 | xx
y (t ) = h ( ) u ( t )d
o
Discrete
T 1
y (t ) = h ( ) u ( t )
=0
SIPE, lecture 2
41 | xx
y (t ) =
h ( ) u ( t )d
Y (f ) = ( y (t ) ) = h ( ) u ( t )d
j 2 ft
dt
= h ( ) u ( t )d e
2 ft
h
u
t
e
dtd
(
)
(
)
Y (f ) = H (f )U (f )
SIPE, lecture 2
42 | xx
y (t ) = (h u )(t ) =
SIPE, lecture 2
43 | xx
y(t)
u(t)
y ( t ) = n ( t ) + h ( t ') u ( t - t' ) dt'
Cuu ( ) = 0 for 0;
Cuu ( 0 ) = 1
Cuy ( ) = Cun ( ) + h ( )
Other 'tricks' needed when u(t) is not white
SIPE, lecture 2
44 | xx
y(t)
u(t)
y ( t ) = n ( t ) + h ( t ') u ( t - t' ) dt'
if Sun ( f ) = 0 :
H(f )=
Suy ( f )
Suu ( f )
SIPE, lecture 2
45 | xx
Identification:
time-domain vs. frequency-domain
n(t)
?
u(t)
y(t)
Time domain
Unknown system: impulse response function (IRF) of h(t) over
limited time
Mostly: direct model parameterization (fit of physics model)
Frequency domain
Unknown system: frequency response function (FRF) H(f) for number
of frequencies
SIPE, lecture 2
46 | xx
Time delay
First order system
Second order system
Unstable system
(try Matlab!)
SIPE, lecture 2
47 | xx
SIPE, lecture 2
48 | xx
SIPE, lecture 2
49 | xx