Stochastic processes Lecture 7 Linear time invariant systems 1.
-
Upload
matteo-gunby -
Category
Documents
-
view
215 -
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