• No results found

Systems Concepts

Frequency Analysis

4.3 Systems Concepts

As mentioned earlier,the z-transform is a powerful tool in analyzing digital systems. In this section,we introduce several techniques for describing and characterizing digital systems.

4.3.1 Transfer Functions

Consider the discrete-time LTI system illustrated in Figure 3.8. The system output is computed by the convolution sum defined as y…n† ˆ x…n†  h…n†. Using the convolution property and letting ZT‰x…n†Š ˆ X…z† and ZT‰ y…n†Š ˆ Y…z†,we have

Y…z† ˆ X…z†H…z†, …4:3:1†

where H…z† ˆ ZT‰h…n†Š is the z-transform of the impulse response of the system. The frequency-domain representation of LTI system is illustrated in Figure 4.3.

The transfer (system) function H(z) of an LTI system may be expressed in terms of the system's input and output. From (4.3.1),we have

H…z† ˆY…z†

X…z†ˆ ZT‰h…n†Š ˆ X1

nˆ 1

h…n†z n: …4:3:2†

Therefore the transfer function of the LTI system is the rational function of two polynomials Y(z) and X(z). If the input x(n) is the unit impulse d…n†,the z-transform of such an input is unity (i.e., X…z† ˆ 1),and the corresponding output Y…z† ˆ H…z†.

One of the main applications of the z-transform in filter design is that the z-transform can be used in creating alternative filters that have exactly the same input±output behavior. An important example is the cascade or parallel connection of two or more

x(n) h(n) y(n) = x(n)∗h(n)

Y(z) = X(z)H(z)

X(z) H(z)

ZT−1

ZT ZT

Figure 4.3 A block diagram of LTI system in both time-domain and z-domain

systems,as illustrated in Figure 4.4. In the cascade (series) interconnection,the output of the first system, y1…n†,is the input of the second system,and the output of the second system, y(n),is the overall system output. From Figure 4.4(a),we have

Y1…z† ˆ X…z†H1…z† and Y…z† ˆ Y1…z†H2…z†:

Thus

Y…z† ˆ X…z†H1…z†H2…z†:

Therefore the overall transfer function of the cascade of the two systems is H…z† ˆY…z†

X…z†ˆ H1…z†H2…z†: …4:3:3†

Since multiplication is commutative, H1…z†H2…z† ˆ H2…z†H1…z†,the two systems can be cascaded in either order to obtain the same overall system response. The overall impulse response of the system is

h…n† ˆ h1…n†  h2…n† ˆ h2…n†  h1…n†: …4:3:4†

Similarly,the overall impulse response and the transfer function of the parallel connection of two LTI systems shown in Figure 4.4(b) are given by

h…n† ˆ h1…n† ‡ h2…n† …4:3:5†

and

H…z† ˆ H1…z† ‡ H2…z†: …4:3:6†

x(n)

x(n) H1(z)

H1(z) H(z) H(z)

H2(z)

H2(z) y1(n)

X(z)

y(n)

y(n) Y(z) Y1(z)

y1(n)

y2(n) (a)

(b)

Figure 4.4 Interconnect of digital systems: (a) cascade form,and (b) parallel form

142 FREQUENCY ANALYSIS

If we can multiply several z-transforms to get a higher-order system,we can also factor z-transform polynomials to break down a large system into smaller sections.

Since a cascading system is equivalent to multiplying each individual system transfer function,the factors of a higher-order polynomial,H(z),would represent component systems that make up H(z) in a cascade connection. The concept of parallel and cascade implementation will be further discussed in the realization of IIR filters in Chapter 6.

Example 4.10: The following LTI system has the transfer function:

H…z† ˆ 1 2z 1‡ z 3: This transfer function can be factored as

H…z† ˆ 1 z 1

1 z 1 z 2

ˆ H1…z†H2…z†:

Thus the overall system H(z) can be realized as the cascade of the first-order system H1…z† ˆ 1 z 1and the second-order system H2…z† ˆ 1 z 1 z 2.

4.3.2 Digital Filters

The general I/O difference equation of an FIR filter is given in (3.1.16). Taking the z-transform of both sides,we have

Y…z† ˆ b0X…z† ‡ b1z 1X…z† ‡    ‡ bL 1z …L 1†X…z†

ˆ bh 0‡ b1z 1‡    ‡ bL 1z …L 1†i

X…z†: …4:3:7†

Therefore the transfer function of the FIR filter is expressed as

H…z† ˆY…z†

X…z†ˆ b0‡ b1z 1‡    ‡ bL 1z …L 1†ˆXL 1

lˆ0

blz 1: …4:3:8†

