Z Transform
Z Transform
SPRING 2008
3 .1
Difference Equations
In digital control, we are concerned with the generation of a sequence of control inputs u(k) given a sampled sequence of the system output y(k). In general, we would like to determine the control effort at sample instance k base on the sampled system output at sample instance k and a finite number of previous sampled outputs and control efforts. Mathematically this can be written as u( k ) = f y ( k ), y ( k 1), y ( k 2 ),L, y ( k m), u( k 1), u( k 2),L, u( k n ) . There are an infinite number of ways the n+m1 values on the right-hand side of the above equation can be combined to form u(k). In this course, we shall only focus on the cases where the right hand side of the above equation involves a linear combination of the past samples of the measurements and controls, i.e.
u( k ) = am y ( k ) + am1 y ( k 1) + am 2 y ( k 2) + L + a0 y ( k m) + bn 1 u( k 1) + bn 2 u( k 2 ) + L + b0 u( k n )
(3.1)
Equation (3.1) is a linear difference equation. If the coefficients ai and bj are constants (independent of sample instance k), it is a constant coefficient difference equation. Example 3.1 Numerical Analysis and Difference Equation In numerical analysis, there are many methods to approximate the integral of a function
x ( t ) = y ( ) d
0
Z-TRANSFORM
SPRING 2008
The backward rectangular rule is one of the simplest. It uses a rectangular approximation to approximate the area under the function y(t), as shown in Figure 3.1.
y ( k) y(2) y(3)
Figure 3.1 Approximate Numerical Integration Let x(k) be the value of the integral at sample instance k, while x(k1) is the value of the integral at the previous sample instance. Then, x(k) can be calculated using
x ( k ) = x ( k 1) + T y ( k 1)
(3.2)
The above equation provided an algorithm to successively approximate the integral of the function y(t). This algorithm takes the form of a constant coefficient difference equation.
Example 3.2 Solving Difference Equation Solving a constant coefficient difference equation often involve tedious algebraic manipulations. To find the solution for Eq. (3.2), i.e. find an expression for solving x(k) given current and previous values of y(k), first write out Eq. (3.2) for k = 1, 2, ...
x ( k ) = x ( k 1) + T y ( k 1) x ( k 1) = x ( k 2) + T y ( k 2) x ( k 2) = x ( k 3) + T y ( k 3) M x ( 2) = x (1) + T y (1) x (1) = x ( 0) + T y ( 0) Adding the above k equations and noting that many x(k)s can be cancelled, we can obtain x( k ) = x( 0) + T y( j )
j =0 k 1
(3.3)
Equation (3.3) represented the solution to the difference equation (3.2). The solution for a constant coefficient difference equation requires the initial value of the solution as well as all the past values of the input, in this case, y(k). Not all constant coefficient difference equations can be solved using the manipulation illustrated in Example 3.2. A more general, systematic approach is needed.
Z-TRANSFORM
SPRING 2008
3 .2
The z-Transform
The Laplace transform is used as an analysis tools for continuous-time linear time invariant systems. The reasons are two folds, (1) the input/output relationship for continuous-time systems, a convolution operation in the time domain, is simplified to an algebraic relationship in the sdomain, (2) the Laplace transform relates the time domain and frequency domain characteristic of the system. The discrete-time analogy of the Laplace transform is the z-transform, which transforms a discrete sequence of time domain signal into a function of the z-transform variable z.
DEFINITION z-Transform The z-transform of a sampled sequence x(kT) or x(k), where k represents non-negative integers and T is the sampling period, is defined by
(3.4)
where the complex variable z must be selected so that the summation converges. This z-transform is called the one-sided z-transform. The symbol Z[] denotes "the ztransform of." In the one-sided z-transform, we assume x*(t) = 0 for t < 0 or x(kT) = x(k) = 0 for k<0. For most engineering applications, the one-sided z-transform will have a convenient closed form representation in its region of convergence. From Eq. (3.3), X(z) is an infinite series of z 1 that converges outside the circle z = R , where R is called the radius of convergence. The following examples illustrates how to calculate the z-transform of several common functions directly from the definition:
Example 3.3 Unit Step Function (Sequence) Consider the unit step function defined by
u( k ) =
1 R S T0
k0 k<0
R a S T0
k0 k<0
1 1 a 1 z
z za
for z > a
SPRING 2008
Re x( k ) = S T0
akT
k0 k<0
1 1 e aT z
z z e aT
for z > e aT
x( k ) =
sin( kT ) R S T0
k0 k<0 e j kT e j kT k z 2j k =0
e jT e jT z 1 1 1 1 1 = = 2 j 1 e jT z 1 1 e jT z 1 2 j 1 e jT + e jT z 1 + z 2
Notice that the expansion of the right hand side of Eq. (3.4) gives X ( z ) = x ( 0) + x (T ) z 1 + x ( 2T ) z 2 + L + x ( kT ) z k + L The above equation implies that the z-transform of any discrete sequence can be written in the infinite series form by inspection. The z k in this series indicates the position in time at which the amplitude x(kT) occurs. Conversely, if X(z) is given in the series form as above, the inverse ztransform can be obtained by inspection as a sequence of values x(kT) that correspond to the values of x(t) at the sampling instances. Just as in working with Laplace transformation, we will make extensive use of a table of ztransforms for commonly encountered function, rather than calculating the z-transform from definition.
f ( t ), t 0
1
F ( s)
f ( kT ), k 0
1, k = 0 R S T0, k 0 1, k = n R S T0, k n
F( z )
1 zn
1 s
z z 1
Z-TRANSFORM
SPRING 2008
1 s2
kT
b z 1g
2
Tz
1 2 t 2 e at te
at
1 s3 1 s+a 1 ( s + a )2
1 kT 2
b g
T 2 z ( z + 1) 2( z 1)3
e akT
z z e aT
Te aT z ( z e aT )2
(1 e aT ) z ( z 1)( z e aT ) ( e aT e bT ) z ( z e aT )( z e bT )
b g
kT e akT
1 e at
at
a s( s + a ) ba ( s + a )( s + b) e
1 e akT
akT
bt
bkT
sin t
b g b g b g
s +2
2
sin kT
b g
sin(T ) z z 2 cos(T ) z + 1
2
cos t
b g
s 2 s +2
cos kT
b g
b g b g
e at sin t
( s + a )2 + 2
s+a ( s + a )2 + 2
e akT sin kT
e at cos t
e akT cos kT ak k a k 1
z za z ( z a )2
As shown from Example 3.3 to Example 3.6, the z-transform of a signal often takes the form of a rational function of z
X (z) = b0 z m + b1 z m1 + L + bm b0 ( z z1 )( z z2 ) L ( z z m ) = z n + a1z n 1 + L + an ( z p1 )( z p2 ) L ( z pn )
(3.5)
where the pi's are the poles of X(z) and the zi's are the zeros of X(z). The location of the poles and zeros of X(z) determines the characteristics of x(k), a sequence of values or numbers. As in the case of the s plane analysis of continuous-time signals, we often use a graphical representation on the z plane of the location of the poles and zeros of X(z).
George T.-C Chiu and H. Peng, T-C. Tsao
Z-TRANSFORM
SPRING 2008
Note in signal processing and control engineering, X(z) is often represented as a ratio of polynomials in z 1
X ( z ) = X ( z 1 ) = b0 z ( n m ) + b1 z ( n m+1) + L + bm z n 1 + a1 z 1 + a2 z 2 + L + an z n
(3.6)
Both Eqs. (3.5) and (3.6) are valid representations of the same function in the z domain. However, in determining the poles and zeros of X(z), it is more convenient to express X(z) as a ratio of polynomials in z. For example
X (z) = z z + 0.5 z 2 + 0.5z = 2 z + 3z + 2 z +1 z + 2
b gb g c c hc h h
Clearly, X(z) has poles at z = 1 and z = 2 and zeros at z = 0 and z = 0.5. If X(z) is written as a ration of polynomials in z 1, the proceeding X(z) can be written as
X ( z ) = X ( z 1 ) =
1 + 0.5z 1 1 + 0.5z 1 = 1 + 3 z 1 + 2 z 2 1 + z 1 1 + 2 z 1
From the above representation, although the poles at z = 1 and z = 2 and the zero z = 0.5 are clearly seen, the zero at z = 0 is not explicitly shown, and will often be overlooked. Therefore, when determining the poles and zeros of z-transforms, it is preferable to express the z-transform as ratios of polynomials in z, rather than in z 1.
Frequency Response
(3.7)
In other words, the z-transform of a time sequence and the Laplace transform of the sampled signal are the same. This is not surprising since both transformations concerns with the signal values at the sample instances. Another implication of the similarity is that for continuous-time systems the frequency response of a system can be analyzed by substituting s with j in the Laplace transform. Similarly, to study the frequency response of a discrete-time system, we can substitute z = e jT in the z-transform, i.e. X ( e jT ) = x ( kT ) e jT
k =0
c h
A more formal derivation of the frequency response of discrete-time systems will be discussed in later sections.
Important Properties of the z-Transform 1. Linearity
George T.-C Chiu and H. Peng, T-C. Tsao
Z-TRANSFORM
SPRING 2008
and that
Z [ a x( k ) + b y ( k ) ] = a Z [ x( k ) ] + b Z [ y ( k ) ] = a X ( z ) + b Y ( z )
where X(z) and Y(z) are the z-transform of x(k) and y(k), respectively.
Proof: The proof of the property can be easily done by applying the definition of the z-transform. 2. Time Shift If x(k) = 0 for k < 0 and x(k) has the z-transform X(z), then
Z [ x(k d ) ] = z d X ( z )
and
d 1 d Z [ x( k + d ) ] = z d X ( z ) x( j ) z j = z d X ( z ) x( d i ) z i j =0 i =1 d d d 1 d 2 = z X ( z ) z x(0) z x(1) z x(2) L z x(d 1)
k =0
j = d
x( j ) z d j = z d x( j ) z j
j = d
= z d x( j ) z j = z d Z [ x( j ) ]
j =0
= z d X ( z)
The time shift theorem implies that a delay of one sample period in the time domain (a one step delay operator q 1 operating on the sample sequence x(k), q 1x(k) = x(k 1)) is equivalent to multiplying z 1 in the z domain, i.e.
George T.-C Chiu and H. Peng, T-C. Tsao
Z-TRANSFORM
SPRING 2008
Z [ x(k 1) ] = z 1 X ( z ) Similarly,
Z [ x(k + 1) ] = z X ( z ) z x(0) = z [ X ( z ) x(0) ]
3. Initial Value Theorem (IVT) If the z-transform of x(k) is X(z) and if lim X ( z ) exists, then the initial value of x(k) (i.e., x(0) )
z
is x ( 0) = lim X ( z )
z
Proof: The proof is obvious by examine the definition of the z-transform. 4. Final Value Theorem (FVT) If the z-transform of x(k) is X(z) and if lim x ( k ) exists, then the value of x(k) as k is given
k
by
x( ) = lim x( k ) = lim ( z 1) X ( z )
k z 1
= lim x ( k + 1) x ( k ) z k = x ( k + 1) x ( k )
z 1 k =0 k =0
= lim x ( k ) x (0)
k
Hence
x ( ) = lim x ( k ) = lim ( z 1) X ( z )
k z 1
5. Convolution Discrete convolution in the time domain is equivalent to multiplication in the z domain. Let the operand be the convolution operator, i.e.
g ( k ) u( k ) = g ( k j ) u( j ) = g ( j ) u( k j )
j =0 j =0
then
Z [ g (k ) u (k )] = G ( z ) U ( z )
where G(z) and U(z) are the z-transform of g(k) and u(k), respectively.
Proof:
George T.-C Chiu and H. Peng, T-C. Tsao
Z-TRANSFORM
SPRING 2008
k k Z [ g (k ) u (k ) ] = Z g (k j ) u ( j ) = g (k j ) u ( j ) z k j =0 k =0 j =0
= g (k j ) z k u ( j ) = g (i ) z i j u ( j ) k = j j =0 j =0 i =0
= g (i ) z i u ( j ) z j i =0 i =0 = G ( z ) U ( z )
k k=j k k=j
Figure 3.2 Chanege of Summation in Covolutions Figure 3.2 shows the graphical interpretation of the interchanging of summation in the proof.
3 .3
Inverse z-Transform
Given a z-transform function X(z), the corresponding time domain sequence x(k) can be obtained using the inverse z-transform. The inverse z-transform is defined to be x(k ) = Z 1 [ X ( z ) ] = 1 2j
C X ( z) z
k 1
dz
(3.8) The
where the contour integration can be evaluated using the Cauchy Residue Theorem. integration contour in Eq. (3.8) should enclose all the singularities of X(z).
Example 3.7 Inverse z-Transform Using the Cauchy Residue Theorem Find the inverse z-transform of the following function:
X ( z) =
z ( z 1)( z 2)
Solution: The function has poles at z = 1 and z = 2. The inverse z-transform, using Eq. (3.8), is
x(k ) =
1 2j
z z k 1 dz C ( z 1)( z 2)
where C is a contour that contains all finite poles of the function X ( z ) z k 1 . The Cauchy Residue Theorem from complex variable theory states that
Z-TRANSFORM
SPRING 2008
x(k ) = =
( ( z p ) X ( z) z
i
k 1 z = pi
z z ) = z 1
k 1 z =2
z z k 1 z2 z =1
= 2 1 Similar to the inverse Laplace transformation, there are several other methods to calculate the inverse z-transform. Generally, the z-transform of interest in linear discrete-time control applications can be represented as ratios of polynomials in the complex variable z with the numerator polynomial being of no higher order than the denominator polynomial. The long division and the partial fraction expansion are two methods that are especially suited in calculating the inverse z-transform of rational functions of z.
Direct Long Division Method
From the definition of the z-transform, Eq. (3.4), if we can represent the z-transform function X(z) as an infinite series in z 1 that fits Eq. (3.4), then the coefficients of the series will give the time domain sequence of x(k). Given a rational function of the complex variable z, long division can be used to decompose the rational function into infinite series of z 1.
Example 3.8 Inverse z-Transform Using Long Division Find the inverse z-transform sequence of the following function:
X ( z) =
z2 + z z 2 3z + 4
Solution: Represent the z-transform function X(z) in terms of z 1 by dividing z2 from both the numerator and the denominator
X ( z) =
z2 + z 1 + z 1 = z 2 3z + 4 1 3z 1 + 4 z 2
1 + 4 z 1 + 8 z 2 + 8 z 3 1 + z 1 1 3z 1 + 4 z 2 4 z 1 4 z 2 4 z 1 12 z 2 + 16z 3 8z 2 16z 3 8z 2 24 z 3 + 32 z 4 8z 3 32 z 4 M
10
SPRING 2008
The long division procedure used in the previous example can be carried out to any desired number of steps. The disadvantage of this technique is that it does not give a closed form representation of the resulting sequence. In many applications, we need to obtain a closed-form result to infer general qualitative insights into the sequence x(k). For most engineering investigation, the method of partial fraction expansion and a good z-transform table is often sufficient to generate the desired closed form solution.
Partial Fraction Expansion
The procedure of using partial fraction expansion to calculate the inverse z-transform is identical to the one used in solving the inverse Laplace transform.
Distinct Real Poles Assuming the z domain rational function can be written as
X (z) =
N(z) ( z p1 )( z p2 )L( z pn )
(3.9)
where the pi are distinct real numbers. Examining the z-transform table (Table 3.1), we see that the form of the inverse z-transform should be X (z) = N(z) z z z = A0 + A1 + A2 + L + An ( z p1 )( z p2 ) L( z pn ) z p1 z p2 z pn (3.10)
where the constant term A0 is added to ensure equality in the case where there is a constant term in the numerator of Eq. (3.9). The coefficients of Eq. (3.10) can be calculated by the following formula: Ai = z pi X (z) , i = 1, 2, 3, L z z = pi (3.11)
The coefficient A0 can be found by evaluating X(z) at z = 0. Consequently, the inverse z-transform of X(z) is x(k ) = Z 1 [ X ( z ) ] = A0 0 (k ) + A1 ( p1 ) k + A2 ( p2 ) k + L + An ( pn ) k
Example 3.9 Solving Inverse z-Transform Using Partial Fraction Expansion Find the time sequence that corresponds to the following z-transform:
X (z) = 0.5(1 e T )2 ( z 2 + e T z ) ( z 1)( z e T )( z e2T )
Solution: The denominator of the z-transform is already in the factored form. Following Eq. (3.10), we can write
X (z) = z z z 0.5(1 e T )2 ( z 2 + e T z ) = A1 + A2 + A3 T 2 T T ( z 1)( z e )( z e ) z 1 ze z e 2 T
In the above equation, since there is no constant term in the numerator, the constant coefficient A0 is not needed. Using Eq. (3.11), we can solve for the coefficients:
Z-TRANSFORM
11
SPRING 2008
A1 =
( )
+ 0.5 e2T
Distinct Complex Poles For complex poles, one approach is to factor them as complex numbers and use the previous steps to obtain the complex coefficients in the partial fraction expansion, then combine the terms using Eulers identity to yield exponentially multiplied sinusoidal sequences. However, we can simplify the procedure by doing more work ahead of time.
e aT sin(T ) z z 2 2e aT cos(T ) z + e 2 aT
The poles of the both z-transforms can be represented by the following polar form
p1,2 = e aT cos T j sin T = e aT e jT = R e j
b g
2
b g
(3.12)
where R = e aT and = cos T . By examining the z-transform table and using the variables defined in Eq. (3.12), the partial fraction expansion of the z-transform represented in Eq. (3.13) should be N ( z) ( z 2 R z ) R sin(T ) z X ( z) = =A 2 +B 2 + Q( z ) 2 2 2 D( z )( z 2 R z + R ) z 2 R z + R z 2 R z + R 2 The corresponding inverse z-transform of Eq, (3.14) is ( z 2 R z) R sin(T ) z x ( k ) = Z 1 [ X ( z ) ] = A Z 1 2 + B Z 1 2 + Z 1 [ Q ( z ) ] 2 2 z 2R z + R z 2R z + R = A R k cos(kT ) + B R k sin(kT ) + Z 1 [Q( z ) ] (3.14)
b g
Z-TRANSFORM
12
SPRING 2008
A good rule of thumb of finding the coefficients of the partial fraction expansion of Eq. (3.14) is to first find the coefficients related to Q(z) using similar approach as in the case of the distinct real poles and then evaluate A and B by brute force (equate numerators and compare coefficients).
Example 3.10 Solving Inverse z-Transform Using Partial Fraction Expansion Find the inverse z-transform of the following function
X ( z) = z2 + z ( z 2 113 . z + 0.64)( z 0.5)
First, we need to identify the parameters R, , and T. By inspection R = 0.64 = 0.8 and = Since = cos T , then 113 . 113 . = = 0.7063 2 R 16 .
b g
sin(T ) = 0.7079
Substitute the numbers into Eq. (3.15), we get X ( z) = A ( z 2 0.565 z ) z 0.5663z +B 2 +C 2 z 113 . z + 0.64 z 113 . z + 0.64 z 0.5 (3.16)
Now if we combine the terms on the left hand side of Eq. (3.16) and compare the numerator polynomial with that of Eq. (3.15) we see that . z + 0.64) z 2 + z = A ( z 2 0.565z )( z 0.5) + B 0.5663z ( z 0.5) + 4.6154 z ( z 2 113 Equating the coefficients corresponding to the powers of z, and solving for A and B, we get
A = 4.6154
and
B = 2.2956
3 .4
If the numerical values of the coefficients and parameters are given, difference equations can be easily solved using a computer. However, closed-form expressions of the solution cannot be
George T.-C Chiu and H. Peng, T-C. Tsao
Z-TRANSFORM
13
SPRING 2008
obtained from the computer (numerical) solution, except for very special cases. The z-transform provided an effective procedure to obtain the closed-form expression for the solution of a difference equation. The time shift property of the z-transform,
Z [ x(k d )] = z d X ( z ) Z [ x(k + d )] = z d X ( z ) z d x(0) z d 1 x(1) z d 2 x(2) L z x(d 1) will be used extensively in solving linear difference equations. The process of solving difference equation using z-transform is very similar to that of using the Laplace transform to solve linear ODEs.
Example 3.11 Solving Difference Equation Using the z-Transform Find the solution to the following difference equation by using the z-transform and by using a program written in MATLAB:
x ( k + 2) + 3x ( k + 1) + 2 x ( k ) = 0, x (0) = 0, x (1) = 1
Solution: 1. z-transform approach Take the z-transform of both side of the equation, we get
z 2 X ( z ) z 2 x (0) z x (1) + 3z X ( z ) 3z x (0) + 2 X ( z ) = 0 Substituting in the initial conditions and simplifying gives X ( z) = z z z z = = z + 3z + 2 ( z + 1)( z + 2) z + 1 z + 2
2
Take the inverse z-transform of the above equation we get z z k k x ( k ) = Z 1 [ X ( z ) ] = Z 1 Z 1 = (1) (2) , k = 0, 1, 2, ... ( 1) ( 2) z z 2. MATLAB program The following MATLAB program will calculate the solution x(k):
% Set up output vectors: x=zeros(1:10,1); % Assign initial values: x(1,1) = 0; % x(0) = 0 x(2,1) = 1; % x(1) = 1 % Calculate the output values: for k=1:8, x(k+2,1) = -3*x(k+1,1) - 2*x(k,1); end % Calculated the closed-form solution: k=(0:9)'; X=(-1).^k-(-2).^k; plot(k,x,'x',k,X,'h');
14
SPRING 2008
Example 3.12 Solving Difference Equation Using the z-Transform Using the z-transform to solve the following difference equation
x ( k + 2) + 0.4 x ( k + 1) 0.32 x ( k ) = u( k ) where x(0) = 0 and x(1) = 1. The input u(k) is a unit step input, i.e. u(k) = 1, for k 0.
Solution: Take the z-transform of the difference equation we get
z 2 X ( z ) z 2 x (0) z x (1) + 0.4 z X ( z ) 0.4 z x (0) 0.32 X ( z ) = Substituting the initial conditions and simplifying, we obtain
X ( z) = z2 z2 = ( z 1)( z 2 + 0.4 z 0.32) ( z 1)( z + 0.8)( z 0.4)
z z 1
The partial fraction expansion of the solution X(z) is X ( z ) = 0.926 z z z 0.3704 0.5556 z 1 z + 0.8 z 0.4
The corresponding time sequence can be obtained by taking the inverse z-transform of the above equation: x ( k ) = 0.926 0.3704 ( 0.8) k 0.5556 (0.4)k , for k = 0, 1, 2, Note x(k) will exhibit oscillatory response caused by the (-0.8)k component.
3 .5
The transfer function for the continuous-time system relates the Laplace transform of the continuous-time output to that of the continuous-time input. For discrete-time systems, the pulse transfer function relates the z-transform of the output at the sample instance to that of the sampled input. Consider a linear time-invariant discrete-time system characterized by the following linear difference equation:
y ( k ) + a1 y ( k 1) + a2 y ( k 2 ) + L + an y ( k n ) = b0u( k ) + b1u( k 1) + b2u( k 2 ) + L + bn u( k n )
(3.17)
where u(k) and y(k) are the system input and output, respectively, at the kth sample instances. If we take the z-transform of the Eq. (3.17), by using the time shift property of the z-transform, we obtain
Y ( z ) + a1z 1Y ( z ) + a2 z 2Y ( z ) + L + an z nY ( z ) = b0U ( z ) + b1 z 1U ( z ) + b2 z 2U ( z ) + L + bn z nU ( z )
or
c1 + a z
1
+ a2 z 2 + L + an z n Y ( z ) = b0 + b1 z 1 + b2 z 2 + L + bn z n U ( z )
15
SPRING 2008
(3.18)
(3.19)
Consider the response of the linear discrete-time system described by Eq. (3.19), initially at rest (y(k) = 0, k < 0), when the input u(k) is the Kronecker delta function 0(k), i.e. 1 for k = 0 u(k ) = 0 (k ) = 0 for k 0 Since
U ( z ) = Z [u (k ) ] = Z [ 0 (k ) ] = 1
Thus, G(z) is the z-transform of the response of the system to the Kronecker delta function input. The function G(z) is called the pulse transfer function of the discrete-time system. In the above derivation, the role of the Kronecker delta function in discrete-time system is similar to that of the unit impulse function (the Dirac delta function) in continuous-time systems. The inverse transform of G(z) as given by Eq. (3.21)
b + b z 1 + b2 z 2 + L + bn z n g ( k ) = Z 1 [ G ( z ) ] = Z 1 0 1 1 2 n 1 + a1 z + a2 z + L + an z
(3.21)
is called the impulse response function (sequence). Remark: The system described by the difference equation
y ( k + n ) + a1 y ( k + n 1) + a2 y ( k + n 2 ) + L + an y ( k ) = b0u( k + n ) + b1u( k + n 1) + b2u( k + n 2 ) + L + bn u( k )
where the system is initially at rest (y(k) = 0, k < 0) and the input u(k) = 0, for k < 0, can be represented by the same pulse transfer function G(z), Eq. (3.19), as the system described by Eq. (3.17).
Example 3.13 Pulse Transfer Function Consider the difference equation
y ( k + 2) + a1 y ( k + 1) + a2 y ( k ) = b0u( k + 2) + b1u( k + 1) + b2u( k ) Assuming that the system is initially at rest and u(k) = 0 for k < 0, find the pulse transfer function.
Solution: The z-transform of the difference equation is
Z-TRANSFORM
16
SPRING 2008
cz
Hence
Y( z) =
(3.22)
To determine the initial conditions y(0) and y(1), we substitute k = 2 into the original difference equation and obtain y ( 0) + a1 y ( 1) + a2 y ( 2) = b0u( 0) + b1u( 1) + b2u( 2) , which implies y ( 0) = b0 u( 0) By substitute k = 1 into the original difference equation and obtain y (1) + a1 y ( 0) + a2 y ( 1) = b0u(1) + b1u( 0) + b2u( 1) , which implies y (1) = a1 y ( 0) + b0u(1) + b1u( 0) By substituting Eqs. (3.23) and (3.24) into Eq. (3.22), we get b0 z 2 + b1 z + b2 Y( z) = 2 U ( z ) z + a1 z + a2 (3.25) (3.24) (3.23)
Hence, if both y(k) and u(k) are zero for k < 0, then the systems input and output are related by Eq. (3.25). The pulse transfer function G(z) = Y(z) / U(z) can be written as Y ( z ) b0 z 2 + b1z + b2 b0 + b1 z 1 + b2 z 2 G( z ) = = 2 = . U(z) z + a1z + a2 1 + a1z 1 + a2 z 2 (3.26)
Note that Eq. (3.26) is the same transfer function for the system described by the difference equation y ( k ) + a1 y ( k 1) + a2 y ( k 2) = b0u( k ) + b1u( k 1) + b2u( k 2) .
Example 3.14 Impulse Response Function Assuming that the system is initially at rest, find the impulse response of the following discretetime system:
y ( k + 3) = 2u( k + 3) u( k + 2) + 4u( k + 1) + u( k )
Solution: From the previous example, we see that the pulse transfer function of the system ca be written as
George T.-C Chiu and H. Peng, T-C. Tsao
Z-TRANSFORM
17
SPRING 2008
2z3 z 2 + 4z + 1 G( z ) = = 2 z 1 + 4 z 2 + z 3 3 z The impulse response of the system with zero initial condition is then the inverse z-transform of the pulse transfer function,
1 2 3 g ( k ) = Z 1 [ G ( z ) ] = Z 1 2 z + 4 z + z = 2 0 (k ) 0 (k 1) + 4 0 (k 2) + 0 (k 3)
Example 3.14 illustrated that the impulse response of a system with all of its poles at the origin will have finite non-zero terms. Impulse response of this type is often called finite impulse response and the system (digital filter) that has all its poles at the origin is called a finite impulse response (FIR) filter.
Discrete-Time Convolution and Impulse Response Function
Given a linear discrete-time system described by its impulse transfer function Y ( z) G( z) = = Z [ g (k )] U ( z) where g(k) is the impulse response of the system. We would like to find the system response to some arbitrary input sequence u(k). The arbitrary input u(k) can be represented by a sequence of weighted discrete impulses: u( k ) = u( 0) 0 ( k ) + u(1) 0 ( k 1) + u( 2) 0 ( k 2) + L = u( j ) 0 ( k j )
j =0
The system's response due to the first impulse is u( 0) g( k ) and due to the second impulse to be u(1) g( k 1) . Hence the system response at some time k can be represented as
y ( k ) = u( 0) g( 0) + u(1) g( k 1) + u( 2) g( k 2) + L + u( k ) g( 0)
This can be written as
y ( k ) = g ( k j ) u( j ) = g ( k ) u( k ) for k = 0, 1, 2, 3, ...
j =0 k
(3.27)
(3.28)
Eqs. (3.27) and (3.28) represent discrete-time convolutions. By using the z-transform convolution property discussed in section 3.2, the response of the system G(z) to the arbitrary input u(k) can be calculated in the z domain as y (k ) = Z 1 [Y ( z ) ] = Z 1 [G ( z ) U ( z )] or equivalently by either expressions of Eqs. (3.27) and (3.28). In summary, the response of a discrete-time system to any arbitrary input can be calculated by the convolution of the system's impulse response function and the input sequence.
George T.-C Chiu and H. Peng, T-C. Tsao
Z-TRANSFORM
18
SPRING 2008
3 .6
In order for systems to possess a steady-state response to a sinusoidal input, in must be stable (all the poles of the transfer function must lie within the unit circle of the complex z plane). Let the system of interest be defined by G( z ) = Y( z) N(z) = U ( z ) ( z p1 )( z p2 )L( z pn ) (3.29)
where pi are the complex poles of the system. We further assume that the system is stable, i.e. pi < 1 for all i. Let the input to the system be a cosine sequence of radian frequency , i.e. u( k ) = A cos kT = A b g 2 ce
j kT
+ e j kT
h
(3.30)
FG H
IJ K
Substituting the input, Eq. (3.30), into Eq. (3.29), the output Y(z) is given by
Y ( z ) = G( z ) U ( z ) = N(z) A z z + j T ( z p1 )( z p2 )L( z pn ) 2 z e z e jT
FG H
IJ K
(3.31)
(3.32)
Each term in the summation on the right hand side of Eq. (3.32) yields a time domain sequence of the form Di (pi) k, which if pi < 1 will vanish when k gets larger and hence does not contribute to the steady-state response. The coefficients B and C in Eq. (3.32) can be evaluated by the following formula
B= z e jT Y( z) z z = e j T and C = z e jT Y( z) z z = e jT
Substituting Y(z) expressed by Eq. (3.31) into the above formula, we get
B= z e jT A z e jT A Y( z) = 1+ G( z ) = G e jT j T z 2 ze 2 z = e j T z = e j T
LM N
z e jT A z e jT A = G e jT C= Y( z) = + 1 G( z ) jT z 2 ze 2 z = e jT z = e jT
LM N
OP Q
c h c h
OP Q
Thus, the steady-state response of the system YSS(z) under a cosine sequence input may be written as YSS ( z ) = A z z G e jT + G e jT jT ze z e jT 2
LM c h N
OP Q
(3.33)
Z-TRANSFORM
19
SPRING 2008
Since G(z) is a rational function of the complex variable z, G(e jT) is a complex number that can be written in polar forma as
G e jT = G e jT e
c h c h
c h c
jG e jT
j = G e jT e j
c h
(3.34)
where is the phase angle of the complex number G(e jT). With similar reasoning, G(e jT) will have the same magnitude and conjugate phase angle as G(e jT), i.e.
G e jT = G e jT e
jG e jT
j = G e jT e j
c h
(3.35)
Substituting Eqs. (3.34) and (3.35) into Eq. (3.33), the steady-state response can be written as YSS ( z ) = A z z G e j T e j + e j jT ze z e jT 2
c h LMN
OP Q
Taking inverse z-transform of the above equation, we can obtain the time sequence of the steadystate sinusoidal response to be y( k ) = A G e jT e j e jT 2
c h
c h + e ce h
k
j
jT k
= A G e j T
eb c h1 e 2
j kT +
g + e j b kT + g
j
(3.36)
Using the Euler identity, the above equation can be further simplified and the steady-state sinusoidal response is y ( k ) = A G e jT cos kT + , where = G e jT .
c h b
c h
From Eq. (3.36) we see that, similar to the continuous-time case, the steady-state response of the system G(z) to a sinusoidal input is still sinusoidal with the same frequency but scaled in amplitude and shifted in phase. The amplitude of the steady-state response is scaled by a factor of G e jT ,
c h
which will be referred to as the system gain associated with G(z) at frequency . The complex function of , G(e jT), is called the frequency response function of the system G(z). The frequency response function of a system can be obtained by replacing the z-transform complex variable z with e jT, i.e. G e jT = G ( z ) z =e jT = G cos T + j sin T . As in the continuous-time case, we are usually interested in the magnitude and phase characteristics of this function as a function of frequency. It is interesting to note that the DC gain of the system corresponds to the magnitude of the frequency response function at = 0,
DC Gain = G e jT
c h
c b g
bg
b gh
c h
=0
=G z
z =1
=G1
bg
(3.37)
This is slightly different from the continuous-time case where the DC gain is evaluated by substituting the Laplace variable s by 0.
Periodicity of Discrete-Time Frequency Response Function Since both cos T and sin T are periodic (for fixed sample period T), the frequency response function G(e jT) is also periodic in frequency and will repeat itself every sample frequency S = 2 T rad/sec. Since ejT is the complex conjugate of e jT, we can write for negative frequencies
b g
b g
Z-TRANSFORM
20
SPRING 2008
G e jT = G e jT
c h
and G e jT = G e jT .
c h
The above equation along with the periodic condition for G(e jT) indicates that the magnitude part of the frequency response function will be "folded" about the Nyquist frequency N = S 2 ,
G ( e jT ) = G e
j ( S )T
) = G (e (
j S )T
G ( e jT ) = G e
j ( S )T
) = G ( e (
j S )T
).
Example 3.15 Frequency Response of Discrete-Time Systems Find the frequency response for the discrete-time system described by the following difference equation:
y ( k ) = e 2T y ( k 1) + u( k ), where T =
Solution: The impulse transfer function of the system can be found by taking the z-transform of the difference equation and assuming zero initial conditions
21
SPRING 2008
Magnitude
10
20
30
40
50
10
20 30 Frequency (rad/sec)
40
50
Z-TRANSFORM
22