<<

2065-23

Advanced Training Course on FPGA Design and VHDL for Hardware Simulation and Synthesis

26 October - 20 November, 2009

Digital Processing The z-transform

Massimiliano Nolich DEEI Facolta' di Ingegneria Universita' degli Studi di Trieste via Valerio, 10, 34127 Trieste Italy The z-transform See Oppenheim and Schafer, Second Edition pages 94–139, or First Edition pages 149–201.

1 Introduction

The z-transform of a sequence xŒn is

1 X.z/ D xŒnzn: nD1 X The z-transform can also be thought of as an operator Zfg that transforms a sequence to a function:

1 ZfxŒngD xŒnzn D X.z/: nD1 X In both cases z is a continuous complex variable. We may obtain the from the z-transform by making the substitution z D ej!. This corresponds to restricting jzjD 1. Also, with z D rej! ,

1 1 X.rej! / D xŒn.rej! /n D .xŒnr n/ ej!n: nD1 nD1 X X That is, the z-transform is the Fourier transform of the sequence xŒnr n. For r D 1 this becomes the Fourier transform of xŒn. The Fourier transform therefore corresponds to the z-transform evaluated on the unit circle:

1 z−plane Im z D ej!

! Re

Unit circle

The inherent periodicity in frequency of the Fourier transform is captured naturally under this interpretation. The Fourier transform does not converge for all sequences — the infinite sum may not always be finite. Similarly, the z-transform does not converge for all sequences or for all values of z. The set of values of z for which the z-transform converges is called the region of convergence (ROC). 1 The Fourier transform of xŒn exists if the sum nD1 jxŒnj converges. However, the z-transform of xŒn is just the Fourier transform of the sequence P xŒnr n. The z-transform therefore exists (or converges) if

1 X.z/ D jxŒnr nj < 1: nD1 X This leads to the condition 1 jxŒnjjzjn < 1 nD1 X for the existence of the z-transform. The ROC therefore consists of a ring in the z-plane:

2 z−plane Im Region of convergence

Re

In specific cases the inner radius of this ring may include the origin, and the outer radius may extend to infinity. If the ROC includes the unit circle jzjD 1, then the Fourier transform will converge. Most useful z-transforms can be expressed in the form P.z/ X.z/ D ; Q.z/ where P.z/ and Q.z/ are in z. The values of z for which P.z/ D 0 are called the zeros of X.z/, and the values with Q.z/ D 0 are called the poles. The zeros and poles completely specify X.z/ to within a multiplicative constant. Example: right-sided exponential sequence Consider the signal xŒn D anuŒn. This has the z-transform

1 1 X.z/ D anuŒnzn D .az1/n: nD1 nD0 X X Convergence requires that

1 jaz1jn < 1; nD0 X which is only the case if jaz1j <1, or equivalently jzj > jaj. In the ROC, the

3 series converges to

1 1 z X.z/ D .az1/n D D ; jzj > jaj; 1 az1 z a nD0 X since it is just a geometric series. The z-transform has a region of convergence for any finite value of a. z−plane Im unit circle

a Re 1

The Fourier transform of xŒn only exists if the ROC includes the unit circle, which requires that jaj <1. On the other hand, if jaj >1 then the ROC does not include the unit circle, and the Fourier transform does not exist. This is consistent with the fact that for these values of a the sequence anuŒn is exponentially growing, and the sum therefore does not converge. Example: left-sided exponential sequence Now consider the sequence xŒn DanuŒn 1. This sequence is left-sided because it is nonzero only for n 1. The z-transform is

1 1 X.z/ D anuŒn 1zn D anzn nD1 nD1 X1 1 X D anzn D 1 .a1z/n: nD1 nD0 X X

4 For ja1zj <1, or jzj < jaj, the series converges to 1 1 z X.z/ D 1 D D ; jzj < jaj: 1 a1z 1 az1 z a z−plane Im unit circle

