1 VI. Z Transform Ch 24 Use: Analysis of systems, simple convolution, shorthand for e jw, stability. A. Definition: X(z) = x(n) z z - transforms Motivation easier to write Or Note if X(z) = Z {x(n)} z = e +jw, X(z) = x(n) e -jwn = F { x(n) } Can think of z as shorthand symbol for e +jw. Remember that z can equal r e +jw where r is any real number.
2 B. Convergence of z transform. Can converge even if Fourier transform doesn t. Convergence related to stability (absolute summability) Ex F{u(n)} = u(n) e -jwn is useless not absolutely summable, u(n) e -jwn = 1 = But if r >1 z transform u(n) (re +jw ) -n r -n = 1 ( 1- (1/r) )
3 1/r < 1 so converges For z = r > 1 Region of convergence (R.O.C.) drawn below. (1) Rational Functions in z common (usually closed form for transform of infinite length sequence)
4 Z( a n u(n) ) = a n u (n) z -n = 1 1- az -1 = z z - a if az -1 < 1 a < z Rational function poles and zeroes:
5 b(n) z -n B(z) H(z) = = = a(n) z -n A(z) K (1-z 1 z -1 ) (1-z 2 z -1 ) (1-z 3 z -1 ).. (1-z M z -1 ) (1-p 1 z -1 ) (1-p 2 z -1 ).. (1-p N z -1 ) = K Π (1-z i z -1 ) Π (1-p i z -1 ) H(z i ) = 0 for zeroes z i H(p i ) = for poles p i Theorem: If h(n) is real, the finite poles and zeroes of H(z) must be real or come in complex conjugate pairs. Partial Proof: (1) Note that: b( n ) = K n i= 1 z k ( i, n, j) where k(i,n,j) = index of the ith root in the jth term of b(n)
(2) h(n) real means b(n) and a(n) are real (3) Considering b(n), b(0) = K, so K is real (4) b(1) = -K( z 1 +z 2 + z 3 +.. z M ) = real so the imaginary parts of the zeroes sum to 0. One way this can happen is when complex roots come in conjugate pairs, and the other roots, if any, are real. (5) b(m) = ±K( z 1 z 2 z 3.. z M ) = real. One way this can happen is when complex roots come in conjugate pairs, and the other roots, if any, are real. 6
7 (2) Finite length sequences X(z) = x(n) z -n Will converge in some region if x(n) < Case1 n 1 = n 2 = 0 x(0)z -0 converges for entire z-plane. Case 2 n 2 > 0 x(n) z -n = x(n)/ z n In trouble if z = 0 so z 0 if n 2 > 0. Case3 n 1 < 0 have terms x(-1)z, x(-2)z 2 z if n 1 < 0.
8 (3) Right Sided Sequences X(z) = x(n)z -n + x(n)z -n x(n) = 0 for n < n 1 X(z) = x(n)z -n Ex x(n) = a n u(n) Converges for exterior of circle.
9 Large z makes z -1 small. If converges for z 1, x(n)z -n < Converges for z > R x _ except for z = if n 1 < 0. Right sided sequences have z-transforms which converge for exterior of a circle. Iff z-transform converges for exterior of a circle, it is right sided in time domain. (4) Left Sided Sequences x(n) = 0 for n > n 2
10 X(z) = x(n) z -n = x(n) z -n + x(n) z -n Converges if z < some value. Therefore converges for interior of circle except z=0 if n 2 > 0. x(n) z -n Ex x(n) = -(b n )u(-n-1) X(z) = - b n z -n = 1 - b -n z n z < b Draw region of convergence. Note no poles in the R.O.C.
11 (5) Two sided Sequences Extends from - to X(z) = x(n)z -n = x(n)z -n + x(n)z -n First converges for z large (exterior of circle z = R x _,) Second converges for z small (interior for circle R x + ) Common region of convergence is an annulus: R x _ < z < R x + and and z- transform exists.
12 Ex Find X(z) and its R.O.C. for x(n) = a n u(n) + b n u(-n) C. Inverse z -Transforms (1) Cauchy integral theorem leads to counterclockwise countour in region of convergence. x(n) = (1/2πj) X(z) z n-1 dz
13 We won t use this. Note; looks complicated but leads to partial fraction expansion often. (2) Power Series If we have X(z) = x(n)z -n and we have x(n), inverse transform by inspection. H(z) = 0.2z + 1 + 0.3 z -1 h(-1) = 0.2, h(0) = 1, h(1) = 0.3 (3) Partial Fraction Expansion for Rational Case H(z) = B(z) A(z)
14 = b(n)z -n a(n)z -n If we know poles p(n) of H(z), rewrite H(z) as K b(n)z -n Π (1- p(n)z -1 ) A 1 A 2 A N = + + (1- p(1)z -1 ) (1- p(2)z -1 ) (1- p(n)z -1 ) H(z) = A k (p(k)) n z -n h(n) = A k (p(k)) n u(n)
15 Ex Expansion of right sided sequence. x(n) = (1/2) n u(n) + (1/3) n u(n) 1 1 X(z) = ----------- + ------------ 1-1/2 z -1 1 1/3 z -1 2 5/6 z -1 = ------------------------- 1 5/6 z -1 + 1/6 z -2 A B = ----------- + ------------ 1-1/2 z -1 1 1/3 z -1 A = B =
16 (4) Long Division H(z) = B(z)/A(z) Rules (1) For a causal solution, put powers of z in descending order for both B(z) and A(z). (2) For an anti-causal solution, put powers of z in ascending order for both B(z) and A(z).
17 Comments (1) Solutions from the long division approach are identical to those from the partial fraction approach (2) The long division approach leads to a difference equation. Ex. H(z) = B(z)/A(z) = Y(z)/X(z). If x(n) = δ(n), X(z) = 1 and Y(z) = H(z). Normalize the coefficients so that a(0) = 1. Let A(z) = 1 + A (z). Then B(z) Y(z) = 1 + A (z) X(z) Y(z) = B(z)X(z) A (z)y(z). With x(n) = δ(n) and h(n) = y(n), h(n) = b(k) δ(n-k) - a(k)h(n-k)
D. Properties and Uses of Z-Transforms (1) Shift of a Sequence (most important basic use of z-transform). X(z) = x(0) + x(1)z -1 +x(2) z -2 z X(z) = x(0) z + x(1) +x(2) z -1 = Y(z) Z -1 (z X(z)) = y(n) = x(n+1) all n or Z -1 (z k X(z)) = x(n+k) all n, shift to left. Z -1 (z -k X(z)) = x(n-k) all n, shift to right. (2) Multiplication by Exponential Sequence y(n) = a n x(n) 18 Y(z) = a n x(n)z -n = x(n) (a -1 z) -n
19 = X(z) = X(a -1 z) If X(z 1 ) is special in original transform (poles, zero, etc) X(a -1 z 2 ) is special now. z 1 = a -1 z 2 or z 2 = a z 1 Expand or show z plane. (3) Convolution of Sequences (Most important Property) y(n) = h(k) x(n-k)
20 Z-transform both sides Y(z) = h(k) x(n-k) z -n z -n = z -k z -(n-k) Y(z) = h(k) z -k x(n-k) z -(n-k) Y(z) = H(z) X(z) ( Note: h(f(n)) g(z) -f(n) = X(g(z)) ) This implies that convolution is equivalent to multiplying polynomials in z -1 Ex (3z + 1 + z -1 ) (2 + 3z -1 + z -2 ) h(n) = 3 δ(n+1) + δ(n) + δ(n-1) x(n) = 2 δ(n) + 3 δ(n-1) + δ(n-2)
21 Y(z) = 6z + 11 + 8z -1 + 4z -2 + z -3 y(n) = 6δ(n+1) + 11δ(n) + 8δ(n-1) + 4δ(n-2) + δ(n-3) may be easier than straight convolution method. Ex h(n) = a n u(n), x(n) = b n u(n) H(z) = 1 1- az -1 X(z) = 1 1- bz -1
22 Y(z) = 1 (1-az -1 ) (1-bz -1 ) A B = + (1-az -1 ) (1-bz -1 ) 1 A = 1-bz -1 = 1 1-(b/a)
23 = a (a-b) 1 B = 1-az -1 = 1 1-(a/b) = b (b-a)
a b y(n) = [ ( ) a n + ( ) b n ]u(n) a - b b - a 24 Sometimes easier than time domain method. (4) System Function or Transfer Function. In Laplace Transforms, transfer function is Output(s)/intput(s) Also C(s) = M(s) R(s) Given M and R get C Also c(t) = m(t) r(t-t) dt Same in z transform and Fourier transform.
25 For Linear Shift invariant system, System function or transfer function is z transform of impulse response. y(n) = h(k) x(n-k) Y(z) = H(z) X(z) If z = 1 or z = e jw, we get frequency response of system. Ex If H(z) = 2z 1 + 1 + 2z -1 H(e +jw ) = 2e jw + 1 + 2 e -jw = 1 + 4cos(w)
26 Ex : FIR Filters h(n) = 0 n < M or n > N H(z) = h(n)z -n is transfer function. Ex : IIR Filters a(k) y(n-k) = b(r) x(n-r) for all n z-transform eqn. A(z) Y(z) = B(z) X(z) Y(z) X(z) = B(z) A(z)
27 = b(r) z -r a(k) z -k = K Π (1 z r z -1 ) Π (1 p k z -1 ) Pole Zero pattern in z plane specifies the type of causality and stability for the sequence. If poles are inside unit circle, H(z) converges for z outside unit circle and have stable causal filter. 1 1- az -1 az -1 = 1 z = a
28 1 = a n z -n iff az -1 < 1 1- az -1 for z > a Z-Transform Examples Ex Find the transform of n x(n) / z ( x (n)z -n ) = - n x(n) z -(n+1) X'(z) = - z -1 n x(n) z -n = - z -1 n x(n) z -n
29 Therefore, Z { n x(n) } = -z X'(z) Ex Find the z transform of n a n u(n) 1 z z { a n u(n) } = = = X(z) (1-az -1 ) z - a X'(z) = [ ((z-a) z) / (z-a) 2 ] = -a (z-a) 2 -z X'(z) = a z (z-a) 2 Region of convergence? Same as for X(z)
30 Ex Find z-transform of sequence x(n) = n for 0 n N-1 N for n N Straightforward Way x(n) = n u(n) (n-n) u(n-n) r(n) r(n-n) z(n y(n) ) = -z d/dz Y(z) y(n) = u(n) Here, U(z) = z -n = 1 1- z -1
31 Y'(z) = - z -2 (1-z -1 ) 2 -zy'(z) = z -1 (1-z -1 ) 2 = R(z) X(z) = R(z) [ 1 z -N ] = z -1 z -N-1 (1-z -1 ) 2 Other way: x(n) = [u(n) u(n-n)] * u(n-1) X(z) = U(z) [ U(z) z -N U(z) ] z -1
32 = z -1 (1 z -N ) (1-z -1 ) 2 Ex h(n) = 2 n u(n) + (1/3) n u(n) (a) Find H(z) and its R.O.C. (b) Find a stable version of h(n) that has the same H(z), but with a different R.O.C. (c) Find a stable set of difference equations for the filter. (a) (b)
(c) 33
34 Ex Generalize the previous example K h(n) = c i a in u(n) i=1 (a) Find H(z) and its R.O.C. (b) If the 3 rd term, c 3 a 3n u(n) is unstable, find a stable version of it that leads to the same H(z), but with a different R.O.C. (c) How many versions of H(z) are there, which have the same form but with a different R.O.C.? (d) Out of these, how many are stable? (e) Which H(z) corresponds to H(e jw )? (f) Give a parallel form block diagram for this filter. (a)
35 (b) (c) (d) (e) (f)
36 Ex Z { cos(w 1 n) u(n) } Ex Given X(z) = e a z, find x(n)
Ex. An IIR digital filter has the impulse response (.5 n n h(n) = ) u( n) + (.2 ) u(n) (a) Find a stable H(z) in closed form, and its region of convergence. (b) Give a stable set of recursive difference equations for the filter. Use the parallel form. (c) Add the two H(z) terms of part (b ) together to get H(z) with one numerator and one denominator. Give the difference equation corresponding to this new direct form H(z). (d) In the pseudocode below, which is based upon H(z) in part (c), give correct expressions for A, B, C, and D, assuming that x(n) = y(n) =0 for negative n. 37
38 y(0) = A y(1) = B For n = C to N y(n) = D End 1.5z 1 H ( z ) = + (a) 1.5z 1.2 (b) z 1 1 (c) 1 z +.1z H ( z ) = 1.7 z +.1z 1 2 1 2 (d)
E. Three Standard Implementations of H(z) 39 1. Parallel Form H ( z ) = h + i z N /2 1 k k 1 2 k = 1 1+ fk z + gk z y ( n) = h x( n) + i x( n 1) k k k f y ( n 1) g y ( n 2) k k k k N /2 y( n) = y ( n) k = 1 k
40 2. Cascade Form H ( z ) = c + d z + e z N /2 1 2 k k k 1 2 k = 1 1+ fk z + gk z y ( n) = c x ( n) + d x ( n 1) + e x ( n 2) k k k k k k k f y ( n 1) g y ( n 2) k k k k x ( n) = x( n), 1 x ( n) = y ( n) k k 1 y( n) = y ( n) N /2
41 3. Direct Form Multiplying out the Cascade form or adding up the parallel form, we get a single transfer function: H ( z ) = a(0) = 1 M r= 0 N k = 0 M b( r) z a( k) z r k = Y ( z) X ( z) y( n) = b( r) x( n r) a( k) y( n k) r= 0 k = 1 N