Signals & systems · 07 · Dynamics, one tick at a time · 8 min
HardDifference equations
Replace “rate of change” with “change since the last tick” and differential equations become difference equations — the native dynamics of anything digital. Every audio filter and control loop in your devices is one of these, running in real time.
Build the intuition
Recurrence is the discrete derivative
A differential equation constrains y′(t); a difference equation constrains y[n] in terms of y[n−1], y[n−2], …. You've met one: compound interest, y[n] = 1.05·y[n−1] — the discrete twin of y′ = ky, with the same exponential personality (rⁿ instead of e^{kt}).
Feedback gives memory — and character
When y[n] depends on past outputs (not just inputs), the system has feedback: echoes that echo, balances that compound. Feedback systems can ring and resonate exactly like spring-mass systems — the discrete oscillator y[n] = 2r cos θ·y[n−1] − r²·y[n−2] produces decaying cosines rⁿcos(nθ), the digital cousin of the damped oscillator you just met.
Stability lives inside the unit circle
Continuous systems decay when exponents have negative real part; discrete systems decay when the growth factor r satisfies |r| < 1 — multiplying by r each tick must shrink. r is the radius of a pole, and “poles inside the unit circle” is the stability law every digital filter designer checks first. The full machinery (the z-transform) awaits in the next course.
See it move
The discrete oscillator's two dials: r (shrink per tick) and θ (rotation per tick). Stability is r < 1 — watch it break at the circle's rim.
A worked example
An echo effect in one line
Guitar pedal echo: output = input + a fainter copy of the output from 0.3 s ago. At 44,100 samples/s, that's 13,230 ticks:
The recurrence:
Each echo re-echoes at 0.6 strength: 0.6, 0.36, 0.216… — a geometric decay, stable because 0.6 < 1. Set the gain to 1.05 and the pedal screams: instability isn't abstract, it's feedback howl.
Out in the world
Thermostats, cruise control, insulin pumps
Discrete-time feedback controllers measure, compare to target, adjust, and wait a tick — a difference equation looping forever. Tuning them (respond fast, don't oscillate, never go unstable) is exactly the pole-placement craft this lesson opens.
Common confusion, cleared
“Difference equations are approximations of the “real” differential ones.”
In digital systems they're the exact dynamics — the filter genuinely computes y[n] from y[n−1]. Discrete isn't a degraded continuous; it's its own first-class world.
“A tiny feedback coefficient can't cause much trouble.”
Stability is about pole radius, not coefficient size alone — and r = 1.001 diverges, just slowly. Many real-world failures are slightly-outside-the-circle bugs that took hours to blow up.
Recap
- Difference equations: dynamics in ticks — y[n] from recent ys and xs.
- Feedback creates memory, ringing, and resonance, mirroring continuous systems.
- Stability: every pole radius |r| < 1 — inside the unit circle.
Progress saves in this browser.