a Re 1

Note that the expression for the z-transform (and the pole zero plot) is exactly the same as for the right-handed exponential sequence — only the region of convergence is different. Specifying the ROC is therefore critical when dealing with the z-transform. Example: sum of two exponentials 1 n 1 n The signal xŒn D 2 uŒn C 3 uŒn is the sum of two real exponentials. The z-transform is   1 1 n 1 n X.z/ D uŒn C uŒn zn 2 3 nD1 X      1 1 n 1 1 n D uŒnzn C uŒnzn 2 3 nD1 nD1 X   X   1 1 n 1 1 n D z1 C z1 : 2 3 nD0 nD0 X   X   From the example for the right-handed exponential sequence, the first term in this sum converges for jzj > 1=2, and the second for jzj > 1=3. The combined transform X.z/ therefore converges in the intersection of these regions, namely

5 when jzj > 1=2. In this case 1 1 2z.z 1 / X.z/ D C D 12 : 1 1 1 1 1 1 1 2 z 1 C 3 z .z 2 /.z C 3 / The pole-zero plot and region of convergence of the signal is z−plane Im unit circle

1 Re 1 1 1 3 12 2

Example: finite length sequence The signal an 0  n  N 1 xŒn D 80 otherwise < has z-transform : N 1 N 1 X.z/ D anzn D .az1/n nD0 nD0 X X 1 .az1/N 1 zN aN D D : 1 az1 zN 1 z a Since there are only a finite number of nonzero terms the sum always converges when az1 is finite. There are no restrictions on a (jaj < 1), and the ROC is the entire z-plane with the exception of the origin z D 0 (where the terms in the sum are infinite). The N roots of the numerator are at

j.2k=N / zk D ae ; k D 0;1;:::;N 1;

6 since these values satisfy the equation zN D aN . The zero at k D 0 cancels the pole at z D a, so there are no poles except at the origin, and the zeros are at

j.2k=N / zk D ae ; k D 1;:::;N 1:

2 Properties of the region of convergence

The properties of the ROC depend on the nature of the signal. Assuming that the signal has a finite amplitude and that the z-transform is a :  The ROC is a ring or disk in the z-plane, centered on the origin

(0  rR < jzj < rL  1).  The Fourier transform of xŒn converges absolutely if and only if the ROC of the z-transform includes the unit circle.  The ROC cannot contain any poles.  If xŒn is finite duration (ie. zero except on finite interval

1 < N1  n  N2 < 1), then the ROC is the entire z-plane except perhaps at z D 0 or z D 1.  If xŒn is a right-sided sequence then the ROC extends outward from the outermost finite pole to infinity.  If xŒn is left-sided then the ROC extends inward from the innermost nonzero pole to z D 0.  A two-sided sequence (neither left nor right-sided) has a ROC consisting of a ring in the z-plane, bounded on the interior and exterior by a pole (and not containing any poles).

 The ROC is a connected region.

7 3 The inverse z-transform

Formally, the inverse z-transform can be performed by evaluating a Cauchy integral. However, for discrete LTI systems simpler methods are often sufficient.

3.1 Inspection method

If one is familiar with (or has a table of) common z-transform pairs, the inverse can be found by inspection. For example, one can invert the z-transform

1 1 X.z/ D ; jzj > ; 1 1 1 2 z ! 2 using the z-transform pair Z 1 anuŒn ! ; for jzj > jaj: 1 az1 By inspection we recognise that 1 n xŒn D uŒn: 2   Also, if X.z/ is a sum of terms then one may be able to do a term-by-term inversion by inspection, yielding xŒn as a sum of terms.

3.2 Partial fraction expansion

For any rational function we can obtain a partial fraction expansion, and identify the z-transform of each term. Assume that X.z/ is expressed as a ratio of polynomials in z1: M b zk X.z/ D kD0 k : N k PkD0 akz P

