ELEN E4810: Digital Signal Processing Topic 4: The Z Transform 1. The Z Transform 2. Inverse Z Transform Dan Ellis 2013-10-02 1 1. The Z Transform Powerful tool for analyzing & designing DT systems Generalization of the DTFT: G(z) = Z{g[n]} = n g[n]z Z Transform n= z is complex... Dan Ellis z = ej! → DTFT z = r·ej! → n g[n]r n jn 2013-10-02 e DTFT of r-n·g[n] 2 Region of Convergence (ROC) Critical question: n Does summation G(z) = n= x[n]z converge (to a finite value)? In general, depends on the value of z Im{z} → Region of Convergence: Portion of complex z-plane for which a particular G(z) λ will converge ROC |z| > λ Dan Ellis 2013-10-02 Re{z} z-plane 3 ROC Example e.g. x[n] = ∏nµ[n] X(z) = n=0 n n z -2 -1 1 2 3 4 n 1 “closed form” when = 1 1 z |∏z-1| < 1 Im{z} ß converges only for |∏z-1| < 1 Re{z} λ (previous slide) i.e. ROC is |z| > |∏| |∏| < 1 (e.g. 0.8) - finite energy sequence |∏| > 1 (e.g. 1.2) - divergent sequence, infinite energy, DTFT does not exist but still has ZT when |z| > 1.2 (in ROC) Dan Ellis 2013-10-02 4 M About ROCs ROCs always defined in terms of |z| → circular regions on z-plane (inside circles/outside circles/rings) If ROC includes Im{z} unit circle (|z| = 1), → g[n] has a DTFT Re{z} 1 (finite energy Unit circle sequence) z-plane lies in ROC → DTFT OK Dan Ellis 2013-10-02 5 Another ROC example Anticausal (left-sided) sequence: n x [n] = µ [n 1] -5 -4 -3 -2 -1 X ( z ) = n ( µ [ n 1]) z n n = n = z = m =1 z 1 1 1 = z = 1 1 1 z 1 z 1 n n m m 1 2 3 4 n ROC: |λ| > |z| Same ZT as ∏nµ[n], different sequence? Dan Ellis 2013-10-02 6 ROC is necessary! A closed-form expression for ZT must specify the ROC: x[n] = ∏nµ[n] X(z) = 1 Im 1 1 z n ROC |z| > |∏| -4 -3 -2 -1 1 2 3 4 Re |λ| n 1 x[n] = -∏ µ[-n-1] X(z) = 1 1 z z-plane -4 -3 -2 -1 1 2 3 4 n ROC |z| < |∏| DTFTs? A single G(z) expression can match several sequences with different ROCs Dan Ellis 2013-10-02 7 Rational Z-transforms G(z) expression can be any function; rational polynomials are important class: 1 (M 1) M P (z ) p0 + p1z +…+ pM 1z + pM z G (z) = = D(z ) d0 + d1z 1 +…+ d N1z (N1) + d N z N Dan Ellis By convention, expressed in terms of z-1 – matches ZT definition (Reminiscent of LCCDE expression...) 2013-10-02 8 Factored rational ZTs Numerator, denominator can be factored: 1 M M p0 M 1 z z p0 =1 (z ) =1 G (z) = = N N N 1 z d0 =1 (z ) d0 =1 1 z ( ( Dan Ellis ) ) {≥} are roots of numerator → G(z) = 0 → {≥} are the zeros of G(z) {∏} are roots of denominator → G(z) = ∞ → {∏} are the poles of G(z) 2013-10-02 9 Pole-zero diagram Can plot poles and zeros on complex z-plane: Im{z} o × × o o poles ∏ (cpx conj for real g[n]) o × 1 Re{z} zeros ≥ z-plane (Value of) expression determined by roots Dan Ellis 2013-10-02 10 Z-plane surface G(z): cpx function of a cpx variable Can calculate value over entire z-plane ROC not shown!! Dan Ellis 2013-10-02 11 M ROCs and sidedness 1 Two sequences have: G(z) = 1 1 z ROC |z| > |∏| → g[n] = ∏nµ[n] RIGHT-SIDED 10 8 6 2 n 1 |λ| 4 ( |∏| < 1 ) 0.5 0 0 −1 −0.5 ROC |z| < |∏| → g[n] = -∏nµ[-n-1] LEFT-SIDED n −0.5 0 −1 0.5 z-plane 1 Each ZT pole → region in ROC outside or inside |∏| for R/L sided term in g[n] Dan Ellis Overall ROC is intersection of each term’s 2013-10-02 12 ZT is Linear G(z) = Z{g[n]} = g[n]z n Z Transform n y[n] = Æg[n] + Øh[n] Y(z) = ß(Æg[n]+Øh[n])z-n Linear = ßÆg[n]z-n + ßØh[n]z-n = ÆG(z)+ØH(z) n n y[n] = µ [n] + Thus, if 1 1 2 2 µ[n] 1 2 then Y (z) = + 1 1 1z 1 2 z 1 Dan Ellis 2013-10-02 ROC: |z|>|λ1|,|λ2| 13 ROC intersections 1 1 + Consider G(z) = 1 1 1 1z 1 2z with |∏1| < 1 , |∏2| > 1 ... no ROC specified Two possible sequences for ∏1 term... -∏1 µ[-n-1] n n or ∏1nµ[n] or ∏2nµ[n] n Similarly for ∏2 ... -∏2nµ[-n-1] n → 4 possible g[n] seq’s and ROCs ... Dan Ellis 2013-10-02 14 n ROC intersections: Case 1 G(z) = 1 1 + 1 1 z 1 1 2 z 1 g[n] = ∏1nµ[n] + ∏2nµ[n] both right-sided: n ROC: |z| > |∏1| and |z| > |∏2| Im Im Re |λ1| |λ2| Dan Ellis 2013-10-02 15 ROC intersections: Case 2 G(z) = 1 1 + 1 1 z 1 1 2 z 1 g[n] = -∏1nµ[-n-1] - ∏2nµ[-n-1] both left-sided: n ROC: |z| < |∏1| and |z| < |∏2| Im Im Re |λ1| |λ2| Dan Ellis 2013-10-02 16 ROC intersections: Case 3 G(z) = 1 1 + 1 1 z 1 1 2 z 1 g[n] = ∏1nµ[n] - ∏2nµ[-n-1] two-sided: n ROC: |z| > |∏1| and |z| < |∏2| Im Im Re |λ1| |λ2| Dan Ellis 2013-10-02 17 ROC intersections: Case 4 G(z) = 1 1 + 1 1 z 1 1 2 z 1 g[n] = -∏1nµ[-n-1] + ∏2nµ[n] two-sided: n ROC: |z| < |∏1| and |z| > |∏2| ? Im no ROC ... Re |λ1| |λ2| Dan Ellis 2013-10-02 18 ROC intersections Note: Two-sided exponential g[n] = n < n < n = µ [n] + µ [n 1] n ROC |z| > |Æ| n ROC |z| < |Æ| No overlap in ROCs → ZT does not exist Im Re |α| (does not converge for any z) Dan Ellis 2013-10-02 19 ZT of LCCDEs LCCDEs have solutions of form: yc [n] = i i µ [n] + ... (same ∏s) i Hence ZT Yc ( z ) = + 1 1 i z Each term ∏in in g[n] corresponds to a pole ∏i of G(z) ... and vice versa n LCCDE sol’ns are right-sided ROCs are |z| > |∏i| outside circles Dan Ellis 2013-10-02 20 Z-plane and DTFT Slice between surface and unit cylinder (|z| = 1 z = ej!) is G(ej!), the DTFT |G(ej!)| z = ej! 0 Dan Ellis 2013-10-02 º ! / rad/samp 21 Some common Z transforms g[n] ±[n] µ[n] Ænµ[n] ROC ∀z |z| > 1 |z| > |Æ| G(z) 1 1 1z 1 1 1z 1 0n)µ[n] 1r cos( 0 ) z 1 1 2 2 12r cos( 0 ) z +r z |z| > r rnsin(!0n)µ[n] r sin ( 0 ) z 1 12r cos z1+r 2 z2 ( 0) |z| > r rncos(! poles at z = re±j! 0 Dan Ellis 2013-10-02 × × sum of rnej! n + rne-j! n 0 0 “conjugate pole pair” 22 Z Transform properties w/ROC Rg g[n] G(z) g*[n] G*(z*) Rg Time reversal g[-n] G(1/z) 1/Rg Time shift g[n-n0] z-n0G(z) Rg (0/∞?) Exp. scaling Æng[n] G(z/Æ) |Æ|Rg ng[n] dG(z) z dz Rg (0/∞?) Conjugation Diff. wrt z Dan Ellis 2013-10-02 23 Z Transform properties g[n] Convolution g[n] ∗ h[n] Modulation g[n]h[n] ROC G(z) 1 2 j at least G(z)H(z) ( ) Rg∩Rh 1 z C G (v) H v v dv at least RgRh Parseval: g[n]h [n] = * 1 2 j n= Dan Ellis 2013-10-02 ( ) 1 1 C G (v)H v v dv * 24 ZT Example x [n] = r cos( 0 n)µ [n] ; can express as n j 0 1µ n re 2 [ ] ( ) + (re n j 0 n ) = v[n] + v* [n] v[n] = 1/2µ[n]Æn ; Æ = rej! → V(z) = 1/(2(1- rej! z-1)) ROC: |z| > r 0 0 ( ) Hence, X (z ) = V (z ) + V z * = 21 = Dan Ellis ( * 1 + 1re j 0 z 1 1re j 0 z 1 1 ) 1r cos( 0 ) z 1 12r cos( 0 ) z 1 +r 2 z 2 2013-10-02 25 Another ZT example y[n] = (n +1) µ [n] n = x[n] + nx[n] where x[n] = Æn µ[n] dX z ( ) 1 z X (z) = dz 1 1 z ( |z| > |Æ| ) d 1 z 1 = z = 1 dz 1 z (1 z 1 )2 1 z 1 1 repeated Y (z) = + = 1 1 2 1 2 root - IZT (1 z ) (1 z ) ROC |z| > |Æ| 1 z Dan Ellis 2013-10-02 26 2. Inverse Z Transform (IZT) Forward z transform was defined as: G(z) = Z{g[n]} = g[n]z n n= 3 approaches to inverting G(z) to g[n]: Dan Ellis Generalization of inverse DTFT Power series in z (long division) Manipulate into recognizable pieces (partial fractions) 2013-10-02 the useful one 27 IZT #1: Generalize IDTFT If z = re j then G(z) = G(re ) = j z= rej! so g[n]r d! = dz/jz ⇤ n n g[n]r = = ⌅ 1 2 1 2 j ⇤ e j n = DTFT g[n]r j⇥ G re n G (z) z C ⇥ ej⇥n d 1 r n IDTFT dz Re Any closed contour around origin will do Cauchy: g[n] = ß[residues of G(z)zn-1] Dan Ellis 2013-10-02 ⇥ Im Counterclockwise closed contour at |z| = r within ROC n 28 IZT #2: Long division n Since G(z) = g[n]z n= if we could express G(z) as a simple power series G(z) = a + bz-1 + cz-2 ... then can just read off g[n] = {a, b, c, ...} Typically G(z) is right-sided (causal) P(z) and a rational polynomial G (z ) = D(z) Can expand as power series through long division of polynomials Dan Ellis 2013-10-02 29 IZT #2: Long division Procedure: Express numerator, denominator in descending powers of z (for a causal fn) Find constant to cancel highest term → first term in result Subtract & repeat → lower terms in result Just like long division for base-10 numbers Dan Ellis 2013-10-02 30 IZT #2: Long division 1 1+ 2z e.g. H (z ) = 1+ 0.4z 1 0.12z 2 1 2 Result 3 1+1.6z 0.52z + 0.4z ... 1+ 0.4z 1 0.12z 2 ) 1+ 2z 1 1 2 1+ 0.4z 0.12z 1 2 1.6z + 0.12z 1 2 3 1.6z + 0.64z 0.192z 0.52z 2 + 0.192z 3 ... Dan Ellis 2013-10-02 31 IZT#3: Partial Fractions Basic idea: Rearrange G(z) as sum of terms recognized as simple ZTs especially 1 1 z 1 n µ [n] or sin/cos forms P(z) i.e. given products 1 z 1 1 z 1 A B + + rearrange to sums 1 1 1 z 1 z Dan Ellis ( 2013-10-02 )( ) 32 Partial Fractions Note that: A B C + + = 1 1 1 1 z 1 z 1 z ( )( order 2 polynomial u + vz-1 + wz-2 ) ( )( ) ( 1 1 1 1 z 1 z 1 z ( )( )( ) )( A 1 z 1 1 z 1 + B 1 z 1 1 z 1 + C 1 z 1 1 z 1 order 3 polynomial Can do the reverse i.e. P(z) go from to N=1 (1 z 1 ) =11 z 1 N if order of P(z) is less than D(z) Dan Ellis 2013-10-02 ) else cancel w/ long div. 33 Partial Fractions order N-1 Procedure: N P(z) F(z) = N = 1 1 =1 =1 (1 z ) 1 z f [n] = no repeated poles! N ( ) µ [n] =1 n 1 = 1 z where ( )F (z) z= i.e. evaluate F(z) at the pole (cancels term in denominator) but multiplied by the pole term → dominates = residue of pole Dan Ellis 2013-10-02 34 Partial Fractions Example 1 1+ 2z Given H (z ) = (again) 1+ 0.4z 1 0.12z 2 factor: 1 1+ 2z 1 2 = = + 1 1 1 1 1+ 0.6z 1 0.2z 1+ 0.6z 1 0.2z ( )( where: 1 = (1+ 0.6z 1 1 ) )H (z) z=0.6 2 = 1+ 2z 1 = 2.75 1+ 0.6z z=0.2 Dan Ellis 1+ 2z 1 = = 1.75 1 1 0.2z z=0.6 2013-10-02 35 Partial Fractions Example 1.75 2.75 Hence H (z ) = + 1 1+ 0.6z 1 0.2z 1 If we know ROC |z| > |Æ| i.e. h[n] causal: h[n] = (1.75)(0.6) µ [n] + (2.75)(0.2) µ [n] n Dan Ellis n = –1.75{ 1 -0.6 0.36 -0.216 ...} +2.75{ 1 0.2 0.04 0.008 ...} same as = {1 1.6 -0.52 0.4 ...} long division! 2013-10-02 36