Stochastic processes Lecture 7 Linear time invariant systems 1.
-
Upload
matteo-gunby -
Category
Documents
-
view
214 -
download
2
Transcript of Stochastic processes Lecture 7 Linear time invariant systems 1.
1
Stochastic processes
Lecture 7Linear time invariant systems
2
Random process
3
1st order Distribution & density function
First-order distribution
First-order density function
4
2end order Distribution & density function
2end order distribution
2end order density function
5
EXPECTATIONS
β’ Expected value
β’ The autocorrelation
6
Some random processes
β’ Single pulseβ’ Multiple pulsesβ’ Periodic Random Processesβ’ The Gaussian Processβ’ The Poisson Processβ’ Bernoulli and Binomial Processesβ’ The Random Walk Wiener Processesβ’ The Markov Process
7
Recap: Power spectrum density
f
Sxx
(f)
8
Power spectrum density
β’ Since the integral of the squared absolute Fourier transform contains the full power of the signal it is a density function.
β’ So the power spectral density of a random process is:
β’ Due to absolute factor the PSD is always real
ππ₯π₯ ( π )= π πππββ
πΈ [|β«βππ π (π‘ )πβ π 2π ππ‘ππ‘|22π ]
9
Power spectrum density
β’ The PSD is a density function.β In the case of the random process the PSD is the density
function of the random process and not necessarily the frequency spectrum of a single realization.
β’ Exampleβ A random process is defined as
β Where Οr is a unifom distributed random variable wiht a range from 0-Ο
β What is the PSD for the process and β The power sepctrum for a single realization
X (π‘ )=sin (ππ π‘)
10
Properties of the PSD
1. Sxx(f) is real and nonnegative
2. The average power in X(t) is given by:
3. If X(t) is real Rxx(Ο) and Sxx(f) are also even
4. If X(t) has periodic components Sxx(f)has impulses
5. Independent on phase
11
Wiener-Khinchin 1
β’ If the X(t) is stationary in the wide-sense the PSD is the Fourier transform of the Autocorrelation
12
Wiener-Khinchin Two method for estimation of the PSD
X(t)
Fourier Transform
|X(f)|2
Sxx(f)
Autocorrelation
Fourier Transformt
X(t
)
f
X(f
)
Rxx
()
f
Sxx
(f)
13
The inverse Fourier Transform of the PSD
β’ Since the PSD is the Fourier transformed autocorrelation
β’ The inverse Fourier transform of the PSD is the autocorrelation
14
Cross spectral densities
β’ If X(t) and Y(t) are two jointly wide-sense stationary processes, is the Cross spectral densities
β’ Or
15
Properties of Cross spectral densities
1. Since is
2. Syx(f) is not necessary real
3. If X(t) and Y(t) are orthogonal Sxy(f)=0
4. If X(t) and Y(t) are independent Sxy(f)=E[X(t)] E[Y(t)] Ξ΄(f)
16
Cross spectral densities example
β’ 1 Hz Sinus curves in white noise
Where w(t) is Gaussian noise
0 5 10 15 20-10
0
10
X(t
)
t (s)
Signal X(t)
0 5 10 15 20-10
0
10
Y(t
)
t (s)
Signal Y(t)
π (π‘ )=sin (2π π‘ )+3π€ (π‘)π (π‘ )=sin(2ππ‘+π2 )+3π€(π‘)
0 5 10 15 20 25-30
-25
-20
-15
-10
-5
0
5
Frequency (Hz)
Pow
er/f
requ
ency
(dB
/Hz)
Welch Cross Power Spectral Density Estimate
17
The periodogramThe estimate of the PSD
β’ The PSD can be estimate from the autocorrelation
β’ Or directly from the signal
π π₯π₯ [Ο ]= βπ=βπ+1
πβ 1
π π₯π₯ [π]πβ π Οπ
π π₯π₯ [Ο ]= 1π |β
π=0
πβ 1
π₯ [π]πβ πΟπ |2
18
Bias in the estimates of the autocorrelation
N=12π π₯π₯ [π ]= β
π=0
πβ|π|β 1
π₯ [π ] π₯ [π+π]
-10 -5 0 5 10 15 20-2
-1
0
1
2
n
-10 -5 0 5 10 15 20-2
-1
0
1
2
n+m-15 -10 -5 0 5 10 15
-6
-4
-2
0
2
4
6
8Autocorrelation
M=-10
-10 -5 0 5 10 15 20-2
-1
0
1
2
n
-10 -5 0 5 10 15 20-2
-1
0
1
2
n+m-15 -10 -5 0 5 10 15
-6
-4
-2
0
2
4
6
8Autocorrelation
M=0
-10 -5 0 5 10 15 20-2
-1
0
1
2
n
-10 -5 0 5 10 15 20-2
-1
0
1
2
n+m-15 -10 -5 0 5 10 15
-6
-4
-2
0
2
4
6
8Autocorrelation
M=4
19
Variance in the PSD
β’ The variance of the periodogram is estimated to the power of two of PSD
πππ (ππ₯π₯ [π ] )=π π₯π₯(π) 2
0 5 10-5
0
5Realization 1
t (s)0 50 100 150 200
0
5
10PSD: Realization 1
f (Hz)
0 5 10-5
0
5
t (s)
Realization 2
0 50 100 150 2000
5
10
f (Hz)
PSD: Realization 2
0 5 10-5
0
5
t (s)
Realization 3
0 50 100 150 2000
5
10
f (Hz)
PSD: Realization 3 0 50 100 150 200
0
0.2
0.4
0.6
0.8
1
f (Hz)
Sxx
(f)
True PSD
20
Averaging
β’ Divide the signal into K segments of M length
β’ Calculate the periodogram of each segment
β’ Calculate the average periodogram
21
Illustrations of Averaging
0 1 2 3 4 5 6 7 8 9 10-4
-2
0
2X
(t)
0 100 2000
5
10
0 100 2000
2
4
0 100 2000
5
10
0 100 2000
2
4
6
0 50 100 150 2000
5
10
f (Hz)
22
PSD units
β’ Typical units:β’ Electrical measurements: V2/Hz or dB V/Hzβ’ Sound: Pa2/Hz or dB/Hz
β’ How to calculate dB I a power spectrum:PSDdB(f) = 10 log10 { PSD(f) }
.
-100 -50 0 50 1000
1
2
3
4
5
6x 10
8
f (Hz)
Sxx
(f)
V2 /
Hz
-100 -50 0 50 10040
50
60
70
80
90
f (Hz)
Sxx
(f)
dB V
/H
z
23
Agenda (Lec. 7)
β’ Recap: Linear time invariant systemsβ’ Stochastic signals and LTI systems
β Mean Value functionβ Mean square value β Cross correlation function between input and outputβ Autocorrelation function and spectrum output
β’ Filter examples β’ Intro to system identification
24
Focus continuous signals and system
Continuous signal:
Discrete signal:
0 20 40 60 80 100-1
0
1
t (s)
x(t)
0 2 4 6 8 10-1
-0.5
0
0.5
1
n
x[n]
25
Systems
26
Recap: Linear time invariant systems (LTI)
β’ What is a Linear system:β The system applies to superposition
)()()()( 2121 txTbtxTatxbtxaT
0 1 2 3 4 50
2
4
6
8
10
12
14
16
18
20Linear system
x(t)
y(t)
0 1 2 3 4 5-20
-15
-10
-5
0
5
10
15
20
25Nonlinear systems
x(t)
y(t)
x[n]2
Γx[n]
20 log(x[n])
27
Recap: Linear time invariant systems (LTI)
β’ Time invariant:β’ A time invariant systems is independent on explicit time
β (The coefficient are independent on time)
β’ That means If: y2(t)=f[x1(t)]
Then: y2(t+t0)=f[x1(t+t0)]
The same to Day tomorrow and in 1000 years
70 years45 years20 yearsA non Time invariant
28
Examples
β’ A linear systemy(t)=3 x(t)
β’ A nonlinear systemy(t)=3 x(t)2
β’ A time invariant system y(t)=3 x(t)
β’ A time variant system y(t)=3t x(t)
The impulse response
T{β}
)]([][ tfnh )(th)(t
The output of a system if Dirac delta is input
-10 -5 0 5 10 15 20
0
t
y(t)
Impuls response
-10 -5 0 5 10 15 200
inf
t
x(t)
Impuls
30
Convolution
β’ The output of LTI system can be determined by the convoluting the input with the impulse response
31
Fourier transform of the impulse response
β’ The Transfer function (System function) is the Fourier transformed impulse response
β’ The impulse response can be determined from the Transfer function with the invers Fourier transform
32
Fourier transform of LTI systems
β’ Convolution corresponds to multiplication in the frequency domain
-10 -5 0 5 10 15 20
0
t
y(t)
Impuls response
-2 -1 0 1 20
0.5
1
1.5
f (Hz)
|H(f
)|
-10 -5 0 5 10 15 20-3
-2
-1
0
1
2
3
t
x(t)
Input
-2 -1 0 1 20
500
1000
1500
2000
2500
3000
f (Hz)
|X(f
)|
-2 -1 0 1 20
200
400
600
800
1000
1200
f (Hz)
|Y(f
)|
-10 -5 0 5 10 15 20-3
-2
-1
0
1
2
3
t
y(t)
Output
Time domain
Frequency domain
* =
x =
33
Causal systems
β’ Independent on the future signal
-10 -5 0 5 10 15 20
0
t
y(t)
Impuls response
34
Stochastic signals and LTI systems
β’ Estimation of the output from a LTI system when the input is a stochastic process
Ξ is a delay factor like Ο
35
Statistical estimates of output
β’ The specific distribution function fX(x,t) is difficult to estimate. Therefor we stick toβ Mean β Autocorrelation β PSD β Mean square value.
36
Expected Value of Y(t) (1/2)
β’ How do we estimate the mean of the output?
πΈ [π (π‘ ) ]=πΈ[β«ββ
β
π (π‘βπΌ )h (πΌ )ππΌ ]πΈ [π (π‘ ) ]=β«
ββ
β
πΈ [ π (π‘βπΌ ) ] h (πΌ ) ππΌ
πΈ [π (π‘ ) ]=β«ββ
β
ππ₯ (π‘βπΌ)h (πΌ )ππΌ
If mean of x(t) is defined as mx(t)
π (π‘)=β«ββ
β
π (π‘βπΌ )h (πΌ )ππΌ
37
Expected Value of Y(t) (2/2)
If x(t) is wide sense stationary
ππ₯ (π‘βπΌ )=ππ₯ (π‘ )=ππ₯(ππ₯ππ πππππ π‘πππ‘)
Alternative estimate:At 0 Hz the transfer function is equal to the DC gain
β«ββ
β
h (πΌ )ππΌ=π» (0)
Therefor: ππ¦=πΈ [π (π‘ ) ]=ππ₯π» (0)
38
Expected Mean square value (1/2)
πΈ [π (π‘ )2 ]=πΈ [π (π‘ )π (π‘ ) ] π (π‘)=β«ββ
β
π (π‘βπΌ )h (πΌ )ππΌ
πΈ [π (π‘ )2 ]=πΈ[(β«βββ
π (π‘βπΌ1 )h (πΌ1 ) ππΌ1)(β«ββ
β
π (π‘βπΌ2 )h (πΌ2 )ππΌ2) ]πΈ [π (π‘ )2 ]=πΈ[β«
ββ
β
β«ββ
β
π (π‘βπΌ1 )π (π‘βπΌ2 )h (πΌ1 )h (πΌ2 )ππΌ1ππΌ2 ]πΈ [π (π‘ )2 ]=β«
ββ
β
β«ββ
β
πΈ [π (π‘βπΌ1 ) π (π‘βπΌ2 ) ] h (πΌ1 )h (πΌ2 )ππΌ1ππΌ2
πΈ [π (π‘ )2 ]=β«ββ
β
β«ββ
β
π π₯π₯ (π‘βπΌ1, π‘βπΌ2)h (πΌ1 )h (πΌ2 )ππΌ1ππΌ2
πΈ [π (π‘ )2 ]=β«ββ
β
β«ββ
β
π π₯π₯ (πΌ1 ,πΌ2)h (π‘βπΌ1 )h (π‘βπΌ2 )ππΌ1ππΌ2
39
Expected Mean square value (2/2)
πΈ [π (π‘ )2 ]=β«ββ
β
β«ββ
β
π π₯π₯ (πΌ1 ,πΌ2)h (π‘βπΌ1 )h (π‘βπΌ2 )ππΌ1ππΌ2
πΈ [π (π‘ )2 ]=β«ββ
β
β«ββ
β
π π₯π₯ (πΌβ π½)h (πΌ )h (π½ )ππΌ1ππΌ2
By substitution:
πΈ [π (π‘ )2 ]=β«ββ
β
β«ββ
β
π π₯π₯ (π‘βπΌ ,π‘β π½)h (πΌ )h ( π½)ππΌ1ππΌ2
If X(t)is WSS
Thereby the Expected Mean square value is independent on time
40
Cross correlation function between input and output
β’ Can we estimate the Cross correlation between input and out if X(t) is wide sense stationary
π π¦π₯ (π‘+π , π‘ )=πΈ [π (π‘+π )πβ(π‘)]
π π¦π₯ (π‘+π , π‘ )=πΈ[(β«βββ
π (π‘βπΌ+π )h (πΌ ) ππΌ) πβ(π‘)]π π¦π₯ (π‘+π , π‘ )=πΈ[β«
ββ
β
π (π‘βπΌ+π ) πβ(π‘)h (πΌ )ππΌ ]
π π¦ π₯ (π )=β«ββ
β
π π₯π₯ (πβπΌ )h (πΌ ) ππΌ=π π₯π₯ (π )βh (π)
-10 -5 0 5 10 15 20-3
-2
-1
0
1
2
3
t
x(t)
Input
-10 -5 0 5 10 15 20-3
-2
-1
0
1
2
3
t
y(t)
Output
π π₯π₯ (π )=πΈ [ π (π‘+π )π (π‘)]
-30 -20 -10 0 10 20 30-1500
-1000
-500
0
500
1000
1500
(s)
Rxy
()
Cross-correlation between y(t) and x(t)
Thereby the cross-correlation is the convolution between the auto-correlation of x(t) and the impulse response
41
Autocorrelation of the output (1/2)
π π¦π¦ (π )=π π¦π¦ (π‘+π , π‘ )=πΈ [π (π‘+π )π (π‘) ]
π π¦π¦ (π )=β«ββ
β
β«ββ
β
πΈ [ π (π‘+πβπΌ ) π (π‘β π½ )]h (πΌ )h (π½ )ππΌ ππ½
π (π‘+π)=β«ββ
β
π (π‘+πβπΌ )h (πΌ )ππΌ
π (π‘)=β«ββ
β
π (π‘β π½)h (π½ )π π½
Y(t) and Y(t+Ο) is :
π π¦π¦ (π )=β«ββ
β
β«ββ
β
π π₯π₯(πβπΌ+π½)h (πΌ )h (π½ )ππΌ ππ½
42
Autocorrelation of the output (2/2)
π π¦π¦ (π )=β«ββ
β
β«ββ
β
πΈ [ π (π‘+πβπΌ ) π (π‘β π½ )]h (πΌ )h (π½ )ππΌ ππ½
By substitution: Ξ±=-Ξ²
π π¦π¦ (π )=β«ββ
β
β«ββ
β
πΈ [ π (π‘+πβπΌ ) π (π‘+πΌ )] h (πΌ )h (βπ )ππΌ ππΌ
Remember:
-30 -20 -10 0 10 20 30-1000
-500
0
500
1000
(s)
Rxy
()
Autocorrelation of y(t)
π π¦π¦ (π )=π π¦ π₯ (π )βh(βπ)
π π¦π¦ (π )=π π₯ π₯ (π )βh (π)βh(βπ )
43-2 -1 0 1 2
0
2
4
6
8
10
12x 10
5
f (Hz)
Syy
(f)
Spectrum of output
β’ Given:
β’ The power spectrum is
π π¦ π¦ (π )=π π₯π₯ (π )βh (π )βh(βπ )
-2 -1 0 1 20
0.5
1
1.5
f (Hz)
|H(f
)|2
-2 -1 0 1 20
2
4
6
8
10x 10
6
f (Hz)
Sxx
(f)
x =
ΒΏπ» ( π )β¨ΒΏ2=π» ( π )π»β( π )ΒΏ
44
Filter examples
45
Typical LIT filters
β’ FIR filters (Finite impulse response)β’ IIR filters (Infinite impulse response)
β Butterworthβ Chebyshevβ Elliptic
Ideal filters
β’ Highpass filter
β’ Band stop filter
β’ Bandpassfilter
47
Filter types and rippels
Analog lowpass Butterworth filter
β’ Is βall poleβ filterβ Squared frequency transfer function
β’ N:filter orderβ’ fc: 3dB cut off frequency
β’ Estimate PSD from filter
NcfffH 2
2
/1
1)(
Nc
xxyyff
ffS 2/1
1)(S)(
Chebyshev filter type I
β’ Transfer function
β’ Where Ξ΅ is relateret to ripples in the pass band
β’ Where TN is a N order polynomium
pN ffTfH
/1
122
2
1
1
)coshcosh(
)coscos()(
1
1
x
x
xN
xNxTN
Transformation of a low pass filter to other types (the s-domain)
Filter type Transformation New Cutoff frequency
Lowpas>Lowpas
Lowpas>Highpas
Lowpas>Highpas
Lowpas>Stopband
ssp
p
'
p'
ss pp '
p'
)(
2
lu
ulp s
ss
ul
lup s
ss
2
)(
ul ,
ul ,
Lowest Cutoff frequency
Highest Cutoff frequency:
:
u
l
p
New Cutoff frequencyp'
Old Cutoff frequency
51
Discrete time implantation of filters
β’ A discrete filter its Transfer function in the z-domain or Fourier domain
β Where bk and ak is the filter coefficients
β’ In the time domain:
Mm
Mm
zazazaa
zbzbzbbzH
zX
zY
.......Β΄
.......Β΄)(
)(
)(2
21
10
22
110
][......]2[]1[
][......]2[]1[][][
21
210
Mnyanyanya
Mnxanxbnxbnxbny
M
M
52
Filtering of a Gaussian process
β’ Gaussian processβ X(t1),X(t2),X(t3),β¦.X(tn) are jointly Gaussian for all t
and n valuesβ’ Filtering of a Gaussian process
β Where w[n] are independent zero mean Gaussian random variables.
][......]2[]1[
][......]2[]1[][][
21
210
Mnyanyanya
Mnwanwbnwbnwbny
M
M
The Gaussian Process
β’ X(t1),X(t2),X(t3),β¦.X(tn) are jointly Gaussian for all t and n values
β’ Example: randn() in Matlab
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000-4
-3
-2
-1
0
1
2
3
4
5Gaussian process
-4 -3 -2 -1 0 1 2 3 4 50
100
200
300
400
500
600
700Histogram of Gaussian process
The Gaussian Process and a linear time invariant systems
β’ Out put = convolution between input and impulse response
Gaussian input Gaussian output
Example
β’ x(t):
β’ h(t): Low pass filterβ’ y(t):
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000-4
-3
-2
-1
0
1
2
3
4
5Gaussian process
-4 -3 -2 -1 0 1 2 3 4 50
100
200
300
400
500
600
700Histogram of Gaussian process
-1.5 -1 -0.5 0 0.5 1 1.50
100
200
300
400
500
600Histogram of y(t)
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000-1.5
-1
-0.5
0
0.5
1
1.5
56
Filtering of a Gaussian process example 2
0 100 200 300 400 500-1000
-500
0
Frequency (Hz)
Pha
se (
degr
ees)
0 100 200 300 400 500-100
-50
0
Frequency (Hz)
Mag
nitu
de (
dB) Transfere function of filter
0 100 200 300 400 500 600 700 800 900 1000-4
-2
0
2
4
t (ms)
x(t)
White noise
Band pass filter
0 100 200 300 400 500 600 700 800 900 1000-1
-0.5
0
0.5
1
t (ms)
y(t)
Output
57
Intro to system identification
β’ Modeling of signals using linear Gaussian models:
β’ Example: AR models
β’ The output is modeled by a linear combination of previous samples plus Gaussian noise.
][][......]2[]1[][ 21 nwMnyanyanyany M
58
Modeling example
β’ Estimated 3th order model
][]3[0.7299-]2[2.3903]1[-2.6397][ nwnynynyny
0 100 200 300 400 500 600 700 800 900 1000-1
-0.5
0
0.5
1
t (ms)
y(t)
Output
451 451.5 452 452.5 453 453.5 4540.25
0.3
0.35
0.4
t (ms)y(
t)
Output
signal
points used for predictionPrediction
True point
453.98 453.99 454 454.01 454.02
0.282
0.284
0.286
0.288
0.29
0.292
0.294
t (ms)
y(t)
Output
w[n]
59
Agenda (Lec. 7)
β’ Recap: Linear time invariant systemsβ’ Stochastic signals and LTI systems
β Mean Value functionβ Mean square value β Cross correlation function between input and outputβ Autocorrelation function and spectrum output
β’ Filter examples β’ Intro to system identification