applications of zapplications of z--transform...
TRANSCRIPT
Applications of zApplications of z--TransformTransform
S Wongsa
��
S Wongsa
Dept. of Control Systems and Instrumentation Engineering,
KMUTT
Summary from previous class
� �� ndzzzXnx
1)(1
][
��
� ��C
ndzzzX
jnx
1)(2
][�
residualz, iztrans
� Applications of z-Transform
• Solution of Linear Difference Equations
• Discrete-Time LTI Systems
• Characterisation of Discrete-Time LTI Systems
• Frequency Response Analysis
Today’s goal
��
Applications of z-Transform
Given the following difference equation
where y and x are the output and the input variables, respectively.
� Solution of linear difference equations
Mnxbn-xbnxb
Nnyanyanyany
M
N
][...]1[][
...][...]2[]1[][
10
21
����
���������
��
i) Taking z-transform to both sides and rearranging gives
)()(
)()(
...1
...)(
1
1
1
10 zXzA
zBzX
zaza
zbzbbzY
N
N
M
M �������
� ��
��
ii) The solution of the difference equation is
y[n] = Z-1{Y(z)}
Applications of z-Transform
� Solution of linear difference equations by MATLAB
For N � M, the output of the system described by
can be found using the MATLAB command ‘filter’.
y=filter(b,a,x,zi) .
Mnxbn-xbnxb
Nnyanyanyany
M
N
][...]1[][
...][...]2[]1[][
10
21
����
���������
��
y=filter(b,a,x,zi) .
b = [b0 b1 … bm]
a = [1 a1 a2 … an ]
x is the input vector.
zi is the initial condition vector = [zi(1) zi(2) … zi(N)] and
where
)1()(
)1(...)2()1()2(
)(...)2()1()1(
32
21
���
���������
��������
yaNzi
nyayayazi
nyayayazi
N
N
N
�
Applications of z-Transform
EXAMPLE : Zero initial conditions
]1[][]2[1.0]1[7.0][ ������� nununynyny
If u[n] is the unit step and suppose that y[n]=0, n<0, compute the output
response y[n].
���2
)()()( zUzGzY �
��
���
����
��
11.07.0)(
2
2
z
z
zz
zzzY
][))2.0(3
2)5.0(
3
5(][ nuny nn ��
2.03
2
5.03
5)(
��
��
z
z
z
zzY
Applications of z-Transform
0.5
0.6
0.7
0.8
0.9
1
y[n
]
b=[1 -1];
a=[1 -0.7 0.01];
n=0:20;
x=ones(1,length(n));
y=filter(b,a,x);
Filter command:
��
0 2 4 6 8 10 12 14 16 18 200
0.1
0.2
0.3
0.4
n
y[n
]
Analytical solution:
for ii=0:length(u)-1
y1(ii+1)=5/3*(0.5^ii)-2/3*(0.2^ii);
end
Applications of z-Transform
EXAMPLE : Non-zero initial conditions
]1[][]2[1.0]1[7.0][ ������� nununynyny
If u[n] is the unit step and suppose that y[-2]=0,y[-1]=1, compute the output
response y[n].
]1[]2[][1.0]1[7.0]2[ �������� nununynyny
• Replacing n with n+2:
��
���
��
��
���
��
2.08.0
5.05.2
1.07.0
)1.07.1()(
2z
z
z
z
zz
zzzY
• With y[0]=1.7 and y[1]=1.09,
][))2.0(8.0)5.0(5.2(][ nuny nn ��
Applications of z-Transform
b=[1 -1];
a=[1 -0.7 0.1];
n=0:20;
x=ones(1,length(n));
zi(1)=-a(2)*1;
zi(2)=-a(3);
y=filter(b,a,x,zi);
Filter command:
0.8
1
1.2
1.4
1.6
1.8
y[n
]
y=filter(b,a,x,zi);
Analytical solution:
for ii=0:length(u)-1
y1(ii+1)=2.5*(0.5^ii)-0.8*(0.2^ii);
end
0 2 4 6 8 10 12 14 16 18 200
0.2
0.4
0.6
0.8
n
Discrete-Time LTI Systems
��
h[n] is the impulse response function. The z-transform of h[n] is referred to
as the transfer function.
)(
)()(
zX
zYzH �
Difference Equation to Transfer Function
• Given a difference equation
Mnxbn-xbnxb
Nnyanyanyany
M
N
][...]1[][
...][...]2[]1[][
10
21
����
���������
����
If all initial conditions are zero, we find the transfer function to be
)(
)(
...1
...)(
1
1
1
10
zA
zB
zaza
zbzbbzH
N
N
M
M �������
� ��
��
EXAMPLE For the unit sample response
� ][])5.0(5.0[][ nunhnn ����
, find the transfer function H(z).
� ]}[)5.0(][5.0{)(1
nunuZzHnn ����� �
Solution
����
� ]}[)5.0(][5.0{)( nunuZzH �����
25.0
2
5.05.0)(
2
2
��
��
��
z
z
z
z
z
zzH
Gain, Poles & Zeros
))...()((
))...()(()(
21
21
p
z
n
n
pzpzpz
zzzzzzKzH
���
����
A transfer function can be factored into
• K is called the system gain.
• zi, i=1,…,nz is called the system zeros.
����
• zi, i=1,…,nz is called the system zeros.
• pi, i=1,…,np is called the system poles.
x
5.0)(
��
z
zzH
Characterisation of Discrete-Time LTI Systems
� Causality
• A system is causal if the output sequence value at n=n0 depends only on the
input sequence values for n� n0, for every choice of n0, i.e. the output
sequence value is only dependent on past or current inputs.
• For a causal discrete-time LTI system, we have
����
0,0][ �� nnh
Characterisation of Discrete-Time LTI Systems
� Stability
• A system is stable in the bounded-input, bounded-output (BIBO) sense if
and only if every bounded input sequence produces a bounded output
sequence.
• It can be shown that a discrete-time LTI system is BIB0 stable if its
impulse response is absolutely summable, that is,
����
impulse response is absolutely summable, that is,
����
���n
nh ][
� Stability
A discrete-time system is stable, if and only if
pi nip ,...,1for 1|| ��
• Stability condition
Characterisation of Discrete-Time LTI Systems
����
pnppp ,...,, 21where are the poles of H(z).
� Marginal Stability
A discrete-time system is marginally stable if and only if
and poles dnonrepeate allfor 1|| �ip
• Marginal Stability Condition
Characterisation of Discrete-Time LTI Systems
����
poles. repeated allfor 1|| �i
i
p
Given a first-order system with a pole at z = a,
az
zzH
��)( n
anh �][
EXAMPLE
Characterisation of Discrete-Time LTI Systems
����
0 5 100
0.2
0.4
0.6
0.8
1
n
a=1.0
X
Stable Marginally Stable Unstable
• The pulse response for various pole locations
Characterisation of Discrete-Time LTI Systems
��
Applications of z-Transform
� Relationship between ZT & DTFT
��
���
����n
njenxX ][)( �
�
���
��n
nznxzX ][)(
DTFT ZT
• In going from the DTFT to the ZT we replace by .�j
e z
��
• This evaluation is equivalent to evaluating the z-transform on the unit circle in
the complex plane.
• Also, replacing with , ZT will become DTFT.z �je
• Therefore, if unit circle is in the ROC � DTFT exists.
Applications of z-Transform
� Frequency Response Analysis
Consider a DT transfer function H(z), the discrete frequency response function
(FRF) is
��� ��� jez
jzHeHH |)()()(
����
• is the magnitude or gain of the FRF. |)(| �H
• is the phase of the FRF. )(��H
where � is the discrete frequency in rad/sample.
Applications of z-Transform
� Response to a sinusoidal input
If a DT system is stable with transfer function H(z), then in steady-state
Anx �][ )0(][ AHny �
����
nAnx 0sin][ �� ))(sin(|)(|][ 000 ������ HnHAny
nAnx 0cos][ �� ))(cos(|)(|][ 000 ������ HnHAny
Applications of z-Transform
• EXAMPLE
5.0)(
��
z
zzH
5.0)(
��� �
�
j
j
e
eH
����
5.0��je
�������
��sin)5.0(cos
sincos)(
j
jH
Applications of z-Transform
• EXAMPLE
�������
��sin)5.0(cos
sincos)(
j
jH
• If a sinusoidal input is appliednnx3
sin][�
�
1.1547,|)3/(| ��H �30)3/( ��� �H
����
)303
1.1547sin(][ ��� nny�
6 8 10 12 14 16 18 20 22 24-1.5
-1
-0.5
0
0.5
1
1.5
n
u[n]
y[n]
Applications of z-Transform
� Bode plot
A Bode plot in the discrete time is a graph of |H(�)| and �H(�) plotted
as a function of �, where � is usually ranging from 0 to �.
�������
��sin)5.0(cos
sincos)(
j
jH
5.0)(
��
z
zzH
num = 1; % numerator
den = [1 -0.5]; % denominator
freqz(num,den); % DT frequency response
����
���� sin)5.0(cos j
0 0.2 0.4 0.6 0.8 1-30
-20
-10
0
Normalized Frequency (�� rad/sample)
Phase (
degre
es)
0 0.2 0.4 0.6 0.8 1-5
0
5
10
Normalized Frequency (�� rad/sample)
Magnitude (
dB
)
freqz(num,den); % DT frequency response
Summary
����