Analysis of LTI Systems Using the z-Transform

4.4 Analysis of LTI Systems Using the z-Transform

So far we have seen that the z-transform is a general way of describing and analyzing discrete-time sequences. Now we will see that the z-transform also plays a very important role in the description and analysis of discrete-time linear time(shift)-invariant (LTI) systems. This stems from the fact that an LTI system can

be characterized by the impulse response. Since the impulse response itself is a discrete-time signal, its z-transform, referred to as the system or transfer function, provides another way to characterize discrete-time LTI systems both in the time domain and in the frequency domain.

Let us consider a discrete-time causal LTI system with the impulse response g[n] and input x[n]. Then the output y[n] is the convolution of g[n] and x[n] given by Eq. (1.2.9) as

(4.4.1) so that, from the convolution property (4.2.6),

y [n] = g[n] ∗ x[n]

Y [z] = G[z]X[z]

4.4 Analysis of LTI Systems Using the z-Transform 225 where X [z], Y [z], and G[z] are the z-transforms of the input x[n], output y[n], and

impulse response g[n], respectively. Note that G[z] is referred to as the system or transfer function .

Remark 4.5 System Function, Pole Location, ROC, Causality, and Stability (1) Eqs. (4.4.2) and (3.2.8) have an interpretation of describing the input-output

relationship of a discrete-time LTI system in the z-domain and in the frequency domain, respectively. Comparing these two equations, we can state that the sys- tem function G[z], evaluated on the unit circle z = e jΩ , yields the frequency response G[e jΩ ] = G(Ω) of the system (Remark 4.2) if G(Ω) = F{g[n]} exists, or equivalently, the ROC of G[z] includes the unit circle. This is anal- ogous to the continuous-time case where the frequency response G(ω) can be obtained by evaluating the system function G(s) on the imaginary axis s = jω.

(2) Characteristics of a system such as stability and causality can be associated with the ROC and pole location of the system function G[z]. For example, if a system is causal, its impulse response g[n] is a right-sided sequence and therefore, the ROC of G[z] = Z{g[n]} must be the outside of the outermost pole (see Remark 4.4). If a system is stable, the ROC of G[z] includes the unit circle so that the frequency response G[e jΩ ] can be defined (see Remark 4.2). If a system is both causal and stable, then the ROC of G[z] must include the unit circle and be outside the outermost pole. It is implied that for a causal system to

be stable, all the poles of its system function G[z] must be inside the unit circle (Fig. 4.4(a) vs. (b)).

In particular, for systems characterized by linear constant-coefficient difference equations, the z-transform provides a very convenient procedure for obtaining the system function, frequency response, or time response. Consider a causal lin- ear time-invariant (LTI) system (in Fig. 4.5) whose input-output relationship is described by the following difference equation

[n − j] (4.4.3)

i =0

j =0

Im{z} Im{z} z-plane

z-plane

1 Re{z}

5 1 Re{z}

(a) All poles inside the unit circle (b) Not all poles inside the unit circle Fig. 4.4 Pole locations, ROC, unit circle, causality, and stability

226 4 The z-Transform Input

Output x [ n ]

Impulse response g [ n ]

