The z-transform provides a systematic algebraic technique for solving linear difference equations with constant coefficients subject to given initial or boundary conditions, exactly analogously to the role of the Laplace transform in solving ordinary differential equations.
In control engineering, digital signal processing, and sampled-data systems, signals are observed as sequences of discrete pulses occurring at sampling instants k=0,1,2,…. The sequential relationship between past and present sample values is governed by a difference equation.
Definition
Linear Difference Equation with Constant Coefficients
An equation relating an unknown discrete sequence x(k) at two or more integer arguments is called a difference equation. A linear n-th order difference equation with constant coefficients has the general form
A0x(k+n)+A1x(k+n−1)+A2x(k+n−2)+⋯+Anx(k)=f(k),
with prescribed initial conditions
x(0)x(1)x(n−1)=α0,=α1,…,=αn−1,
where A0,A1,…,An are real constants (A0=0), n is a positive integer (the order of the equation), and f(k) is a prescribed discrete driving signal.
Worked Out Examples: Difference Equations
Example 1
1
Solve the difference equation x(k+2)+3x(k+1)+2x(k)=0 with conditions x(0)=0, x(1)=1, and x(k)=0 for k<0 using the z-transform.
Taking the z-transform of both sides: The difference equation is
x(k+2)+3x(k+1)+2x(k)=0.
Applying the z-transform to both sides:
Z[x(k+2)]+3Z[x(k+1)]+2Z[x(k)]=Z[0],
z2[X(z)−x(0)−x(1)z−1]+3z[X(z)−x(0)]+2X(z)=0.
Substituting initial conditions and solving for X(z): Substitute x(0)=0 and x(1)=1:
z2[X(z)−z−1]+3zX(z)+2X(z)=0⟹(z2+3z+2)X(z)−z=0.
Solving for X(z):
X(z)=z2+3z+2z=(z+1)(z+2)z.
Decomposing into partial fractions and inverting: Expanding into partial fractions:
X(z)=z+1z−z+2z.
Taking the inverse z-transform of each term:
x(k)for k=Z−1[z+1z]−Z−1[z+2z]=(−1)k−(−2)k≥0.
Answer:
x(k)=(−1)k−(−2)kfor k≥0(k=0,1,2,…).
Example 2
2
Solve the difference equation x(k+2)−1.3x(k+1)+0.4x(k)=δ(k) with conditions x(0)=0, x(1)=0, where δ(k) is the unit impulse function (δ(0)=1 and δ(k)=0 for k=0) and x(k)=0 for k<0, using the z-transform.
Transforming the difference equation: Taking the z-transform of both sides using Z[δ(k)]=1:
Z[x(k+2)]−1.3Z[x(k+1)]+0.4Z[x(k)]=Z[δ(k)],
z2[X(z)−x(0)−x(1)z−1]−1.3z[X(z)−x(0)]+0.4X(z)=1.
Applying initial conditions: Using x(0)=0 and x(1)=0:
Solve the difference equation (k+1)x(k+1)−x(k)=0 with x(0)=1 using the z-transform.
Shifting the index and setting up the transform: Shift the index by replacing k with k−1:
kx(k)−x(k−1)=0⟹kx(k)=x(k−1).
Taking the z-transform of both sides using Z[kx(k)]=−zdzdX and Z[x(k−1)]=z−1X(z):
−zdzdX=z−1X(z)⟹z2dzdX+X(z)=0.
Solving the differential equation for X(z): Separating variables:
X1dX+z21dz=0⟹logeX−z1=logec⟹X(z)=ce1/z.
Expanding as power series and determining constant c: Expanding e1/z:
X(z)=c(1+1!z−1+2!z−2+3!z−3+…)⟹x(k)=k!c.
Applying the initial condition x(0)=1:
x(0)=0!c=c⟹c=1.
Therefore, x(k)=k!1 for k≥0.
Answer:
x(k)=k!1for k≥0(k=0,1,2,…).
Example 8
8
Solve the difference equation x(k+2)+3ax(k+1)+2a2x(k)=0, where a is a constant, and obtain the general solution x(k) in terms of initial conditions x(0) and x(1).
Taking the z-transform: Taking the z-transform of the equation:
z2[X(z)−x(0)−x(1)z−1]+3az[X(z)−x(0)]+2a2X(z)=0,
(z2+3az+2a2)X(z)=x(0)z2+[x(1)+3ax(0)]z.
Setting up partial fractions for X(z)/z: Factor the denominator: z2+3az+2a2=(z+a)(z+2a).
Solve the difference equation x(k)−x(k−1)+0.5x(k−2)=u(k), where u(k)=1 for k≥0 is the unit step function, with initial conditions x(−1)=0,x(−2)=0, using the z-transform.
Taking the z-transform with delay: For a causal sequence with zero initial conditions prior to k=0, Z[x(k−n)]=z−nX(z):
X(z)−z−1X(z)+0.5z−2X(z)=Z[u(k)]=z−1z,
(1−z−1+0.5z−2)X(z)=z−1z⟹X(z)=(z−1)(z2−z+0.5)z3.
Finding poles: Denominator roots are z=1 (simple pole) and
z2−z+0.5=0⟹z=21±1−2=0.5±0.5i=21e±iπ/4.
Evaluating residues and inverting: Residue at simple pole z=1:
Application of Z-Transform to Find the Sum of Series
The z-transform converts the problem of evaluating infinite or finite discrete series into evaluating or inverting a closed-form rational function X(z).
Theorem
Sum of Infinite and Finite Series via Z-Transform
Let Z[x(k)]=X(z)=k=0∑∞x(k)z−k with region of convergence ∣z∣>R.
Infinite Series Summation: For any complex constant a lying strictly inside the region of convergence (∣a∣>R):
k=0∑∞x(k)a−k=X(a).
In particular, if z=1 lies inside the ROC (R<1), then k=0∑∞x(k)=X(1).
Finite (Partial) Series Summation: The running sum s(n)=k=0∑nx(k) satisfies the difference relation s(n)−s(n−1)=x(n) with s(−1)=0. By the shifting theorem:
As noted in the erratum, the printed formula in the textbook had an incorrect sign and factor in the constant term.
Answer:
Printed: 252k+25(−3)k(5k−3)
Question 9
Solve the difference equation using the z-transform method:
x(k+1)−x(k−1)where u(k) is the unit step function, with x(0)=u(k)=0
Advancing the difference equation: Given x(k+1)−x(k−1)=u(k) with x(0)=0 (assuming causality x(k)=0 for k<0). For k=0: x(1)−x(−1)=u(0)⟹x(1)−0=1⟹x(1)=1. Advancing the equation by one step (k→k+1):
x(k+2)−x(k)for k=u(k+1)=u(k)≥0.
Taking the z-transform: Taking the unilateral z-transform with x(0)=0 and x(1)=1:
z2[X(z)−z−1]−X(z)=z−1z.
(z2−1)X(z)−z=z−1z⟹(z2−1)X(z)=z+z−1z=z−1z2.
Thus:
X(z)=(z−1)2(z+1)z2.
Expanding in partial fractions and inverting: Dividing by z:
Taking the inverse z-transform: Inverting term by term:
x(k)for k=202k+43(−2)k−54(−3)k≥0.
The printed answer (x(k)=202k+4(−2)k−5(−3)k) is a misprint; see the erratum.
Answer:
Printed:
x(k)=202k+4(−2)k−5(−3)kfor k≥0
Question 12
Solve the difference equation using the z-transform method:
x(k)+0.25x(k−1)=δ(k)+31δ(k−1)
Taking the z-transform: Assuming initial rest (x(−1)=0), apply the shifting property:
Z{x(k)}Z{x(k−1)}=X(z),=z−1X(z).
For the unit impulses, Z{δ(k)}=1 and Z{δ(k−1)}=z−1. Taking the z-transform of both sides:
X(z)+0.25z−1X(z)=1+31z−1.
Factoring out X(z):
(1+0.25z−1)X(z)=1+31z−1⟹X(z)=1+0.25z−11+31z−1.
Expressing in terms of standard transform pairs: Divide the numerator by the denominator:
1+0.25z−11+31z−1=34−1+0.25z−131.
In terms of z:
X(z)=34−31z+0.25z.
Taking the inverse z-transform: Inverting using the standard pairs Z−1{1}=δ(k) and Z−1{z−az}=ak for k≥0:
x(k)=34δ(k)−31(−0.25)kfor k≥0.
Evaluating the first few terms gives x(0)=1, x(1)=121, x(2)=−481. The printed answer (x(k)=34−31(−0.25)k) incorrectly included a constant step term instead of an impulse; see the erratum.
Answer:
Printed:
x(k)=34−31(−0.25)kfor k≥0
Question 13
Solve the difference equation using the z-transform method:
x(k+3)−3x(k+1)+2x(k)with x(0)=0=4,x(1)=0,x(2)=8
Taking the z-transform of the third-order equation: Given x(k+3)−3x(k+1)+2x(k)=0 with x(0)=4, x(1)=0, and x(2)=8. Applying the time-shifting property: