Skip to main content

Direct programming of a first-order filter

Short answer

Direct programming uses the difference equation y(k)=-0.5y(k-1)+2x(k)-0.6x(k-1). The block diagram has feedforward gains 2 and -0.6, feedback gain -0.5, and two delay elements.

Construct the block diagram for the following pulse-transfer function system (a digital filter) by direct programming: G(z)=(2-0.6z⁻¹)/(1+0.5z⁻¹).

Step 1: Difference equation

Y(z)X(z)=2−0.6z−11+0.5z−1  ⇒  Y(z)(1+0.5z−1)=X(z)(2−0.6z−1)\frac{Y(z)}{X(z)} = \frac{2 - 0.6z^{-1}}{1 + 0.5z^{-1}} \;\Rightarrow\; Y(z)(1 + 0.5z^{-1}) = X(z)(2 - 0.6z^{-1}) y(k)=−0.5y(k−1)+2x(k)−0.6x(k−1)y(k) = -0.5y(k-1) + 2x(k) - 0.6x(k-1)

Step 2: Direct programming block diagram

Each delayed input and output term is formed with its own delay element and added in a summer:

x(k)
  o--[2]-------->(S)--------------o--> y(k)
  |               ^               |
[z^-1]            |             [z^-1]
  | x(k-1)        |               | y(k-1)
  o--[-0.6]----->(S)<[-0.5]-------o
  • Feed-forward: x(k)x(k) with gain 2, and x(k−1)x(k-1) with gain −0.6-0.6.
  • Feedback: y(k−1)y(k-1) with gain −0.5-0.5.
  • Direct programming uses 1+1=21 + 1 = 2 delays.

For comparison, standard programming needs only one delay: w(k)=x(k)−0.5w(k−1)w(k) = x(k) - 0.5w(k-1) and y(k)=2w(k)−0.6w(k−1)y(k) = 2w(k) - 0.6w(k-1).

The pole at z=−0.5z = -0.5 is inside the unit circle, so the filter is stable.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Control System chapter 4 questions →