8 It is always possible to factor X.z/ as

b M .1 c z1/ X.z/ D 0 kD1 k ; a N 1 0 QkD1.1 dkz / where the ck’s and dk’s are the nonzeroQ zeros and poles of X.z/.  If M < N and the poles are all first order, then X.z/ can be expressed as

N Ak X.z/ D 1 : 1 dkz kXD1 In this case the coefficients Ak are given by A D .1 d z1/X.z/ k k zDdk : ˇ  If M  N and the poles are all first order, thenˇ an expansion of the form M N N A X.z/ D B zr C k r 1 d z1 rD0 k X kXD1 can be used, and the Br ’s be obtained by long division of the numerator by

the denominator. The Ak’s can be obtained using the same equation as for M < N .  The most general form for the partial fraction expansion, which can also deal with multiple-order poles, is

M N N A s C X.z/ D B zr C k C m : r 1 d z1 .1 d z1/m rD0 k mD1 i X kDX1;k¤i X Ways of finding the Cm’s can be found in most standard DSP texts. r The terms Br z correspond to shifted and scaled impulse sequences, and invert to terms of the form Br ıŒn r. The fractional terms

Ak 1 1 dkz

9 correspond to exponential sequences. For these terms the ROC properties must be used to decide whether the sequences are left-sided or right-sided. Example: inverse by partial fractions Consider the sequence xŒn with z-transform 1 C 2z1 C z2 .1 C z1/2 X.z/ D D ; jzj > 1: 3 1 1 2 1 1 1 1 2 z C 2 z .1 2 z /.1 z / Since M D N D 2 this can be expressed as

A1 A2 X.z/ D B0 C C : 1 1 1 z1 1 2 z

The value B0 can be found by long division:

2 1 2 3 1 2 1 2 z 2 z C 1 z C2z C1 z2 3z1C2  5z1 1 so 1 C 5z1 X.z/ D 2 C : 1 1 1 .1 2 z /.1 z / The coefficients A1 and A2 can be found using

A D .1 d z1/X.z/ ; k k zDdk ˇ so ˇ 1 C 2z1 C z2 1 C 4 C 4 A1 D 1 D D9 1 z 1 1 2 ˇz D2 ˇ and ˇ 1 C 2z1 C z2ˇ 1 C 2 C 1 A2 D D D 8: 1 1 1 z ˇ 1 1=2 2 ˇz D1 ˇ Therefore ˇ ˇ9 8 X.z/ D 2 C : 1 1 1 1 2 z 1 z

10 Using the fact that the ROC is jzj >1, the terms can be inverted one at a time by inspection to give

xŒn D 2ıŒn 9.1=2/nuŒn C 8uŒn:

3.3 Power series expansion

If the z-transform is given as a power series in the form

1 X.z/ D xŒnzn nD1 X D : : : C xŒ2z2 C xŒ1z1 C xŒ0 C xŒ1z1 C xŒ2z2 C :::; then any value in the sequence can be found by identifying the coefficient of the appropriate power of z1. Example: finite-length sequence The z-transform 1 X.z/ D z2.1 z1/.1 C z1/.1 z1/ 2 can be multiplied out to give 1 1 X.z/ D z2 z 1 C z1: 2 2 By inspection, the corresponding sequence is therefore

1 n D2 8 1 n D1 ˆ 2 ˆ xŒn D ˆ1 n D 0 ˆ <ˆ 1 2 n D 1 ˆ ˆ0 otherwise ˆ ˆ :ˆ

11 or equivalently 1 1 xŒn D 1ıŒn C 2 ıŒn C 1 1ıŒn C ıŒn 1: 2 2 Example: power series expansion Consider the z-transform

X.z/ D log.1 C az1/; jzj > jaj:

Using the power series expansion for log.1 C x/, with jxj <1, gives 1 .1/nC1anzn X.z/ D : n nD1 X The corresponding sequence is therefore

