7.
ECE 410 DIGITAL SIGNAL PROCESSING D. Munson
University of Illinois Chapter 7 A. Singer
Solution of Difference Equations (D.E.’s) Using z-Transform
Just as the Laplace transform was used to aid in the solution of linear differential equations, the
z-transform can be used to aid in the solution of linear difference equations. Recall that linear,
constant coefficient differential equations could be converted into algebraic equations by
transforming the signals in the equation using the Laplace transform. Derivatives could be
mapped into functions of the Laplace transform variable s, through the derivative law for
Laplace transforms. Similarly, delayed versions of a sequence can be mapped into algebraic
functions of z, using one of the delay rules for z-transforms.
In the case of continuous-time linear systems described by differential equations, in order to find
the response of such a linear system to an particular input, the differential equations needed to be
solved, using either time-domain or Laplace transform methods. For an Nth-order differential
equation, in general N conditions on the output were needed in order to specify the output in
response to a given input. Similarly, for linear difference equations of Nth-order, N pieces of
information are needed to find the output for a given input. Unlike the continuous-time case,
difference equations can often be simply iterated forward in time if these N conditions are
consecutive. That is, given y[-N+1], ... y[-1], then re-writing
N N
∑ a y[n − k ] =∑ b x[n − k ]
k =0
k
k =0
k
in the form
N N
y[0] = −∑ ak x[n − k ] + ∑ bk x[n − k ]
k =1 k =0
from which y[0] could be found. Iterating this process forward could find each value of the
output without ever explicitly obtaining a general expression for y[n].
In this chapter we will explore the z-transform for the explicit solution of linear constant
coefficient difference equations. The properties of the z-transform that we have developed can
be used to map the difference equations describing the relationship between the input and the
output, into a simple set of linear algebraic equations involving the z-transforms of the input and
output sequences. By solving the resulting algebraic equations for the z-transform of the output,
we can then use the methods we’ve developed for inverting the transform to obtain an explicit
expression for the output. We begin with an example.
Example
We revisit this simple linear, homogeneous difference equation, now using the unilateral z-
transform. Again consider the difference equation
y[n] − 3 y[n − 1] = 0, n ≥ 0, y[−1] = 2
Taking unilateral z-transform of both sides, and using the delay property, we obtain
7.2
Y ( z ) − 3z −1 [Y ( z ) + z y[−1]] = 0
Y ( z ) 1 − 3 z −1 = 6
which can be solved for Y( z ), yielding
6z
Y ( z) =
z –3
y[n] = 6(3) n u[n]
Another, slightly more involved example repeats a previous problem as well.
Example
Consider the following homogenous, linear constant coefficient difference equation, defined for
nonnegative n and with initial conditions shown
y[n] + 4 y[n − 1] + 4 y[n − 2] = 0, n ≥ 0, y[−1] = y[−2] = 1
Taking the z-transform of both sides, again using the delay property and including the initial
conditions, we obtain
Y ( z ) + 4 z −1 [Y ( z ) + zy[−1]] + 4 z −2 Y ( z ) + z y[−1] + z 2 y[−2] = 0
Y ( z )[1 + 4 z −1 + 4 z −2 ] = −4 y[−1] − 4 z −1 y[−1] − 4 y[−2]
−8 − 4 z −1
Y ( z) =
1 + 4 z −1 + 4 z −2
−8 z 2 − 4 z
= 2 .
z + 4z + 4
Since this is not in strictly proper rational form, we expand z −1Y ( z ) in a partial fraction
expansion, yielding
Y ( z ) −8 z − 4 A A2
= = 1 + .
z ( z + 2) 2
z + 2 ( z + 2) 2
Since we have repeated roots, we first seek the coefficient of the highest order root, A2. By cross
multiplying, we obtain
−8 z − 4 = A1 ( z + 2) + A2 .
From this equation, we can actually identify both coefficients. First by selecting z = -2, we obtain
A2 = (−8 z − 4) z = –2 = 12 .
We can also immediately identify A1 by matching terms of z on both sides, since the constant
terms on each side yield
−8 z = A1 z
−8 = A1.
Putting these terms into the PFE, we obtain
−8 z 12 z
Y ( z) = + .
( z + 2) ( z + 2) 2
We can now use linearity of the z-transform to invert each of the terms separately, obtaining,
y[n] = −8(−2) n − 6n (−2) n , n ≥ 0.
7.3
We now consider a case where the difference equation contains an input, or drive term, such that
we no longer have a homogenous difference equation.
Example
Consider the following linear constant coefficient difference equation.
n
3 1 1
y[n + 2] − y[n + 1] + y[n] = u[n], y[0] = 4, y[1] = 0
2 2 3
Taking the unilateral z-transform of both sides and using the advance property, we obtain
3 1 z
z 2 Y ( z ) – y[0] − z –1 y[1] − z [Y ( z ) − y[0]] + Y ( z ) =
2 2 1
z−
3
3 1 z
z 2 [Y ( z ) – 4] − z [Y ( z ) − 4] + Y ( z ) =
2 2 1
z−
3
3 1 z
Y ( z) z 2 − z + = + 4z 2 − 6z
2 2 z − 1
3
We can now solve for Y ( z ) and keep the terms on the right hand side separated into two groups,
namely,
1 z
Y ( z) = + 4z 2 − 6 z .
2 3 1 1
z − 2 z + 2 z − 3 term due
N to initial
term due conditions
to input
We can now write the z-transform as a sum of two terms, one due to the input, and one due to the
initial conditions. Recall from our analysis of linear constant coefficient difference equations
that these correspond to the zero-state response and the zero-input response of the system.
Taking these two terms separately, again through linearity of the transform, we have that
Y ( z ) = T1 ( z ) + T2 ( z )
where
z
T1 ( z ) =
2 3 1 1
z – z + z –
2 2 3
2
4z –6z
T2 ( z ) =
3 1
z2 – z +
2 2
Here, T1 ( z ) is the z-transform of the zero-state response, and T2 ( z ) is the z-transform of the zero-
input response. We can then take a partial fraction expansion of each of the terms
7.4
independently. For the first term, we find it convenient to express the partial fraction expansion
as
T1 ( z ) 1 A1 A2 A3
= = + + .
z 1 1 1 ( z –1) 1
z – ( z –1) z – z – z–
2 3 2 3
This leads to
A1 = −12, A2 = 3, A3 = 9
T1 ( z ) −12 3 9
= + + ,
z 1 ( z –1) 1
z– z–
2 3
and the resulting zero-state response is given by
n n
1 1
y x [n] = −12 + 3 + 9 , n ≥ 0 .
2 3
For the zero-input response term, we have that
T2 ( z ) 4z –6 B1 B2
= = + ,
z 1 1 ( z –1)
z – ( z –1) z –
2 2
from which we can quickly solve for the constants, yielding
B1 = 8, B2 = −4 ,
which gives the PFE for the zero-input response as
8z 4z
T2 ( z ) = − .
1 z −1
z–
2
So, zero-input response is
n
1
ys [n] = 8 − 4u, n ≥ 0 .
2
Putting the zero-state response and the zero-input response together, we obtain the total response
as
n n
1 1
y[n] = y x [n] + ys [n] = −4 − 1 + 9 , n ≥ 0 .
2 3
In general, this method of solution can be applied to linear constant coefficient difference
equations of arbitrary order. Note that while in this particular case we applied the time-advance
property of the unilateral z-transform, when solving a difference equation of the form
y[n] + a1 y[n − 1] + " + aN y[n − N ] = x[n], n ≥ 0 ,
with initial conditions y[-k], k =1, ... N, use the Delay Property #2.
7.5
General Form of Solution of Linear Constant Coefficient Difference Equations (LCCDE)s
In this section, we will derive the general form of a solution to a linear constant coefficient
difference equation. We will prove that the zero-state response (response to the input, when
state is initially zero) is given by a convolution. Consider the following difference equation
y[n + K ] + a1 y[ n + K − 1] + " + aN y[n] = x[n], n ≥ 0
together with initial conditions y[k], k = 0, 1, … , K – 1. Taking the one-sided z-transform of
both sides, and using the Advance Property, we obtain
K –1
K –2
z K Y ( z ) – ∑ y[m] z – m + a1 z K −1 Y ( z ) – ∑ y[m] z – m + " + aK −1 z [Y ( z ) − y[0]] + aK Y ( z ) = X ( z ).
m=0 m=0
By defining
K –1 K –2
S ( z ) = z K ∑ y[m] z – m + a1 z K −1 ∑ y[m] z – m + " + aK −1 zy[0],
m=0 m=0
we have that
Y ( z )[ z K + a1 z K −1 + " + aK ] = X ( z ) + S ( z ),
where the characteristic polynomial is given by
z K + a1 z K −1 + " + aK .
We now define the transfer function H(z),
1
H ( z) = K ,
z + a1 z +…+ aK
K –1
we obtain that
Y ( z ) = H ( z )[ N X ( z) + SN( z) ].
term due term due to
to the input initial conditions
Notice that the decomposition property holds with
ys [n] = Z –1 {H ( z ) S ( z )}
.
y
x [ n ] = Z –1
{ H ( z ) X ( z )}
Both homogeneity and superposition hold with respect to ys and yx because the z-transform is
linear. Linear constant coefficient difference equations (LCCDE)s describe linear systems,
which we have already explored in the time-domain (sequence-domain). It is worthwhile to
consider the form of the solution that ys[n] will take.
Consider first the case when the roots of the characteristic polynomial are distinct. In this case,
we have
S ( z) H ( z) B B B
= 1 + 2 +" + K .
z z – r1 z – r2 z – rK
From the definition of S( z ), z is a factor in S( z ), so there is no need for a B0/z term in the partial
fraction expansion. Multiplying by z, we have
Bz Bz B z
S ( z) H ( z) = 1 + 2 + " + K ,
z – r1 z – r2 z – rK
from which we can easily recover the sequence
7.6
K
ys [n] = ∑ Bi (ri ) n , n ≥ 0 ,
i =1
which is in the same form as yH[n] that we have already seen in the sequence-domain solution of
LCCDEs.
We can now observe the form of yx[n]. Since we have that
y x [n] = Z −1 { H ( z ) X ( z )} ,
the partial fraction expansion shows that y x [n] will involve terms both in y[n] and in x[n]. We
can also rewrite yx[n] using the convolution property:
n
y x [ n] = ∑ h[m] x [n – m] ,
m=0
Equation 10-1
where,
H ( z)
h[m] = Z −1 { H ( z )} = Z −1 z
z
D D D
= Z −1 z 0 + 1 +…+ K
z z – r1 z – rK
D + K D r n
0 ∑ i( i) n=0
i =1
=K
∑ Di ( ri )n n ≥1
i =1
which is in the same form as yH[n] and ys[n] for n ≥ 1. So, we see that yx[n] is given by a
convolution of the input with h[n] = Z–1 {H(z)}. What is {h[n]} ∞n =0 ? This can be interpreted as
the system unit pulse response (u.p.r.), or impulse response, assuming zero initial conditions.
Definition
The unit-pulse sequence, or the discrete-time impulse, is given by
1 n = 0
δ [n] = .
0 n ≠ 0
The system response to a unit pulse, or impulse, is given by,
n
y[n] = y x [n] = ∑ h[m]δ [n − m] = h[n] .
m=0
↓
assuming zero
initial conditions
We can explore the use of the impulse response to derive the response to more general signals
through another example.
7.7
Example
Consider the following linear system with input x[n] and output y[n] as shown
x[n] → linear system → y[n]
Suppose that when the input x[n] = δ[n] with zero initial conditions, then the output satisfies
y[n]=an for n ≥ 0. Again, assuming zero initial conditions (i.e. the system is initially at rest),
find y[n] due to the input x[n] = bn , n ≥ 0.
Solution:
Given h[n] = an, n ≥ 0, we know that the output satisfies y[n] = yx[n], since the initial
conditions are all zero, i.e. the system is initially at rest. From Equation 10-1Equation 10-1, we
have that
m
n n
a
y[n] = ∑ a b = b ∑
m n−m n
m=0 m=0 b
n +1
a
n +1 1 –
b b
= ( a ≠ b)
b a
1–
b
n +1 n +1
b –a
=
b–a
Comments
This discussion and these examples lead us to a number of conclusions about the solutions to
linear constant coefficient difference equations. First, we can show (and we will see in the next
sections) that the solution to a linear constant coefficient difference equation will have a
essentially the same form when the input is merely shifted in time. Also, we will see that a
similar for is maintained for inputs that are linear combinations of shifted versions of the input.
For example, the response to an input of the form x[n] will be similar in form to the response to
the input x[n] – 2 x[n – 1]. We will also see that the solution methods developed here, as well as
the unilateral z-transform, can be modified to accommodate situations when the input is applied
earlier or later than for n = 0. While we discussed situations here that included both the zero-
input response and the zero-state response, in practice we are generally interested in the zero-
state response, or equivalently, we are interested in the response to an input when the system of
interest is initially at rest. The reason for this is that we either have a system where the initial
conditions are all zero, or for a stable system, such that the roots of the characteristic polynomial
are all of modulus less than unity, ri < 1 , and that after some time, ys[n] has sufficiently
decayed, such that for time scales of interest for a given application, y[n] ≈ yx[n]. As a result,
from this point forward, we will assume that systems under discussion are initially at rest, and
that all initial conditions are set to zero. As a result, the output of a linear system will be taken