Ee422 8
Ee422 8
Ee422 8
Instructor: Zhang
Introduction
Most real signals and natural (physical) processes: continuous time
Page 8-1
Instructor: Zhang
B. How does the computer understand the progress and behaviors of the
process being monitored and controlled? By sampling the output of the
Continuous-time system!
=>
How can we ensure that the sampled signal is a sufficient representation of
its continuous-time origin. i.e., how fast we have to sample?
A question we must answer before z-transform based analysis!
C. Two basic parts of the chapter
Part one: Theoretical frame work for determining how fast we have to sample.
Part two: z-transform
1. Sample Operation
Needs to Know:
(1) Sampling
period: T
(2) X (t) is
sampled at t=nT
(3) What do
we mean by x (n)
(4) Sampling
function: p (t)
Page 8-2
Instructor: Zhang
Page 8-3
Instructor: Zhang
: xs(t) = x(t)p(t)
Cn e
Derivation : p (t ) n
jn 2f s t
1
T
Cn
p(t )e
jn 2f s t
1
T
dt
T / 2
xs (t ) p (t ) x (t )
( Cn e jn 2f st ) x (t )
x (t )e jn 2f st
xs ( f )
x (t )e jn 2f st
(t )e j 2ft dt
j 2 ( f nf s ) t
dt
For n
x (t )e jn 2f s t e j 2ft dt
C x(t )e
X ( f nf s )
Page 8-4
X ( f nf s )
Instructor: Zhang
Consider a f 0 f h
X s ( f0 )
Cn X ( f
nf s )
X ( f 0 nf s )
C 0 X ( f 0 ) [C1 X ( f 0 f s ) C 1 X ( f 0 f s )]
If
f0 fs fh
or
X ( f0 f s ) 0
or
f0 fs fh
X ( f0 f s ) 0
X s ( f 0 ) C0 X ( f 0 )
Modifier
Page 8-5
If
Instructor: Zhang
f0 fs fh
f0 fs fh
or
X ( f0 f s ) 0
X ( f0 f s ) 0
or
X s ( f 0 ) C0 X ( f 0 )
No spectrum modification
6. How fast we have to sample in order to keep the spectrum:
Xs( f ) X( f )
Condition
(| f | f h )
| f f s | fh
| f f s | f h
f s only =>
Consider
fs f fh fs 2 fh
=>
fs f fh
fs fh f fs 2 fh
fs f fh
Answer : f s 2 f h
(t nT ) Cn
X s ( f ) fs
X(f
Constant with n
1
T
T /2
f s 10 f h
jn 2f s t
dt
T / 2
nf s )
(t )e
1
T
X(f
1
fs
T
nf s )
Similar as r 0
Page 8-6
Instructor: Zhang
Output
xs (kT )h(t kT )
x(kT )h(t kT )
Discrete-time
algorithm
What is
y (t )
Lets see:
x s (t ) x (t )
(t kT ) or
Consider xs(t)*h(t) :
x s (t )
x(kT ) (t kT )
Page 8-7
Instructor: Zhang
x s (t ) * h(t )
( ) h(t )d
x(kT ) ( kT )h(t )d
x(kT ) ( kT )h(t )d
x(kT )h(t kT )
x (kT )h(t kT )
Output of the reconstruction Filter (y(t)): Convolution ofk
xs(t)
and h() !
y (t )
Ideal Filter
T
H( f )
0
| f | 0.5 f s
Otherwise (| f | 0.5 f s )
Question : why do we need this low-pass filter to reconstruct x(t) from xs(t)?
answer : xs(t) contains frequencies higher than f h 0.5 f s , but x(t)does not!
Question : Will any spectrum (other than x(t)s introduced by sampling operation
remains after the filter?
Answer: No. f s 2 f h , has ensured that no overlapping between x(t)s
frequencies and the undesired frequencies in xs(t) introduced by
sampling!
Implementation of Ideal Reconstruction Filter
(Given the Impulse response of the filter)
Inverse Fourier transform =>
Page 8-8
Instructor: Zhang
h(t )
H ( f )e
j 2ft
df
fs / 2
fs / 2
fs / 2
fs / 2
j 2ft
Te df T
T
e j 2ft
j 2t
f fs / 2
f f s / 2
j 2ft
df
T sin(f s t ) T 1 / f s sin(f s t )
t
(f s t )
n l
x( kT )
sin f s (
f s (
k n l 1
t
k)
T
t
k)
T
nl
k n l 1
x ( kT )
(k=n-l+1,,n)
(k=n+1,,n+l)
Page 8-9
Instructor: Zhang
Part Two
8-3A The z-Transform
1. Definition
For Laplace transform, we are given a function x(t),
For z-Transform, we are given a sampling sequence: x(0) , x(T), x(2T),
Definition: z-transform of a given sequence x(0) , x(T), x(2T),
n
1
2
is Z ( x(nT )) X ( z ) x(nT ) z x(0) x(T ) z x(2T ) z
n0
x(t)
x(t )e
st
dt
L[ x (t )] x ( nT )e snT T
n 0
T x ( nT )(e sT ) n
n 0
z ~ e sT
Z [ x( nT )] x( nT ) z n
n 0
L[ x(t )] TZ ( xs (t )) z esT
x(nT): samples of
(1) 0
(eT 1) | z | 1
s: r.h.p.
(3) 0
(note | e jT
| 1 )
| z | 1
Page 8-10
s: j axis.
Instructor: Zhang
z: unit circle
e T 1
(4) s = 0 (
0, 0 )
e jT cosT j sin T
z=1
unbounded
bounded
Page 8-11
Instructor: Zhang
n 0
1
0
(n)
x(nT )
n 0
Solution :
Similar as Laplace
transform
X ( z ) x(0) x (T ) z 1 1
1
0
x(nT )
Solution :
X ( z ) x (0) x (T ) z 1
1 z 1 z 2
1
1 z 1
(| z 1 | 1
or
| z | 1)
How to understand?
Step function u(t) :
L[u (t )]
1
1
s
j
T
1 z 1
z e
1 e sT
T 0 :
sT
T
1 e sT
s j
T
1 cos T j sin T
T
1
1
lim
T 0 sin T j cos T
1 cos T j sin T
j
( 0)
(k eT )
Solution:
Page 8-12
Instructor: Zhang
X ( z ) x(0) x(T ) z 1 x( 2T ) z 2
1 kz 1 k 2 z 2
1 (k 1 z ) 1 ( k 1 z ) 2
k 1 z
1 1 2
1
1
1
1
1 kz 1
1
X ( z)
T 1
1 e z
k 1z 1 1
TX ( z ) | z e sT
T
1 e
T 0:
jT
T
1 e
T
1 e
k e z
1 s j
1
s
j
s j
( j )T
1
1
)
T
T 0 ( j )e
j
lim
( j )T
Why? Because
lim e ( j )T lim e T e jT
T 0
lim e
T 0
T 0
Example 8-6 B
x ( nT ) :
1
k0
k1
k2
=> X ( z )
(cos T j sin T ) 1
1
1 kz 1
(| z | k )
sequence
( n)
z - transform
1
1
u (n) : 1, 1,
1 z 1
1
(e T ) n : 1, e t , e 2t ,
1 e t z 1
1
1, k , k 2 ,
1 kz 1
Instructor: Zhang
4. Findztransformusingsymbolictoolbox
Example87
x ( nT ) a n cos
Solution:
n n
z
2
X ( z ) a n cos
Analysis:
n 0
(1)n:odd=> cos(k ) 0
1 k : even
n
(2)n:even=> n 2k cos( ) cos(k )
2
1 k : odd
Page 8-14
Instructor: Zhang
n n
z
2
X ( z ) a n cos
n 0
a 2 k cos k z 2 k
k 0
a z
a z
8
a 2 z 2 a 6 z 6 a10 z 10
1 a 4 z 4
1 1 2 a 2 z 2 (1 a 4 z 4 a 8 z 8 )
1
a 2 z 2
1 1 1 1
1 a 2 z 2 1 a 2 z 2
1
1
4 4
1
1 a z
1 a 2 z 2
Verycomplex!
UsingSymbolicToolBox
syms anz%Declaresymbolic
xn=a^n*cos(n*pi/2);%Definex(n)
xz=ztrans(xn,n,z);%DetermineX(z)
xz(enter)
xz=
z^2/(a^2+z^2)
z2
1
2
2
a z
1 a2 z 2
MatLab:alwaysintermsofzinsteadofz1.
X ( z)
2. Initial Value x(0) lim
z
X ( z ) x (0) x (1) z 1
why?
(1 z 1 ) X ( z )
3. Final value x() lim
z 1
x() lim sX ( s )
Why?
s 0
But,
Page 8-15
s0
1
s
s
sX ( s )
Instructor: Zhang
z 1
1
1 z 1
1 z 1
(1 z 1 ) X ( z )
lim sX ( s ) lim(1 z 1 ) X ( z )
s 0
z 1
Page 8-16
Instructor: Zhang
partial-fraction
expansion
what Terms?
1
1
z 1
What
about
if
you
have
?
1 z 1
1 z 1
1
1
T 1
1 e z
1 kz 1
1
Tz 1
What about if you have (1 z 1 ) 2 ?
1 2
(1 z )
1
Te T z 1
T 1 2
T 1 2 What about if you have
(1 e
z )
(1 e
z )
1
Lets see:
(1 e T z 1 ) 2
Az 1
B
T 1 2
T 1
(1 e z )
1 e z
Az 1 B Be T z 1
(1 e T z 1 ) 2
z 1 ) 2
1
?
1 z 2
Page 8-17
Instructor: Zhang
1
1
1
1
1
2
1
1
1
1
2
1 z
(1 jz )(1 jz )
1 jz
1 jz
1
1
1
1
1
2 1 ( jz ) 1 ( jz )
n/2
1
)
n even
1 n n 1 n n
1 1
x(nT ) Z ( 2 ) [( j) ( j) ] ( j) [(1) 1]
2
1 z 2
0 n odd
Important:beforedoingpartialfractionexpansion,makesurethez
transformisinproperrationalfunctionof z 1 !
Example 8.9
X ( z)
z2
( z 1)( z 0.2)
1
A
B
1
1 z
1 0.2 z 1
1
B (1 z 1 ) z 1
A
(1) (1 z ) X ( z )
1 0.2 z 1
1 0.2 z 1
1
1
B0
1
A
A
1.25
1 0.2
1 0 .2
0.8
(2) (1 0.2 z 1 ) X ( z )
1 z 1
1 z 1
1 z 1
1 0.2 z 1
1 0.2 z 1 0 ( z 0.2 )
X ( z)
B 1 /(1 5) 1 / 4 0.25
1.25
0.25
Page 8-18
Instructor: Zhang
z2
1
X (z) 2
1
z 1 .2 z 0 .2 1 1 .2 z 0 .2 z 2
b = 1;
a = [1 1.2 0.2];
[r, p, k] = residuez(b,a);
r .1 25
.1 25 .0 25
r
1 1
.0 25 11.0z 1 0.2z
p 1.0
.1 25 .0 25
p pole 1 1
1 z 1 0.2z
0.2
k
k
% Declare symbolic
% define X(z)
% compute x(n)
Page 8-19
Instructor: Zhang
Solution :
1
z 1.2 z 0.2
2
z2
z 2Y ( z )
Question: Define X ( z ) 2
z 1.2 z 0.2
(or
Y ( z ) z 2 X ( z ) )
x ( nT ) z 1 ( X ( z ))
Y ( z)
and
y ( nT ) z 1 (Y ( z )) ?
1
z 2
z 2
1 1.2 z 1 0.2 z 2
1 1.2 z 1 0.2 z 2
5 6 z 1
5 6 z 1
1 1.2 z 1 0.2 z 2
(1 z 1 )(1 0.2 z 1 )
A
B
1
1 z
1 0.2 z 1
V ( z)
A V ( z )(1 z 1 ) | z 1 1
5 6 z 1
1 0.2 z 1
B V ( z )(1 0.2 z 1 ) | z 1 5
z 1 1
5 6 z 1
1 z 1
1
1.25
0. 8
z 1 5
5 30
6.25
4
1
1
6.25
1
1 z
1 0.2 z 1
y ( nT ) 5 ( n) 1.25 6.25(0.2) n
Y ( z ) 5 V ( z ) 5 1.25
y ( nT ) 5 ( n) 1.25 6.25(0.2) n
n=0
n=1
n=2
n=3
5 + 1.25 - 6.25 = 0
0 + 1.25 - 6.25*0.2 = 0
0 + 1.25 - 6.25*0.22 = 1
0 + 1.25 - 6.25*0.23 =1.2
x ( nT ) 1.25 0.25(0.2) n
1.25 - 0.25 = 1
1.25 - 0.25*0.2 = 1.2
1.25 - 0.25*0.22 = 1.24
1.25 - 0.25*0.23 = 1.248
1.25 0.25(0.2) n
Page 8-20
Instructor: Zhang
Does Y ( z ) z 2 X ( z )
always imply
1
Z
(
X
(
z
))
than
?
Yes!
Z 1 (Y ( z ))
has two-step-delay
Z ( x ( nT )) X ( z ) x( nT ) z n
n 0
Z ( x ( nT kT )) x ( nT kT ) z n
n 0
z k x (nT kT ) z n k
n 0
z k x (nT kT ) z ( nk )
n 0
kT ) z ( n k )
n0
(1) x (nT
n k 0
kT ) z ( n k ) Z ( x (nT )) ?
x(nT kT ) z
(2)
:
Yes!
( n k )
n 0
n k 1
kT ) z
x(nT
n 0
( n k )
x(nT
kT ) z ( n k )
n k
n k
nT kT 0
x(nT
kT ) z ( n k )
n k 0
Z ( x ( nT ))
Z ( x ( nT kT )) z k
x(nT kT )) z ( nk )
z k Z ( x ( nT ))
n 0
x( nT kT )
Z ( x ( nT kT ))
z
Question : If Z ( x(nT ))
8-4
k steps
behind
x ( nT )
z k
Z ( x ( nT ))
Z ( x ( nT ))
1
1 0.5 z 1
, whats
Z ( x (nT 2T )) ?
Answer:
z 2
1 0.5 z 1
Instructor: Zhang
operator or
Processor
1. Shift-Invariant System
(Time-Invariant Systems for continuous-time or general)
An example of time-varying system
The processing algorithm which maps input to output changes!
What do we mean by a time-invariant system?
Shift-invariant systems:
Physical:
Mathematic:
Assume x(nT): x(0), x(T), has generated
y(nT): y(0), y(T),
For example:
0
1
0. 2
1
1
0. 4
generated
x:
y:
If we apply
x (nT n0T )
2
1
0. 6
3
1
0.8
4
1
1
has
as input
look at if
x( nT 2T )
y ( nT 2T )
x:
y:
0
0
0
0
1
0 .2
1
0.4
1
0.6
n0 2
generated
Page 8-22
Instructor: Zhang
2T )] y (nT 2T ) ? Yes!
Question: Is this example telling us
Question: Is H [ x(nT 2T )] y (nT 2T )
or H [ x(nT n0T )] y (nT n0T )
always true for different systems?
No! only for time-invariant systems!
Shift-invariant system: if H [ x(nT n0T )] y (nT n0T ) true for any n0 .
2. Causal and noncausal systems
Physical Description: A system is causal or nonanticipatory if the systems response
to an input does not depend on future values of the input.
Mathematical Description:
Causal system: x1 (nT ) x2 (nT )
for n n0
H [ x1 (nT )] H [ x2 (nT )]
for n n0
Why? Although x1(nT) may not be the same as x2(nT) for n > n0 , such difference
does not affect the output determined by input up to n = n0 .
3. Linear System
Linear System H [1 x1 (nT ) 2 x2 (nT )] 1H [ x1 (nT )] 2 H [ x2 (nT )]
Linear Systems: can be modeled as
y ( nT )
x (kT )h( nT
kT )
or
y ( nT )
h( kT ) x ( nT
kT )
Convolution
Page 8-23
Linear+causal+ x (kT ) 0
y (nT )
Instructor: Zhang
( k 0)
x(kT )h(nT kT )
x ( kT ) 0 ( k 0 )
x(kT )h(nT kT )
Example:
k 0
causal
(nT kT 0) nT kT
k 0
k 0
Given
x(0) = 1, x(T) = 2, x(2T) = 2, x(3T) = 1,
h(0) = 3, h(T) = 2, h(2T) = 1, h(3T) = 0,
MatLab:
x = [1 2 2 1 1];
h = [3 2 1];
y = conv(x,h);
y
3
8
11
9
7
3
1
Example 8-13:
1
x(nT ) u(n)
2
n
1 1
y
(
nT
)
x
(
nT
)
*
h
(
nT
)
3
2
2 3
1
h(nT ) u(n)
3
% Declare Symbolic
% x(n)
% h(n)
% z-transform of x(n)
% z-transform of h(n)
% multiply, not convolution
% Do you know why?
% y(nT)=3(1/2)n 2(1/3)n
Page 8-24
Instructor: Zhang
x(nT ) n 0 X ( z) Z ( x(nT ))
x(nT )
n0
0
h(nT ) n 0 H ( z) Z (h(nT ))
h(nT )
n0
0
Z ( x(nT ) * h(nT ))
Z { x(kT )h(nT kT )}
k
{ x(kT )h(nT kT )} z n
n 0 k
n 0
x(kT ) h(nT kT ) z
x ( kT ) 0
n<kn-k<0
n
k 1
x(kT ) h(nT kT )z
k 0
k 0
n 0
k 0
n k
n k
h(nT kT ) z n
z ( nk )
x(kT ) h(nT kT ) z n
x(kT )z
h(nT kT ) z
k 0
n k
n k 0
X ( z) H ( z)
i.e.
Example:
x (nT ) * h(nT ) Z 1 [ X ( z ) H ( z )]
1
x ( nT )
h ( nT )
1 1
4 4
u( n 3)
1 1
3 3
u( n 5)
if
n 3
n 5
x ( nT ) 0
h( nT ) 0
n 0
u ( n 3)
u( n 5)
Find x(nT)*h(nT)
Solution:
Page 8-25
x ( nT ) 0
h ( nT ) 0
Instructor: Zhang
n 0 (nu 3)
due to
n 0 (nu 5)
1
1
1
3
Z u (n) z
1
4
4
4
1 z 1
4
3
X ( z ) z 3
H (z)
1
Z
3
1
z 5 Z
3
z 5
n 5
u (n 5)
u ( n)
1
1 1
1 z
3
3
1 1
4 3
1
1 1
1
(1 z )(1 z 1 )
4
3
1
3
4
V ( z)
1
1
1
1
(1 z 1 )(1 z 1 ) 1 z 1 1 z 1
4
3
4
3
1
1
Z 1 (V ( z )) (4( ) n 3( ) n )u (n)
3
4
1
1
Z 1 ( z 8V ( z )) ( 4( ) n 8 3( ) n 8 )u (n 8)
3
4
1
1
1
1
x ( nT ) * h(nT ) ( ) 3 ( ) 5 [4( ) n 8 3( ) n 8 )]u ( n 8)
4
3
3
4
X ( z)H ( z)
z 8
4. Stable system
Consider linear shift-invariant systems only.
Definition of BIBO stable:
| y ( nT ) |
n
for all bounded x(nT).
Derivation of Criterion
y ( nT )
x (kT )h( nT
kT )
Page 8-26
Instructor: Zhang
| x(kT ) || h(nT kT ) |
M | h(nT kT ) |
| h(nT kT ) |
| h(kT ) |
Criterion:
| h( kT ) |
k 0
(causal)
y ( nT )
x (kT )h( nT
for example,
kT )
y (nT ) , N n k 0 n k n N
n 100
100 k 90
N 10
| y (100T ) ||
100
x(kT )h(100T kT ) |
k 90
100
| h(100T kT ) |
k 90
N
M | h(kT ) | stable
k 0
In general
Page 8-27
y (nT )
Instructor: Zhang
x(kT )h(nT kT )
x(kT )h(nT kT )
k n N
| h(nT kT ) |
| y (nT ) | M
k n N
N
M | h( nT ) |
k 0
Limited Terms
Example : y ( nT ) x ( kT )h( nT kT )
k 0
What about y ( nT )
stable?
x (kT )h( nT kT ) ?
k n 100
1
1 0.2 z 1 0.2 2 z 2
1
1 0 .2 z
h(0) h(1)
h(2)
| h(nT ) |
n 0
1
1 z 1 z 2
1 z 1
(1 p1 z 1 ) (1 p n z n )
| p j | 1
stable
h( nT ) 0 n 0
Due to u (n)
Page 8-28
Instructor: Zhang
Solution:
| h(nT ) | | h(nT ) |
n 0
n 0
n 0
1
6
1 1/ 3
Stable
u ( n 1),, u ( n m )
y ( n 1),..., y ( n r )
Difference
Equation
linear system
y ( nT ) L0 x( nT ) L1 x( nT T ) ... Lm x( nT mT )
k1 y (nT T ) ... k r y ( nT rT )
weights: Li , K i
Larger weight: more important in determining y(nT)
Would the weights be the same? No!
(r, m): systems order
Page 8-29
Instructor: Zhang
y ( nT ) k1 y ( nT T ) ... k r y ( nT rT )
Different Equation
L0 x( nT ) L1 x ( nT T ) ... Lm x( nT mT )
z-transform =>
Y ( z ) k1 z 1Y ( z ) ... kr z rY ( z )
L0 X ( z ) L1 z 1 X ( z ) ... Lm z m X ( z )
Y ( z ) L0 L1 z 1 ... Lm z m
H ( z)
X ( z)
1 k1 z 1 ... k r z r
z-transfer function
Y(z) = H(z)X(z)
Why H(z) is the z-transform of impulse response h(nT) ?
x(t)s spectrum
X ( )
x(nT)s spectrum
Y ( )
y(t)s spectrum
( X ( s ) L[ x ( t )])
X ( s ) s j
TX ( z) zesT TX (z) ze jT
s j
(Y ( s ) L[ y (t )])
Y ( s ) s j
y(nT)s spectrum
TY ( z) zesT TY (z) ze jT
s j
Page 8-30
Instructor: Zhang
Y ( ) TY ( z ) |z e jT
Y ( z)
X ( ) TX ( z ) |z e jT
X ( z ) z e jT
jT
Page 8-31
Instructor: Zhang
s T 2
e jT e jk 2 e jT (cos k 2 j sin k 2 ) e jT
H (e j ( k s )T ) H (e jT )
Input 1: 10 sin(5t )
T = 1 second
10
sin(
7
t
)
Input 2 :
Generate the same output amplitude?
Normalized Frequency r / s
s : frequency period s 2
j T
j 2 / s
r / s
1
T 2 / s
T
e j 2r
Amplitude Response | H ( e j 2r ) | or | H ( e jT ) |
Phase Response H ( e j 2r ) or H ( e jT )
Question: what are their physical meaning?
Example 8-15: y(nT) = x(nT) + x(nT-2T)
Y ( z ) X ( z ) z 2 X ( z )
Solution :
H ( z)
Y ( z)
1 z 2
X ( z)
H (e jT ) 1 z 2
1 e
z e jT
j 2T
(e jT e jT )e jT
2 cos T e jT
H ( e j 2r ) 2 cos 2r e j 2r
Page 8-32
Instructor: Zhang
| H (e j2r ) | 2 | cos2r |
2r
H (e )
2r
j 2r
cos2r 0
cos 2r 0
Page 8-33