The signal-flow diagram of the FIR filter is shown in Figure 3.6. FIR filters can be implemented using the I/O difference equation given in (3.1.16),the transfer function defined in (4.3.8),or the signal-flow diagram illustrated in Figure 3.6.

Similarly,taking the z-transform of both sides of the IIR filter defined in (3.2.18) yields

Y…z† ˆ b0X…z† ‡ b1z 1X…z† ‡    ‡ bL 1z L‡1X…z† a1z 1Y…z†    aMz MY…z†

ˆ XL 1

lˆ0

blz l

!

X…z† XM

mˆ1

amz m

!

Y…z†: …4:3:9†

By rearranging the terms,we can derive the transfer function of an IIR filter as given in (4.3.10) is equivalent to the FIR filter described in (4.3.8).

The block diagram of the IIR filter defined in (4.3.10) can be illustrated in Figure 4.5,where A…z† and B…z† are the FIR filters as shown in Figure 3.6. The numerator coefficients bl and the denominator coefficients am are referred to as the feedforward and feedback coefficients of the IIR filter defined in (4.3.10). A more detailed signal-flow diagram of an IIR filter is illustrated in Figure 4.6 assuming that M ˆ L 1. IIR filters can be implemented using the I/O difference equation expressed in (3.2.18),the transfer function given in (4.3.10),or the signal-flow diagram shown in Figure 4.6.

4.3.3 Poles and Zeros

Factoring the numerator and denominator polynomials of H(z),Equation (4.3.10) can be further expressed as the rational function

x(n) y(n)

y(n−1) B(z)

A(z) z−1

Figure 4.5 IIR filter H(z) consists of two FIR filters A(z) and B(z)

b0

Figure 4.6 Detailed signal-flow diagram of IIR filter

144 FREQUENCY ANALYSIS

H…z† ˆb0

where a0ˆ 1. Without loss of generality,we let M ˆ L 1 in (4.3.11) in order to obtain

H…z† ˆ b0

The roots of the numerator polynomial are called the zeros of the transfer function H(z).

In other words,the zeros of H(z) are the values of z for which H…z† ˆ 0,i.e.,B…z† ˆ 0.

Thus H(z) given in (4.3.12) has M zeros at z ˆ z1, z2, . . . , zM. The roots of the denom-inator polynomial are called the poles,and there are M poles at z ˆ p1, p2, . . . , pM. The poles of H(z) are the values of z such that H…z† ˆ 1. The LTI system described in (4.3.12) is a pole±zero system,while the system described in (4.3.8) is an all-zero system.

The poles and zeros of H(z) may be real or complex,and some poles and zeros may be identical. When they are complex,they occur in complex-conjugate pairs to ensure that the coefficients amand blare real.

Example 4.11: Consider the simple moving-average filter given in (3.2.1). Taking the z-transform of both sides,we have

Y…z† ˆ1 L

XL 1

lˆ0

z lX…z†:

Using the geometric series defined in Appendix A.2,the transfer function of the filter can be expressed as

H…z† ˆY…z†

This equation can be rearranged as Y…z† ˆ z 1Y…z† ‡1

LX…z† z LX…z† :

Taking the inverse z-transform of both sides and rearranging terms,we obtain y…n† ˆ y…n 1† ‡1

L‰x…n† x…n L†Š:

This is an effective way of deriving (3.2.2) from (3.2.1).

The roots of the numerator polynomial zL 1 ˆ 0 determine the zeros of H(z) defined in (4.3.13). Using the complex arithmetic given in Appendix A.3,we have

zkˆ ej…2p=L†k, k ˆ 0,1, . . . , L 1: …4:3:14†

Therefore there are L zeros on the unit circle jzj ˆ 1. Similarly,the poles of H(z) are determined by the roots of the denominator zL 1…z 1†. Thus there are L 1 poles at the origin z ˆ 0 and one pole at z ˆ 1. A pole±zero diagram of H(z) given in (4.3.13) for L ˆ 8 on the complex plane is illustrated in Figure 4.7. The pole±zero diagram provides an insight into the properties of a given LTI system.

Describing the z-transform H(z) in terms of its poles and zeros will require finding the roots of the denominator and numerator polynomials. For higher-order polynomials, finding the roots is a difficult task. To find poles and zeros of a rational function H(z), we can use the MATLAB function roots on both the numerator and denominator polynomials. Another useful MATLAB function for analyzing transfer function is zplane(b, a),which displays the pole±zero diagram of H(z).

Example 4.12: Consider the IIR filter with the transfer function

H…z† ˆ 1

1 z 1‡ 0:9z 2:

We can plot the pole±zero diagram using the following MATLAB script:

b ˆ [1]; a ˆ [1, 1, 0.9];

zplane(b, a);

Similarly,we can plot Figure 4.7 using the following MATLAB script:

b ˆ [1, 0, 0, 0, 0, 0, 0, 0, 1]; a ˆ [1, 1];

zplane(b, a);

As shown in Figure 4.7,the system has a single pole at z ˆ 1,which is at the same location as one of the eight zeros. This pole is canceled by the zero at z ˆ 1. In this case, the pole±zero cancellation occurs in the system transfer function itself. Since the system

Re[z]

Im[z]

|z|=1 Zero

Pole

Figure 4.7 Pole±zero diagram of the moving-averaging filter, L ˆ 8

146 FREQUENCY ANALYSIS

output Y…z† ˆ X…z†H…z†,the pole±zero cancelation may occur in the product of system transfer function H(z) with the z-transform of the input signal X…z†. By proper selection of the zeros of the system transfer function,it is possible to suppress one or more poles of the input signal from the output of the system,or vice versa. When the zero is located very close to the pole but not exactly at the same location to cancel the pole,the system response has a very small amplitude.

The portion of the output y…n† that is due to the poles of X…z† is called the forced response of the system. The portion of the output that is due to the poles of H(z) is called the natural response. If a system has all its poles within the unit circle,then its natural response dies down as n ! 1,and this is referred to as the transient response. If the input to such a system is a periodic signal,then the corresponding forced response is called the steady-state response.

Consider the recursive power estimator given in (3.2.11) as an LTI system H(z) with input w…n† ˆ x2…n† and output y…n† ˆP

^

x…n†. As illustrated in Figure 4.8,Equation (3.2.11) can be rewritten as

y…n† ˆ …1 a†y…n 1† ‡ aw…n†:

Taking the z-transform of both sides,we obtain the transfer function that describes this efficient power estimator as

H…z† ˆ Y…z†

W…z†ˆ a

1 …1 a†z 1: …4:3:15†

This is a simple first-order IIR filter with a zero at the origin and a pole at z ˆ 1 a. A pole±zero plot of H(z) given in (4.3.15) is illustrated in Figure 4.9. Note that a ˆ 1=L results in 1 a ˆ …L 1†=L,which is slightly less than 1. When L is large,i.e.,a longer window,the pole is closer to the unit circle.

x(n) (•)2 w(n) = x2(n)

H(z) y(n) = Pˆx(n)

Figure 4.8 Block diagram of recursive power estimator

Re[z]

Im[z]

|z| = 1 Zero

Pole

Figure 4.9 Pole±zero diagram of the recursive power estimator

An LTI system H…z† is stable if and only if all the poles are inside the unit circle. That is,

jpmj < 1 for all m: …4:3:16†

In this case,lim

n!1fh…n†g ˆ 0. In other words,an LTI system is stable if and only if the unit circle is inside the ROC of H(z).

Example 4.13: Given an LTI system with transfer function H…z† ˆ z

z a: There is a pole at z ˆ a. From Table 4.3,we show that

h…n† ˆ an, n  0:

When jaj > 1,i.e.,the pole at z ˆ a is outside the unit circle,we have

n!1lim h…n† ! 1:

that is an unstable system. However,when jaj < 1,the pole is inside the unit circle, we have

n!1lim h…n† ! 0, which is a stable system.

The power estimator described in (4.3.15) is stable since the pole at 1 a

ˆ …L 1†=L < 1 is inside the unit circle. A system is unstable if H…z† has pole(s) outside the unit circle or multiple-order pole(s) on the unit circle. For example,if H…z†

ˆ z=…z 1†2,then h…n† ˆ n,which is unstable. A system is marginally stable,or oscilla-tory bounded,if H(z) has first-order pole(s) that lie on the unit circle. For example,if H…z† ˆ z=…z ‡ 1†,then h…n† ˆ … 1†n, n  0.

4.3.4 Frequency Responses

The frequency response of a digital system can be readily obtained from its transfer function. If we set z ˆ ej!in H(z),we have

H…z†

z ˆ ej! ˆ X1

nˆ 1

h…n†z n

z ˆ ej!ˆ X1

nˆ 1

h…n†e j!nˆ H…!†: …4:3:17†

Thus the frequency response of the system is obtained by evaluating the transfer function on the unit circle jzj ˆ jej!j ˆ 1. As summarized in Table 3.1,the digital frequency ! ˆ 2pf =fsis in the range p  !  p.

The characteristics of the system can be described using the frequency response of the frequency !. In general, H…!† is a complex-valued function. It can be expressed in polar form as

148 FREQUENCY ANALYSIS

H…!† ˆ jH…!†jejf…!†, …4:3:18†

where jH…!†j is the magnitude (or amplitude) response and f…!† is the phase shift (phase response) of the system at frequency !. The magnitude response jH…!†j is an even function of !,and the phase response f…!† is an odd function of !. We only need to know that these two functions are in the frequency region 0  !  p. The quantity jH…!†j2 is referred to as the squared-magnitude response. The value of jH…!0†j for a given H…!† is called the system gain at frequency !0.

Example 4.14: The simple moving-average filter expressed as

y…n† ˆ1

2‰x…n† ‡ x…n 1†Š, n  0

is a first-order FIR filter. Taking the z-transform of both sides and re-arranging the terms,we obtain

Therefore the phase response is

f…!† ˆ tan 1 tan !

As discussed earlier,MATLAB is an excellent tool for analyzing signals in the frequency domain. For a given transfer function, H(z),expressed in a general form in (4.3.10),the frequency response can be analyzed with the MATLAB function

[H, w]ˆ freqz(b, a, N);

which returns the N-point frequency vector w and the N-point complex frequency response vector H,given its numerator and denominator coefficients in vectors b and a,respectively.

Example 4.15: Consider the difference equation of IIR filter defined as

y…n† ˆ x…n† ‡ y…n 1† 0:9y…n 2†: …4:3:19a†

This is equivalent to the IIR filter with the transfer function

H…z† ˆ 1

1 z 1‡ 0:9z 2: …4:3:19b†

The MATLAB script to analyze the magnitude and phase responses of this IIR filter is listed (exam 4_15.m in the software package) as follows:

b ˆ [1]; a ˆ [1, 1, 0.9];

[H, w ]ˆ freqz(b, a, 128);

magH ˆ abs(H); angH ˆ angle(H);

subplot(2, 1, 1), plot(magH), subplot(2, 1, 2), plot(angH);

The MATLAB function abs(H)returns the absolute value of the elements of H and angle(H)returns the phase angles in radians.

A simple,but useful,method of obtaining the brief frequency response of an LTI system is based on the geometric evaluation of its pole±zero diagram. For example, consider a second-order IIR filter expressed as

H…z† ˆb0‡ b1z 1‡ b2z 2

1 ‡ a1z 1‡ a2z 2 ˆb0z2‡ b1z ‡ b2

z2‡ a1z ‡ a2 : …4:3:20†

The roots of the characteristic equation

z2‡ a1z ‡ a2ˆ 0 …4:3:21†

are the poles of the filter,which may be either real or complex. For complex poles, p1ˆ rejy and p2ˆ re jy, …4:3:22†

where r is radius of the pole and y is the angle of the pole. Therefore Equation (4.3.20) becomes

z rejy

z re jy

ˆ z2 2r cos y ‡ r2ˆ 0: …4:3:23†

Comparing this equation with (4.3.21),we have r ˆ 

a2

p and y ˆ cos 1… a1=2r†: …4:3:24†

The filter behaves as a digital resonator for r close to unity. The system with a pair of complex-conjugated poles as given in (4.3.22) is illustrated in Figure 4.10.

150 FREQUENCY ANALYSIS

r

r q q Im[z]

Re[z]

|z| = 1

Figure 4.10 A second-order IIR filter with complex-conjugated poles

Re[z]

Im[z]

z = ejw z = −1

p1

p2 V2 V1

U1

U2 z1

z2

Figure 4.11 Geometric evaluation of the magnitude response from the pole±zero diagram

Similarly,we can obtain two zeros,z1and z2,by evaluating b0z2‡ b1z ‡ b2 ˆ 0. Thus the transfer function defined in (4.3.20) can be expressed as

H…z† ˆb0…z z1† z z… 2† z p1

… † z p… 2† : …4:3:25†

In this case,the frequency response is given by

H…!† ˆb0…ej! z1† e… j! z2† ej! p1

… † e… j! p2† : …4:3:26†

Assuming that b0ˆ 1,the magnitude response of the system can be shown as

jH…!†j ˆU1U2

V1V2, …4:3:27†

where U1and U2 represent the distances from the zeros z1 and z2 to the point z ˆ ej!, and V1and V2are the distances of the poles p1and p2,to the same point as illustrated in Figure 4.11. The complete magnitude response can be obtained by evaluating jH…!†j as the point z moves from z ˆ 0 to z ˆ 1 on the unit circle. As the point z moves closer to the pole p1,the length of the vector V1decreases,and the magnitude response increases.

When the pole p1is close to the unit circle, V1becomes very small when z is on the same radial line with pole p1 …! ˆ y†. The magnitude response has a peak at this resonant frequency. The closer r is to the unity,the sharper the peak. The digital resonator is an elementary bandpass filter with its passband centered at the resonant frequency y. On the other hand,as the point z moves closer to the zero z1,the zero vector U1decreases as does the magnitude response. The magnitude response exhibits a peak at the pole angle, whereas the magnitude response falls to the valley at the zero.