n .1/nC1 a n  1 xŒn D n 80 n  0: < Example: power series expansion: by long division Consider the transform 1 X.z/ D ; jzj > jaj: 1 az1 Since the ROC is the exterior of a circle, the sequence is right-sided. We therefore divide to get a power series in powers of z1:

1Caz1Ca2z2C 1 az1 1 1az1  az1 az1 a2z2 a2z2C or 1 D 1 C az1 C a2z2 C : 1 az1

12 Therefore xŒn D anuŒn. Example: power series expansion for left-sided sequence Consider instead the z-transform 1 X.z/ D ; jzj < jaj: 1 az1 Because of the ROC, the sequence is now a left-sided one. Thus we divide to obtain a series in powers of z:

a1za2z2 a C z z za1z2  az1 Thus xŒn DanuŒn 1.

4 Properties of the z-transform

In this section, if X.z/ denotes the z-transform of a sequence xŒn and the

ROC of X.z/ is indicated by Rx, then this relationship is indicated as Z xŒn !X.z/; ROC D Rx : Furthermore, with regard to nomenclature, we have two sequences such that Z x1Œn !X1.z/; ROC D Rx1 Z x2Œn !X2.z/; ROC D Rx2 :

4.1 Linearity

The linearity property is as follows: Z ax1Œn C bx2Œn !aX1.z/ C bX2.z/; ROC containsRx1 \ Rx1 :

13 4.2 Time shifting

The time-shifting property is as follows:

Z n0 xŒn n0 !z X.z/; ROC D Rx :

(The ROC may change by the possible addition or deletion of z D 0 or z D 1.) This is easily shown:

1 1 n .mCn0/ Y.z/ D xŒn n0z D xŒmz nD1 mD1 X 1 X D zn0 xŒmzm D zn0 X.z/: mD1 X Example: shifted exponential sequence Consider the z-transform 1 1 X.z/ D 1 ; jzj > : z 4 4 From the ROC, this is a right-sided sequence. Rewriting,

z1 1 1 X.z/ D D z1 ; jzj > : 1 1 1 1 4 1 4 z 1 4 z ! The term in brackets corresponds to an exponential sequence .1=4/nuŒn. The factor z1 shifts this sequence one sample to the right. The inverse z-transform is therefore xŒn D .1=4/n1uŒn 1: Note that this result could also have been easily obtained using a partial fraction expansion.

14 4.3 Multiplication by an exponential sequence

The exponential multiplication property is

Z n z0 xŒn !X.z=z0/; ROC D jz0jRx ; where the notation jz0jRx indicates that the ROC is scaled by jz0j (that is, inner and outer radii of the ROC scale by jz0j). All pole-zero locations are similarly scaled by a factor z0: if X.z/ had a pole at z D z1, then X.z=z0/ will have a pole at z D z0z1.

 If z0 is positive and real, this operation can be interpreted as a shrinking or expanding of the z-plane — poles and zeros change along radial lines in the z-plane.

j!0  If z0 is complex with unit magnitude (z0 D e ) then the scaling

operation corresponds to a rotation in the z-plane by and angle !0. That is, the poles and zeros rotate along circles centered on the origin. This can be interpreted as a shift in the , associated with in the by ej!0n. If the Fourier transform exists, this becomes

F ej!0nxŒn !X.ej.!!0//:

Example: exponential multiplication The z-transform pair

Z 1 uŒn ! ; jzj >1 1 z1 n can be used to determine the z-transform of xŒn D r cos.!0n/uŒn. Since j!0n j!0n cos.!0n/ D 1=2e C 1=2e , the signal can be rewritten as 1 1 xŒn D .rej!0 /nuŒn C .rej!0 /nuŒn: 2 2

