Lecture 5 – 6 Z - Transform By Dileep Kumar 1 Frequency domain vs Time domain Frequency domain is a term used to describe the analysis of mathematical functions or signals with respect to frequency. (communications point of view) A plane on which signal strength can be represented graphically as a function of frequency, instead of a function of time. control systems) Pertaining to a method of analysis, particularly useful for fixed linear systems in which one does not deal with functions of time explicitly, but with their Laplace or Fourier transforms, which are functions of frequency. Speaking non-technically, a time domain graph shows how a signal changes over time, whereas a frequency domain graph shows how much of the signal lies within each given frequency band over a range of frequencies. 2 Cont: A frequency domain representation can also include information on the phase shift that must be applied to each sinusoid in order to be able to recombine the frequency components to recover the original time signal. The frequency domain relates to the Fourier transform or Fourier series by decomposing a function into an infinite or finite number of frequencies. This is based on the concept of Fourier series that any waveform can be expressed as a sum of sinusoids (sometimes infinitely many.) In using the Laplace, Z-, or Fourier transforms, the frequency spectrum is complex and describes the frequency magnitude and phase. In many applications, phase information is not important. By discarding the phase information it is possible to simplify the information in a frequency domain representation to generate a frequency spectrum or spectral density. A spectrum analyser is a device that displays the spectrum. 3 The Direct Z-Transform The z-transform of a discrete time signal is defined as the power series (1) X(z ) x [ n ]z n Where z is a complex variable. For convenience, the z-transform of a signal x[n] is denoted by X(z) = Z{x[n]} Since the z-transform is an infinite series, it exists only for those values of z for which this series converges. The Region of Convergence (ROC) of X(z) is the set of all values of z for which this series converges. We illustrate the concepts by some simple examples. n 4 Example 1: Determine the z-transform of the following signals x[n] = [1, 2, 5, 7, 0, 1] Solution: X(z) = 1 + 2z-1+ 5z-2 + 7z-3 + z-5, ROC: entire z plane except z = 0 (a) (b) y[n] = [1, 2, 5, 7, 0, 1] Solution: Y(z) = z2 + 2z + 5 + 7z-1 + z-3 ROC: entire z-plane except z = 0 and z = . z[n] = [0, 0, 1, 2, 5, 7, 0, 1] Solution: z-2 + 2z-3 + 5z-4 + 7z-5 + z-7, ROC: all z except z=0 (c) 5 (d) p[n] = [n] Solution: P(z) = 1, ROC: entire z-plane. (e) q[n] = [n – k], k > 0 Solution: Q(z) = z-k, entire z-plane except z=0. (f) r[n] = [n+k], k > 0 Solution: R(z) = zk, ROC: entire z-plane except z = . 6 Example 2: Determine the z-transform of x[n] = (1/2)nu[n] Solution: X(z ) x [ n ]z n n n 1 n z n0 2 1 1 z 1 2 1 1 2z n0 1 z 2 n 2 ....... 1 1 1 z 1 2 ROC: |1/2 z-1| < 1, or equivalently |z| > 1/2 7 Example 3: Determine the z-transform of the x[n] = signal n a u[n] Solution: X(z ) a z 1 n n n0 1 az n az 1 n0 az 1 2 ....... 1 1 az 1 ROC :| z | | a | 8 Properties of z-transform Linearity If x1[n] X1(z) and x2[[n] X2(z) then a1x1[n] + a2x2[n] a1X1(z) + a2X2(z) 9 Example: Determine the z-transform of the signal x[n] = [3(2n) – 4(3n)]u[n] Solution: z [ a u [ n ]] 1 n 1 az 1 z [ 3 ( 2 ) 4 3 ] 3 1 n n 4 1 1 2z 1 1 3z 1 Example 4: Determine the z-transform of the signal (cosw0n)u[n] cos w 0 n u [ n ] 1 e 2 z cos w 0 n u [ n ] 1 z 1 2z 1 1 jw 0 n 1 e jw 0 n 2 1 1 2 1e jw 0 z 1 1 2 1e 1 jw 0 z 1 cos w 0 cos w 0 z 2 10 Time Shifting Property: If x[n] X(z) then x[n-k] z-kX(z) Proof: since z [ x [ n k ]] x[ n k ] z n n then the change of variable m = n-k produces z [ x [ n k ]] x [ m ]z (m k ) m z k x [ m ]z m z k X(z ) m 11 Example: Find the z-transform of a unit step function. Use time shifting property to find ztransform of u[n] – u[n-N]. The z-transform of u[n] can be found as z [ u [ n ]] u [ n ]z n n 1 z 1 z 2 z n n0 ....... 1 1 z 1 Now the z-transform of u[n]-u[n-N] may be found as follows: z [ u [ n ] u [ n N ]] 1 z N 1 z 1 1 1 z 1 z N 1 1 z 1 12 Scaling in the z-domain If x[n] X(z) Then anx[n] X(a-1z) For any constant a, real or complex. Proof: a x [ n ]z z a x[ n ] n n n n 1 x[ n ] a z n 1 Xa z n Example 5: Determine the z-transform of the signal an(cosw0n)u[n]. Solution: since z [cos( w 0 n )u [ n ] 1 z 1 2z 1 z [ a cos w 0 n u [ n ]] n 1 cos w 0 cos w 0 z 1 az 1 2 az 1 2 1 cos w 0 cos w 0 a z 2 2 13 Time reversal If x[n] X(z) then x[-n] X(z-1) Proof: z [ x[ n ]] x [ n ]z n n m x [ m ]z m x[ m ]z 1 m 1 X(z ) m Example 6: Determine the z-transform of u[-n]. Solution: since z[u[n]] = 1/(1 – z-1) Therefore, Z[u[-n]] = 1/(1-z) 14 Differentiation in the z - Domain x[n] X(z) then nx[n] = -z(dX(z)/dz) Tutorial 4: Q1: Prove the differentiation property of z – transform. Example 7: Determine the z-transform of the signal x[n] = nanu[n]. Solution: z [ a u [ n ]] n 1 1 az z [ na u [ n ]] z n 1 d 1 dz 1 az 1 az 1 1 az 1 2 15 Convolution and Correlation To study the LTI systems, convolution plays important role. Shifting multiplications and summation are operations in computation of convolution. Correlation which is very much similar to convolution provides information about the similarity between the two sequences. It is used in Radars, digital communication and mobile communication etc. The main application of correlation is that the incoming/received signal is correlated with standard signals and signal of this set which has maximum correlation with the incoming/received signal is detected. 16 Convolution of two sequences If x1[n] X1(z) and x2[n] X2(z) then x1[n]*x2[n] = X1(z)X2(z) Proof: The convolution of x1[n] and x2[n] is defined as x [ n ] x1 [ n ] * x 2 [ n ] x [k ]x 1 2 [n k ] k The z-transform of x[n] is X(z ) x [ n ]z n n n n x 1 [ k ]x 2 n k z n Upon interchanging the order of the summation and applying the time shifting property, we obtain n k X ( z ) x 1 k x 2 n k z X 2 z x 1 [ k ]z X 2 z X 1 z k k n 17 Example of the 1, x 2 [n ] 0, 8: signals Compute x1[n] = the convolution [1, -2, 1] and 0n 5 elsewhere Solution: X1(z) = 1 – 2z-1 + z-2 X2(z) = 1 + z-1 + z-2 + z-3 + z-4 + z-5 Now X(z) = X1(z)X2(z) = 1 – z-1 – z-6 + z-7 Hence x[n] = [1, -1, 0, 0, 0, 0, -1, 1] Note: You should verify this result from the definition of the convolution sum. 18 Exercise Find the convolution of sequences? x1 {1, 3 , 2} and x 2 {1, 2 , 1} 19 Correlation of two sequences If x1[n] X1(z) and x2[n] X2(z) rx1 x 2 ( m ) x1(n)x 2 (n m) X 1(z)X 2 (z z 1 ) n Proof: The follow ing is the correlati on of two sequences rx 1 x 2 ( m ) x 1 ( n ) x 2 [( n m )] (1) n Arranging the term x 2 (n m) as x above equa tion, we g et x 1(n)x 2 (n) : 2 [ (m n)] in rx 1 x 2 ( m ) x 1 ( n ) x 2 [ ( m n )] (2) n Therefore, the RHS o f Eq. ( 2 ) represen ts the con volution x1(n) and x 2 ( m) can be written as rx 1 x 2 ( m ) x1 ( m ) x 2 ( m ) 20 Continue: Z [ rx 1 x 2 ( m )] Z [ x1 ( m ) x 2 ( m )] Z [ rx 1 x 2 ( m )] Z [ x1 ( m )] Z [ x 2 ( m )] 1 Z [ x1 ( m )] X 1 ( z ) and Z [ x 2 ( m )] X 2 ( z ) 1 Z [ rx 1 x 2 ( m )] X 1 ( z ) X 2 ( z ) 21 Correlation of two sequences If x1[n] X1(z) and x2[n] X2(z) then rx1x2[k] = X1(z)X2(z-1) Tutorial 4 Q2: Prove this property. The Initial Value Theorem: X(z ) If x[n] is causal then x [ 0 ] lim z Proof: X(z ) x [ n ]z n x [ 0 ] x [1 ]z 1 x [ 2 ]z 2 .... n0 Obviously, as z , z-n 0 since n >0, this proves the theorem. 22 Final Value Theorem 1 x [ ] lim 1 z X(z ) If x[n] X(z), then z1 Tutorial 4 Q3: Prove the Final Value Theorem Example 9: Find the final value of 2z X(z ) Solution: 1 1 .8 z 1 1 z X ( z ) 1 z 1 1 z 1 0 .8 z 2z 1 1 2z 1 1 1 .8 z 1 0 .8 z 1 1 z 1 0 . 5 z 1 1 2 2z 2 1 1 0 .5 z 1 The final value theorem yields y [ ] lim z1 2z 1 1 0 .8 z 1 2 0 .2 10 23 Inverse z-transform In general, the inverse z-transform may be found by using any of the following methods: Power series method Partial fraction method 24 Power Series Method Example 2: Determine the z-transform of X(z ) 1 1 1 1 .5 z 0 .5 z 2 By dividing the numerator of X(z) by its denominator, we obtain the power series 1 1 3 2 z 1 1 2 z 2 1 3 2 z 1 7 4 z 2 15 8 z 3 31 16 z 4 ... x[n] = [1, 3/2, 7/2, 15/8, 31/16,…. ] 25 Power Series Method Example 2:Determine the z-transform of X(z ) 4z 1 1 2 2z z 2 By dividing the numerator of X(z) by its denominator, we obtain the power series x[n] = [2, 1.5, 0.5, 0.25, …..] 26 Partial Fraction Method: Example 1: Find the signal corresponding to the z-transform X(z ) z 2 3z Solution:X ( z ) X(z ) z 3 1 z z 2 3z 2 3 1 z 2 3 2 z z 1 z 0 . 5 2 1 z X(z ) 3 z 1 z 1 .5 z 0 .5 z 0 .5 X(z ) 3 or 0 .5 3 z z z1 z 2 (4) 1 1 z 1 1 4 0 .5 z z 1 z 0 . 5 1 z 1 4 z 0 .5 z z 0 .5 1 1 0 .5 z 1 x [ n ] 3 [ n ] [ n 1 ] u [ n ] 4 0 . 5 u [ n ] n 27 Partial Fraction Method: Example 2: Find the signal corresponding to the ztransform Y(z ) 1 1 0 .2 z 1 0 .2 z 1 2 1 Solution: Y(z ) Y(z ) z Y (z ) 0 . 25 z z 3 0 . 2 z 0 . 2 z 2 z 0 . 2 z 0 . 2 2 0 . 25 z z 1 1 1 0 .2 z 1 0 . 75 0 . 75 z z 0 .2 1 1 0 .2 z 1 0 . 25 z 0 .2 2 0 .1 0 .2 0 . 75 z 0 .2 0 .1 z 0 . 2 2 0 .1 z z 0 .2 0 .2 z 2 1 1 0 .2 z 1 2 y [ n ] 0 . 25 0 . 2 u [ n ] 0 . 75 0 . 2 u [ n ] 0 . 5 n 0 . 2 u28[ n ] n n n Z-Transform Solution of Linear Difference Equations We can use z-transform to solve the difference equation that characterizes a causal, linear, time invariant system. The following expressions are especially useful to solve the difference equations: z[y[(n-1)T] = z-1Y(z) +y[-T] Z[y(n-2)T] = z-2Y(z) + z-1y[-T] + y[-2T] Z[y(n-3)T] = z-3Y(z) + z-2y[-T] + z-1y[-2T] + y[-3T] 29 Example: Consider the following difference equation: y[nT] –0.1y[(n-1)T] – 0.02y[(n-2)T] = 2x[nT] – x[(n-1)T] where the initial conditions are y[-T] = -10 and y[2T] = 20. Y[nT] is the output and x[nT] is the unit step input. Solution: Computing the z-transform of the difference equation gives Y(z) – 0.1[z-1Y(z) + y[-T]] – 0.02[z-2Y(z) + z-1y[-T] + y[-2T]] = 2X(z) – z-1X(z) Substituting the initial conditions we get Y(z) – 0.1z-1Y(z) +1 – 0.02z-2Y(z) – 0.2z-1 –0.4 = 30 -1 (2 – z )X(z) 1 0 .1 z 1 0 . 02 z Y ( z ) 1 0 .2 z Y (z ) Y ( z ) 2 z 1 1 z 1 0 . 1 z 1 3 0 .6 z 2 1 1 0 . 02 z 1 .4 0 .6 z 1 .4 z 1 2 2 2z 1 1 z 1 0 .2 z 1 1 z 0 .2 z 2 0 . 02 z 2 1 1 1 0 .2 z 0 .6 0 .6 1 .4 0 .6 z 1 0 .2 z 2 1 z 1 0 . 2 z 1 0 . 1 z 1 1 1 0 .2 z z 1 z 0 . 2 z 0 . 1 Y (z ) z 1 . 136 z1 Y ( z ) 1 . 136 0 . 567 z 0 .2 1 1 z 1 0 . 567 0 . 830 z 0 .1 1 1 0 .2 z 1 0 . 830 1 1 0 .1 z 1 and the output signal y[nT] is 31 y [ nT ] 1 . 136 u[ nT ] 0 . 567 ( 0 . 2 ) u[ nT ] 0 . 830 ( 0 . 1 ) u[ nT ] n n