∑ NA –1 i=0 a n–i ] = ∑ i NB –1 y [ j =0 b j x [ n –j ]

z-Transform of input

z-Transorm of output X [ z ]

System or transfer function G [ z]= Y [ z ] = B [ z ] Y [ z ] = G [ z ] X [ z ] X [ z ] A [ z]

X [ Ω ] Frequency response G (Ω) = Y(Ω) = B(Ω) Y ( Ω ) = G ( Ω ) X ( Ω ) Input spectrum

A(Ω) Output spectrum Fig. 4.5 The input–output relationship, system function, and frequency response of a discrete–time

X(Ω)

LTI system

where the initial conditions are given as y[n 0 ], y[n 0 − 1], · · · , y[n 0 − N A + 2]. This can be solved iteratively for the time response y[n] to an input x[n] starting from n = n 0 + 1:

(4.4.4) With zero initial conditions and the unit impulse input x[n] = δ[n], this yields

the impulse response y[n] = g[n]. To find the system function as the z-domain input-output relationship, we assume zero initial conditions and use the linearity

and time-shifting properties to take the z-transform of Eq. (4.4.3) as

[z]Y [z] = B[z]X[z]; Y [z]

b j z −j X [z]; A

with A[z] =

a i z −i and B[z] =

(4.4.5) This is referred to as the system function. Substituting z = e jΩ into the system

function or taking the DTFT of the impulse response g[n], we can obtain the fre- quency response of the system. Figure 4.6 shows the overall relationship among the time-domain relationship (in the form of difference equation), the system (or transfer) function, the impulse response, and the frequency response.

Frequency domain N A –1

Time domain

z -domain

∑ z-Transform

NB –1

i = 0 a i y [n–i ] = ∑ j = 0 b j x [n –j ] A [z ]Y [z ] = Inverse z-transform B [z ]X [z ]

A [z ] z = e jΩ zero initial conditions

Inverse z-transform

X [z ]

DTFT (discrete-time Fourier transform)

Fig. 4.6 The relationship between the impulse response, system function, and frequency response

4.4 Analysis of LTI Systems Using the z-Transform 227 Especially when we are interested only in right-sided sequences and causal lin-

ear systems, it is sensible to use the unilateral z-transform instead of the bilateral z -transform. It is the time shifting property that makes the unilateral z-transform particularly useful in analyzing causal systems described by difference equations with initial conditions.

Example 4.9 Difference Equation, System Function, and Impulse Response Consider a discrete-time causal LTI (linear time-invariant) system whose input- output relationship is described by the following difference equation:

(E4.9.1) (a) Find the system function G[z].

y [n] − y

4 [n − 1] − 8 [n − 2] = x[n − 1]

Applying the linearity and time-shifting properties of the z-transform or using Eq. (4.4.5), we can obtain the system function as

(z − 1/2)(z + 1/4) (b) Find the impulse response g[n].

1 − (1/4)z −1

− (1/8)z −2

Noting that the system is causal and accordingly, the ROC of G[z] is z > 1/2 (the outside of the circle passing through the outermost pole), we obtain the inverse z-transform of G[z] as

g partial fraction expansion [n] = Z −1 = (z − 1/2)(z + 1/4) B.9(5) 4 n

Alternatively, the impulse response can be obtained directly from the dif- ference equation, which can be solved iteratively with the unit impulse input x [n] = δ[n] and zero initial conditions:

where y[−1] = y[−2] = 0 and x[n − 1] = δ[n − 1] = 1 only for n = 1. n = 0 : y[0] = (1/4)y[−1] + (1/8)y[−2] + x[−1] = 0 − 0 + 0 = 0

n = 1 : y[1] = (1/4)y[0] + (1/8)y[−1] + x[0] = 0 − 0 + 1 = 1 n = 2 : y[2] = (1/4)y[1] + (1/8)y[0] + x[1] = 1/4 − 0 + 0 = 1/4 n = 3 : y[3] = (1/4)y[2] + (1/8)y[1] + x[2] = 1/16 + 1/8 + 0 = 3/16

228 4 The z-Transform

%sig04e09.m syms z, Gz=z/(zˆ2-(1/4)*z-1/8); %system function

g = iztrans(Gz) % symbolic inverse z transform N=16; nn=[0:N-1]; for n=0:N-1, gn(n+1) = eval(g); end % Solving the difference equation with the unit impulse input B= [1 0]; A= [1 -1/4 -1/8]; %numerator/denominator NB=length(B);

NA=length(A); xn = [0 1 zeros(1,N-1+NB)]; % x[n-1] impulse input delayed by one sample y = zeros(1,NA-1); % Initial condition for m=NA:NA+N-1

% To solve the difference equation iteratively y(m)= -A(2:NA)*y(m-[1:NA-1]).’ +B*xn(m-NA+[1:NB]).’;

end y = y(NA:NA+N-1); % Using filter() yp=[0 0]; xp=0; w0=filtic(B,A,yp,xp) %Initial condition from past history yn = filter(B,A,xn,w0) % With zero initial condition by default subplot(211) stem(nn,gn), hold on, pause, stem(nn,y(1:N),’r’), stem(nn,yn(1:N),’k.’) % To plot the frequency response N=64; dW=2*pi/N; W=[0:N]*dW; % frequency range GW = DTFT(gn,W); %DTFT of the impulse response GW1 = freqz(B,A,W); %substitute z=exp(j*W) into the system ftn B(z)/A(z) subplot(212), plot(W,abs(GW),’b’, W,abs(GW1),’r’)

The objective of the above program “sig04e09.m” is as follows: - Find the impulse response g[n] in two ways, that is, by taking the inverse z-

transform of the system function G[z] and by solving the difference equation for the output y[n] to the impulse input x[n] = δ[n]. The MATLAB built-in function

‘ filter()’ together with ‘filtic()’ (Sect. E.12) can also be used to obtain the output to any input and any initial condition. Also check if the two results conform to each other.

- Find the frequency response G(Ω) in two ways, that is, by taking the DTFT of

the impulse response g[n] and by substituting z = e jΩ into the system function

G [z] = B[z]/A[z], where the latter job is done by using the MATLAB built-in function ‘ freqz()’.

(cf) Comparing Eq. (E4.9.2) with Eq. (E4.9.3), we can tell that the poles of the system function, say, p 1 = 1/2 and p 2 = −1/4 yield the modes of the sys- tem, each of which determines how the corresponding output term evolves with time. See the stability theorem A.1.

Remark 4.6 Computational Method for Inverse z-Transform Example 4.9 suggests another way of obtaining the inverse z-transform. That is, we can regard a rational z-transform expression G[z] as a system function and set it equal to Y [z]/ X [z]. Then, cross multiplying yields the z-domain input-output relationship

4.4 Analysis of LTI Systems Using the z-Transform 229 Y [z]

B [z]

[z]Y [z] = B[z]X[z] with A[z] = N A−1

X [z] = G[z] =

A [z]

b j z −j . We can write the correspond- ing difference equation

a i z −i

and B[z] = N B−1

[n − j] (4.4.7)

i =0

j =0

and solve it iteratively with x[n] = δ[n] and zero initial conditions for y[n] in the forward/backward direction to get a right/left-sided sequence g[n] = Z −1 {G[z]}.

Just as with the long division method, this gives us no analytical solution in a closed form. Note the following fact:

Y [z] | X [z]=1 = G[z]X[z]| X [z]=1 = G[z] y [n] | x [n]=δ[n] =Z −1 {G[z]} = g[n]

(4.4.8) So far, we have never felt the necessity of the unilateral z-transform over the

bilateral one. Now, we are about to look at an initial value problem for which the unilateral transform is indispensable.

Example 4.10 Different Difference Equations Describing the Same System (a) Find the output y 1 [n] of the causal system whose input-output relationship is

described by y 1 [n] − a y 1 [n − 1] = x 1 [n − 1], n ≥ 0

(E4.10.1) where y 1 [−1] = y 0 and

(E4.10.2) (Solution)

1 [n] = b u s

To solve this difference equation for y 1 [n], we apply the time shifting property (4.2.3a) for Eq. (E4.10.1) to write its z-transform as

Y 1 [z] − a(z −1 Y 1 [z] + y 1 [−1]) = z −1 X 1 [z] + x 1 [−1]; (1 − az −1 )Y 1 [z] = a y 0 +z −1 X 1 [z]

(E4.10.3) since x (E4.10.2)

1 [−1] = b n u s [n] | n=−1 = 0. We can solve this algebraic equation for Y 1 [z] as

z Y 1 [z] =

ay 0 +z −1 (E4.10.4) 1−az −1

(a y 0 +z −1 X 1 [z]) =

z−a

z−b

230 4 The z-Transform To take the inverse z-transform of this expression, we divide its both sides by

z and perform the partial fraction expansion as Y 1 [z]

(z − a)(z − b)

z−a

Y 1 [z] = +

(E4.10.5) z−a

a−b z−a

z−b

Now we take the inverse z-transform to get the output as

−b n )u s [n] (E4.10.6)