15 From the exponential multiplication property, 1 Z 1=2 .rej!0 /nuŒn ! ; jzj > r 2 1 rej!0 z1 1 Z 1=2 .rej!0 /nuŒn ! ; jzj > r; 2 1 rej!0 z1 so 1=2 1=2 X.z/ D C ; jzj > r 1 rej!0 z1 1 rej!0 z1 1 1 r cos !0z D 1 2 2 ; jzj > r: 1 2r cos !0z C r z

4.4 Differentiation

The differentiation property states that Z dX.z/ nxŒn ! z ; ROC D R : dz x This can be seen as follows: since 1 X.z/ D xŒnzn; nD1 X we have dX.z/ 1 1 z Dz .n/xŒnzn1 D nxŒnzn D ZfnxŒng: dz nD1 nD1 X X Example: second order pole The z-transform of the sequence

xŒn D nanuŒn can be found using Z 1 anuŒn ! ; jzj > a; 1 az1

16 to be d 1 az1 X.z/ Dz D ; jzj > a: dz 1 az1 .1 az1/2  

4.5 Conjugation

This property is Z    x Œn !X .z /; ROC D Rx:

4.6 Time reversal

Here Z 1 xŒn !X .1=z/; ROC D : Rx

The notation 1=Rx means that the ROC is inverted, so if Rx is the set of values such that rR < jzj < rL, then the ROC is the set of values of z such that

1=rl < jzj < 1=rR. Example: time-reversed exponential sequence The signal xŒn D anuŒn is a time-reversed version of anuŒn. The z-transform is therefore 1 a1z1 X.z/ D D ; jzj < ja1j: 1 az 1 a1z1

4.7

This property states that

Z x1Œn  x2Œn !X1.z/X2.z/; ROC containsRx1 \ Rx2 :

17 Example: evaluating a convolution using the z-transform n The z-transforms of the x1Œn D a uŒn and x2Œn D uŒn are

1 1 X .z/ D anzn D ; jzj > jaj 1 1 az1 nD0 X and 1 1 X .z/ D zn D ; jzj > 1: 2 1 z1 nD0 X For jaj <1, the z-transform of the convolution yŒn D x1Œn  x2Œn is 1 z2 Y.z/ D D ; jzj > 1: .1 az1/.1 z1/ .z a/.z 1/ Using a partial fraction expansion, 1 1 a Y.z/ D ; jzj > 1; 1 a 1 z1 1 az1   so 1 yŒn D .uŒn anC1uŒn/: 1 a

4.8 Initial value theorem

If xŒn is zero for n<0, then

xŒ0 D lim X.z/: z!1

18 Some common z-transform pairs are:

Sequence Transform ROC ıŒn 1 All z 1 uŒn 1z1 jzj >1 1 uŒn 1 1z1 jzj <1 ıŒn m zm All z except 0 or 1 n 1 a uŒn 1az1 jzj > jaj n 1 a uŒn 1 1az1 jzj < jaj n az 1 na uŒn .1az1/2 jzj > jaj n az 1 na uŒn 1 .1az1/2 jzj < jaj n a 0  n  N 1; 1aN zN 1 jzj >0 80 otherwise 1az < 1 1cos.!0/z cos.!0n/uŒn 1 2 jzj >1 12 cos.!0/z Cz : 1 n 1r cos.!0/z r cos.!0n/uŒn 1 2 2 jzj > r 12r cos.!0/z Cr z

4.9 Relationship with the

Continuous-time systems and signals are usually described by the Laplace transform. Letting z D esT , where s is the complex Laplace variable

s D d C j!; we have z D e.dCj!/T D edT ej!T : Therefore

dT jzjD e and ^z D !T D 2f =fs D 2!=!s;

19 where !s is the sampling frequency. As ! varies from 1 to 1, the s-plane is mapped to the z-plane:  The j! axis in the s-plane is mapped to the unit circle in the z-plane.  The left-hand s-plane is mapped to the inside of the unit circle.  The right-hand s-plane maps to the outside of the unit circle.

20