Chapter 14
The z-Transform for Discrete-Time Signals
In This Chapter
Traveling to the z-domain with the two-sided z-transform
Appreciating the ROC for left- and right-sided sequences
Using partial fraction expansion to return to the time domain
Checking out z-transform theorems and pairs
Visualizing how pole-zero geometry controls the frequency response
The z-transform (ZT) is a generalization of the discrete-time Fourier transform (DTFT) (covered in Chapter 11) for discrete-time signals, but the ZT applies to a broader class of signals than the DTFT. The ZT notation is also more user friendly than the DTFT. For example, linear constant coefficient (LCC) difference equations (see Chapter 7) can be solved by using just algebraic manipulation when the ZT is involved.
Here’s the deal: When a discrete-time signal is transformed with the ZT, it becomes a function of a complex variable; the DTFT creates a function of a real frequency variable only. The transformed signal is said to be in the z-domain.
The ZT closely parallels the Laplace transform (see Chapter 13) for continuous-time signals, and you can use the ZT to analyze signals and the impulse response of linear time-invariant (LTI) systems.
In this chapter, I introduce the two-sided ZT, which allows you to transform signals that cover the entire time axis. When computing the ZT, you immediately bump into the region of convergence (ROC), which tells you where the transform exists. This chapter also describes important ROC properties that offer insight into the nature of a signal or system.
The Two-Sided z-Transform
The two-sided or bilateral z-transform (ZT) of sequence is defined as , where z is a complex variable. The ZT operator transforms the sequence to , a function of the continuous complex variable z. The relationship between a sequence and its transform is denoted as .
You can establish the connection between the discrete-time Fourier transform (DTFT) and the ZT by first writing (polar form):
The special case of evaluates over the unit circle — sweeps around the unit circle as varies — and is represented as — the DTFT of (see Chapter 11). This result holds as long as the DTFT is absolutely summable (read: impulse functions not allowed).
The view that is sampled around the unit circle in the z-plane () shows that the DTFT has period because for k an integer. When , , , , and . See this solution in Figure 14-1.
Figure 14-1: The unit circle in the z-plane and the relation between and .
The Region of Convergence
The ZT doesn’t converge for all sequences. When it does converge, it’s only over a region of the z-plane. The values in the z-plane for which the ZT converges are known as the region of convergence (ROC).
The right side of this equation shows that x[n]r-n is absolutely summable (the sum of all terms is less than infinity). This condition is consistent with the absolute summability condition for the DTFT to converge to a continuous function of (see Chapter 11).
Figure 14-2: The general ROC is an annulus.
The significance of the ROC
The ROC has important implications when you’re working with the ZT, especially the two-sided ZT. When the ZT produces a rational function, for instance, the roots of the denominator polynomial are related to the ROC. And for LTI systems having a rational ZT, the ROC is related to a system’s bounded-input bounded-output (BIBO) stability. The uniqueness of the ZT is also ensured by the ROC.
To find and the ROC, follow these steps:
1. Reference the definition to determine the sum:
2. Find the condition for convergence by summing the infinite geometric series:
Thus, the ROC is .
3. To find the sum of Step 1 in closed form, use the finite geometric series sum formula (see Chapter 2):
The geometric series convergence condition corresponds with the ROC. In Examples 14-2 and 14-3, I find the ROC from the geometric series convergence condition.
If the sum looks unfamiliar in its present form, you can change variables in the sum, an action known as re-indexing the sum, by letting , then in the limits , , and in the sum itself :
Note: Both from Example 14-1 and from Example 14-2 have the same ZT. The ROCs, however, are complements; the ZTs are thus distinguishable only by the ROCs being different, demonstrating that you need the ROC to return to the time domain without ambiguity — is it left-sided or right-sided? The rest of this chapter focuses exclusively on right-sided sequences, because they correspond to the most common scenarios.
Plotting poles and zeros
For rational functions, such as the of Examples 14-1 and 14-2, you want to plot the pole and zero locations in the z-plane as well as the ROC. A rational takes the form , where and are both polynomials in either z or . The roots of , where , are the zeros of , and the roots of are the poles of .
Check out the pole-zero plot of , including the ROC, for and in Figure 14-3.
Figure 14-3: The pole-zero plot and ROC of (a) and (b), of Examples 14-1 and 14-2.
The ROC and stability for LTI systems
An LTI system is BIBO stable if the impulse response is absolutely summable, which means that the sum of all terms |h[n]| is less than infinity (see Chapter 6). To relate this to the ROC, consider the corresponding ZT , also known as the system function. You can find out whether the ROC of H(z) includes the unit circle by setting and then checking for absolute summability:
Here, you can conclude that, yes, the ROC of a BIBO stable system must include the unit circle.
Carrying the analysis a bit further, the poles of must sit outside the ROC because the poles of sit at singularities, points where is unbounded. For right-sided sequences, the ROC is the exterior of a circle with a radius corresponding to the largest pole radius of . This is the case in Example 14-1, where has a pole at .
For the special case of a causal system, in which for , the poles of must lie inside the unit circle because right-sided sequences, where causal sequences are a special case, have an ROC that’s the exterior of the largest pole radius of . In short, poles inside the unit circle ensure stability of causal discrete-time LTI systems.
The ROC is the intersection of the two ROCs unless a pole-zero cancellation occurs. So, tentatively, the ROC is . When placed over a common denominator, is
The system pole-zero plot and ROC are shown in Figure 14-4.
Figure 14-4: Pole-zero plot of a two-pole causal and stable system.
Finite length sequences
If has finite length (finite impulse response [FIR] in this case), then will converge everywhere as long as is finite for all nonzero values. If is nonzero only on , then the ZT of is simply . Here, the ROC is the entire z-plane, excluding perhaps and/or .
If contains negative powers of z, then the ROC must exclude (ROC: ) to avoid the singularity. Similarly, if contains positive powers of z, then the ROC must exclude (ROC: ) to remain bounded.
Because includes only negative powers of z, ROC: . What about the poles and zeros? The denominator (poles) is clear, but you may be stuck on the numerator (zeros). The roots of are given by , (see Chapter 2 for details on the N roots of unity). The pole at cancels the zero at . Putting it all together, you get the following:
This equation shows zeros equally spaced around a circle of radius a, excluding and poles at . The pole-zero plot is shown in Figure 14-5 for .
Figure 14-5: Pole-zero plot for an exponentially weighted window having length .
You may have noticed that the number of poles and zeros plotted is always equal to each other. This is a property of X(z) when it’s a ratio of polynomials in z or z-1. Figure 14-5 shows N – 1 poles at z = 0 and N – 1 zeros spread around a circle of radius a.
In some instances, a pole or zero may be at infinity! Consider the one-zero system (z – a). As , , which is the behavior of a pole at infinity. Likewise, consider the one-pole system 1/(z – a). As , , which is the behavior of a zero at infinity. The next example investigates a pole at infinity following sequence shifting.
1. Apply the definition of the ZT:
2. From , find that the zeros are , the two poles are at , and ROC is .
3. Generate the pole-zero plot in Figure 14-6 by using PyLab and the custom function ssd.zplane(b,a,radius=2)
.
Then check this on your own, using the available ssd.py
Python code module.
In [17
]: ssd.zplane([1,-3/2.,-1],[1],2.25)
Figure 14-6: A pole-zero plot generated by using zplane([1,-3/2.,-1],[1],2.25)
.
If you shift to the left one sample (let ), , then the ZT becomes
which still has zeros at 2 and –1/2. Now the poles are at zero and infinity. You need the pole at infinity to equalize the pole-zero count and account for the fact that as , which is the behavior of a pole at infinity. Shifting to the right one sample (let ) introduces a zero at infinity; the ZT goes to zero as .
Returning to the Time Domain
After working in the z-domain, you need to get your signal back to the time domain to work with it as a true signal once again, following some z-domain operations, such as filtering. The quick way back is through the inverse z-transform.
Formally, the inverse z-transform requires contour integration, a function of a complex variable. With a contour integral, you integrate on a closed curve in the z-plane instead of using an ordinary integral along a line. Note that I said formally. The most practical way to return from the z-domain is to form a partial fraction expansion (PFE) (see Chapter 2) and then apply the inverse z-transform to each term of the expansion by using a table of z-transform pairs.
If you can’t directly find from a list of transform pairs, such as you can find in Figure 14-8, then you can use PFE to decompose X(z) into a sum of terms that each have an inverse transform readily available. In this book, assume that is expressed in negative powers of z. Start here:
Ensure that is proper rational, or . If it isn’t, you need to use long division to reduce the order of the denominator. Example 14-6 demonstrates the long division process for polynomials written in terms of negative powers of z.
When , is an improper rational function. Following long division, you end up with
Here, is the remainder polynomial from long division, having degree less than N.
In this section, I run through a few PFE considerations and include examples that point out how these considerations play out in the real world.
Working with distinct poles
For the case distinct poles, if you assume that is proper rational and contains no repeated roots (poles), then you can write where the ’s are the nonzero poles of and the Rk’s are the PFE coefficients.
For the case of negative powers of z, the PFE coefficients are given by the residue formula:
If you need to perform long division, be sure to augment your final solution with the long division quotient terms .
Managing twin poles
When the pole for is repeated once (a multiplicity of two), you augment the expansion form as follows:
For the distinct poles, you can find the coefficients by using the residue formula from the previous section. For the coefficient, use a modified version of the residue formula:
Find by substitution. (This step is covered in Example 14-7.)
Performing inversion
After you complete the PFE, move on to using the inverse transform of the form , , and to get the signal back to the time domain, one by one. Unless stated otherwise, assume that the ROC is the exterior of a circle whose radius corresponds to the largest pole radius of X(z). This assumption makes the corresponding time-domain signals right-sided.
Here’s the table lookup for each of the three transform types:
Using the table-lookup approach
This section contains two inverse z-transform (IZT) examples that describe how to complete PFE with the table-lookup approach. The first example requires long division but has only distinct poles; the second doesn’t require long division but has one pole repeated. In both examples, you follow these steps:
1. Find out whether X(z) is a proper rational function; if not, perform long division to make it so.
2. Find the roots of the denominator polynomial and make note of any repeated roots.
3. Write the general PFE of X(z) in terms of undetermined coefficients.
4. Solve for the coefficients by using a combination of the residue formula and substitution techniques as needed.
5. Apply the IZT to the individual PFE terms by using table lookup.
6. Check your solution by using a computer tool, such as Python.
Here’s the process for returning this signal to the time domain:
1. Because the numerator and denominator are both second degree, reduce the numerator order to one or less by using long division.
In this case, you want to reduce the numerator to order zero:
The numbers are deceptively simple in this example, so work carefully.
2. Factor the denominator polynomial to find the roots.
Breathe easy, it’s already done for you in this example, but you could have started with 1 – (1/4)z–1 – (1/8)z–2. Notice that the roots, 1/2 and –1/4 are distinct.
3. Using the results of long division and the roots identified in Step 2, write out the general PFE so you can see the coefficients you need to find.
4. Solve for and coefficients, using the residue formula:
5. With the PFE coefficients and long division quotient in hand, apply the inverse transform to the terms of the PFE:
The ROC is the exterior of a circle of radius 1/4 so all the time-domain terms are right-sided. Carry out the inversion of each term:
6. Check your work with PyLab and the SciPy signal
package function R,p,K = residuez(b,a)
.
The ndarray b
contains the numerator coefficients, and a
contains the denominator coefficients. The function returns a tuple of three ndarrays, R
(the residues), p
(the poles), and K
(the results of long division):
In [
7
]: R,p,K = signal.residuez([1,2,1],[1,-.25,-.125])
In [
8
]: R
Out[
8
]: array([3., 6.])
In [
9
]: p
Out[
9
]: array([-0.25, 0.5 ])
In [
10
]: K
Out[10
]: array([-8.])
The Python check agrees with the hand calculation!
Now go through the six-step process:
1. Examine X(z); if you find it to be proper rational as M = 0 and N = 2, no long division is required.
2. Factor the denominator polynomial to find the roots.
Here, the denominator polynomial is already in factored form, and the roots are 1/2 and 1/4 with the 1/4 repeated, making this a multiplicity of two.
3. Write the general PFE with one root repeated:
4. Using the residue formula, find that the coefficient R1 is 4. Using the modified residue formula, find that the coefficient S2 is –1.
At this point, you have the following:
Use substitution to solve for S1 in the expansion by choosing a convenient value for z–1 that doesn’t place a zero in the denominator of any term. Choosing gives you the equation . With all the coefficients solved for, write
5. Because the ROC is the exterior of a circle of radius 1/2, all the time-domain terms are right-sided; carry out the inversion of each term to get this equation:
6. Multiply out the denominator polynomial and then check your work with Python:
Load the numerator and denominator coefficients into residuez()
:
In [
33
]: R,p,K = signal.residuez([1],[1.,-1., 5/16.,-1/32.])
In [
34
]: R
Out[
34
]: array([-2.+0.j, -1.+0.j, 4.+0.j])
In [
35
]: p
Out[
35
]: array([0.25+0.j, 0.25+0.j, 0.50+0.j])
In [
36
]: K
Out[36
]: array([0.])
Nice. Total agreement with the hand calculation.
Surveying z-Transform Properties
The ZT has many useful theorems and transform pairs. The transform theorems can be applied generally to any signal, but the transform pairs involve a specific signal and corresponding z-transform. The transform pairs in this section emphasize right-sided signals and causal systems because that’s the emphasis of this chapter. This means that the ROC is generally the exterior of a circle having finite radius.
Transform theorems
You can find some useful z-transform theorems in Figure 14-7. All these theorems are valuable, but some are used more frequently than others. For instance, the linearity theorem (Line 1) is especially popular because it allows you to break down big problems into smaller pieces. The proof follows immediately from the definition of the ZT.
Figure 14-7: Useful ZT theorems.
In the following sections, I lavish some special attention on two theorems — the delay and convolution theorems — because they apply to so many of the problems you’re likely to encounter as an electrical engineer.
Delay
One of the most widely used ZT theorems is delay (also sometimes called time shift): . Here, the ROC is the ROC of , denoted , with the possible exclusion of zero or infinity depending on both and the sign of .
The proof follows from the definition and the substitution :
Convolution
The convolution theorem of sequences is fundamental when working with LTI systems. It can be shown that , where the or larger if pole-zero cancellation occurs.
You can develop the proof of the convolution in two steps:
1. Insert the convolution sum into the ZT and then change the sum order:
2. Change variables on the inner sum by letting .
The inner sum becomes H(z), and the outer sum becomes X(z):
Transform pairs
Transform pairs are the lifeblood of working with the ZT. If you need to transform a signal or inverse transform a z-domain function, start by consulting a transform pairs table. Combined with theorems, these pairs practically give you super powers. Some basic transform pairs are developed in Examples 14-1 and 14-2, earlier in this chapter.
The transform pair developed is
Working with the delay theorem and linearity makes this pair into Line 5 of Figure 14-8.
Find a short table of z-transform pairs in Figure 14-8, which emphasizes right-sided sequences because that’s the focus of this chapter.
Figure 14-8: Common ZT pairs.
Leveraging the System Function
The system function H(z) for LTI discrete-time systems, like its counterpart for continuous-time signals H(s) (see Chapter 13), plays an important role in the design and analysis of systems. Of special interest are LTI systems that are represented by a linear constant coefficient (LCC) difference equation.
When you couple the system function with the convolution theorem, you have the capability to model signals passing through systems entirely in the z-domain. In this section, I show you how the poles and zeros work together to shape the frequency response of a system.
The general LCC difference equation describes a causal system where the output y[n] is related to input x[n], M past inputs and N past outputs (see Chapter 7). You can find the system function by taking the z-transform of both sides of this equation and using linearity and the delay theorem, form the ratio of to get
This works as a result of the convolution theorem (see Figure 14-7), or .
gives you the impulse response, .
reveals the step response.
provides the output in response to input .
Applying the convolution theorem
The convolution theorem gives you some powerful analysis capabilities. When you write Y(z) = X(z)H(z), the door opens to the time-domain, z-domain, and even frequency-domain results for the input, output, and the system itself. You can find Y(z), y[n] (via the inverse z-transform), and . You can also find X(z) if you’re given Y(z) first as well as H(z), because X(z) = Y(z)/H(z).
In some cases, you may have the time-domain quantities y[n] and/or h[n] instead, but getting to the z-domain is no problem because and . Or, given X(z) and Y(z), you can discover the system function H(z) with a starting point of the time-domain quantities.
To find the system output , the most direct approach is to find and then calculate the inverse transform to get . Using transform pair Line 3 from Figure 14-8, you can write
Solve for the coefficients:
By calculating the inverse z-transform term by term, you get this equation: .
Check your results in PyLab or Maxima to verify that your hand calculations are correct.
Finding the frequency response with pole-zero geometry
The poles and zeros of a system function control the frequency response . Consider the following development:
where pk and zk are the poles and zeros of and , and are the frequency response contributions of each pole and zero. The vectors point from the zero and pole locations to the point on the unit circle. This gives you a connection between the pole-zero geometry and the frequency response. In particular, the ratio of vector magnitudes, , is the magnitude response. The phase response is .
Two custom software apps, PZ_Geom
and PZ_Tool
, at www.dummies.com/extras/signalsandsystems
can help you further explore the relationship between frequency response and pole-zero location.
PZ_Geom
app: You can load a predefined system or filter or load custom coefficients and then see the pole-zero geometry with the geometry lines to represent the vectors and that change as you drag with the mouse. A marker on the magnitude and frequency response follows along in adjacent plots.
PZ_Tool
app: You can place and then drag poles and zeros arbitrarily over the z-plane to see the magnitude and phase response change interactively as poles and zeros are moved.
This system contains single numerator and denominator vectors, so the geometry is rather simple: . The software app PZ_Geom
allows you to see magnitude and angle of the vectors change as is changed by dragging the mouse. The result is that you're able to explore the relationship between frequency response and pole-zero location. A screen shot of PZ_geom
is shown Figure 14-9.
Figure 14-9: The pole-zero geometry app allows you to drag the point on the unit circle.