What is Difference equation?

An equation that expresses the output of a discrete-time system as a weighted sum of present and past inputs and past outputs. For example, y[n] = x[n] + 0.5y[n − 1] adds half of the previous output to the present input. One without past outputs on the right-hand side is an FIR filter, and one with past outputs (with feedback) is usually an IIR filter whose impulse response continues forever. Given initial values it can be computed step by step and implemented directly in software or hardware. Applying the z-transform to both sides gives the transfer function H(z).

Japanese name: 差分方程式

Difference equation appears in 2 practice questions across 1 topic, including Digital Signal Processing Basics.

Field: Digital Signal Processing Basics

Try it: questions about Difference equation

A unit step (x[n] = 1 for n ≥ 0) is applied from n = 0 to the system described by the difference equation y[n] = x[n] + 0.5y[n − 1]. With y[−1] = 0, which of the following is y[2]?

  1. A1.75
  2. B1.875
  3. C2
Show answer and explanation

Answer: A. 1.75

Step by step, y[0] = 1 + 0.5 × 0 = 1, y[1] = 1 + 0.5 × 1 = 1.5 and y[2] = 1 + 0.5 × 1.5 = 1.75. Continuing gives y[n] = 2 − 0.5ⁿ, which approaches the final value 1/(1 − 0.5) = 2. Because past outputs are used (there is feedback), this is an IIR filter whose impulse response 0.5ⁿ continues forever.

Which of the following is the transfer function H(z) = Y(z)/X(z) of the system described by the difference equation y[n] = x[n] + 0.5x[n − 1] + 0.25y[n − 1]?

  1. A(1 + 0.5z⁻¹)/(1 + 0.25z⁻¹)
  2. B(1 − 0.25z⁻¹)/(1 + 0.5z⁻¹)
  3. C(1 + 0.5z⁻¹)/(1 − 0.25z⁻¹)
Show answer and explanation

Answer: C. (1 + 0.5z⁻¹)/(1 − 0.25z⁻¹)

A delay of one sample corresponds to multiplying by z⁻¹ in the z-transform, so transforming both sides gives Y(z) = X(z) + 0.5z⁻¹X(z) + 0.25z⁻¹Y(z). Collecting the Y(z) terms on the left gives (1 − 0.25z⁻¹)Y(z) = (1 + 0.5z⁻¹)X(z), so H(z) = (1 + 0.5z⁻¹)/(1 − 0.25z⁻¹). The numerator holds the coefficients on the input side and the denominator those of the output feedback; z = 0.25, which makes the denominator 0, is a pole, and z = −0.5, which makes the numerator 0, is a zero.

Questions that mention Difference equation (2)

  1. A unit step (x[n] = 1 for n ≥ 0) is applied from n = 0 to the system described by the difference equation y[n] = x[n] + 0.5y[n − 1]. With y[−1] = 0, which of the following is y[2]?
  2. Which of the following is the transfer function H(z) = Y(z)/X(z) of the system described by the difference equation y[n] = x[n] + 0.5x[n − 1] + 0.25y[n − 1]?

Books on Digital Signal Processing Basics Ad

As an Amazon Associate I earn from qualifying purchases.

Related terms

IIR filter Impulse response z-transform Convolution Decimation Discrete Fourier transform Fast Fourier transform (FFT) FIR filter Frequency resolution Group delay

Back to the glossary