a−b

Here, we replaced u s [n] by u s [n +1] to express the existence of the given initial

condition y 1 [−1] = y 0 . (b) Find the output y 2 [n] of the causal system whose input-output relationship is described by

y 2 [n + 1] − ay 2 [n] = x 2 [n], n ≥ 0 (E4.10.7) where y 2 [0] = y 0 and

(E4.10.8) (Solution)

x 2 [n] = x 1 [n − 1] = b n−1 u s

To solve this difference equation for y 2 [n], we apply the time shifting property (4.2.3b,a) for Eq. (E4.10.7) to write its z-transform as

z (Y 2 [z] − y 2 [0]) − aY 2 [z] = X 2 [z];

(z − a)Y 2 [z] = zy 0 +X 2 [z] = zy 0 +z −1 X 1 [z] (E4.10.9) since x (E4.10.2)

1 [−1] = b n u s [n] | n=−1 = 0. We can solve this algebraic equation for Y 2 [z] as

1 Y 2 [z] =

(E4.10.10) z−a

(zy 0 +z −1 X 1 [z]) =

(z − a)(z − b) To take the inverse z-transform of this expression, we divide its both sides by

z−a

z and perform the partial fraction expansion as

4.5 Geometric Evaluation of the z-Transform 231 Y 2 [z]

z−a

z (z − a)(z − b) y 0 1/ab

1/b(b − a) =

1/a(a − b)

(E4.10.11) z−a

b z−b Now we take the inverse z-transform to get the output as

=y u s [n] + (a n−1 −b n−1 )u s [n − 1] (E4.10.12)

a−b

Here, u s [n] is replaced by u s [n − 1] to show that the 2 nd and 3 rd terms cancel each other at n = 0.

(cf) Comparing Eqs. (E4.10.6) and (E4.10.12), we see that y 1 [n − 1] = y 2 [n]. This can be verified by showing that

Z{y 1 [n − 1]} = Y 2 [z] = Z{y 2 [n]} (E4.10.13) (Proof) Z{y (4.2.3a)

1 [n − 1]} =z −1 (Y 1 [z] + y 1 [−1]z) = z −1 (Y 1 [z] + y 0 z )

1 1 (4.10.10) =z −1 (

(z y 0 +z −1 X 1 [z]) =Y 2 [z] z−a

(z a y 0 +X 1 [z]) + y 0 z )=

z−a

(E4.10.14) The justification is as follows: The two LTI systems of (a) and (b) are inherently

the same. Compared with (a), the initial conditions and input of (b) are delayed by n 1 = 1 and consequently, the output of the system (b) is also delayed by n 1 = 1.