# Digital filter A **digital filter** is a system that performs arithmetic on a sampled, discrete-time signal to reduce or enhance chosen aspects of it, in contrast to an analog filter, which shapes a continuous voltage or current directly with resistors, capacitors and inductors. Because the same arithmetic runs unchanged wherever it is deployed, a digital filter's response depends only on its coefficients and the sampling rate, never on component tolerance or temperature drift — the exactness and reprogrammability that has moved most filtering that does not have to happen at radio frequency onto a processor. The primary microsim on this page puts that arithmetic on a single second-order stage: dragging one pole around the complex z-plane moves a resonant peak through the frequency response and stretches or collapses the ringing in the impulse response, the same picture that separates every finite impulse response filter from every infinite impulse response one. The filter's own equation, a [[Recurrence_relation|recurrence relation]] rather than a differential equation, is `y[n] = sum(b_k x[n-k]) - sum(a_k y[n-k])`, and every question the rest of this article asks — how the filter is characterised, how it is designed, how it is realised in hardware, and how it compares with an analog filter built for the same job — is really a question about the coefficients in that one line. ## Characterization A digital filter's behaviour is entirely fixed by the sequence of numbers it produces from a sequence of numbers it is given: no continuous voltage or current is involved until an [[Analog-to-digital_converter|analog-to-digital converter]] and a [[Digital-to-analog_converter|digital-to-analog converter]] sit on either side of it. Two equivalent descriptions capture that behaviour completely. ### Analysis techniques #### Impulse response The [[Impulse_response|impulse response]] h[n] is the output produced when the input is a single sample of value one, preceded and followed by zeros. Because the filter is linear and time-invariant, its response to any input at all is the convolution of that input with h[n], so h[n] alone predicts the output for every possible input. Whether h[n] settles to exactly zero after a finite number of samples or rings on indefinitely is the split between [[Finite_impulse_response|finite impulse response]] and [[Infinite_impulse_response|infinite impulse response]] design, the two branches this article compares throughout. #### Difference equation The same filter is written as a difference equation. Its purely feed-forward form, `y[n] = sum_{k=0}^{M} b_k*x[n-k]`, is the general finite impulse response filter,[^stib072] built with no feedback at all;[^stib076] adding a feedback sum, `y[n] = sum b_k*x[n-k] - sum a_k*y[n-k]`, extends it to the infinite impulse response case. The [[Z-transform|z-transform]] turns either recurrence into an algebraic expression in `z^-1`, and evaluating that expression on the unit circle, `z = exp(j*omega_hat)`, is what actually produces the frequency response plotted below.[^stib071] ## Filter design Designing a digital filter starts from a specification — the edges of the passband and stopband, the ripple allowed inside each, and the sampling rate — and ends with a set of coefficients that meets it as closely as the chosen filter order allows. [[Filter_design|Filter design]] then splits along the same line as the two structures compared throughout this article: an [[Finite_impulse_response|FIR]] design problem is usually solved directly for the impulse response itself, most simply by windowing an ideal but infinitely long response down to a finite length, while an [[Infinite_impulse_response|IIR]] design problem is more often solved by taking a proven continuous-time prototype and mapping its poles and zeros into the digital domain, carrying the analog prototype's known trade-off between roll-off and ripple across into a difference equation with feedback. ## Filter realization Once coefficients are fixed, a realization is the actual arrangement of multiplies, adds and delays that computes them each sample period; different realizations of the identical transfer function differ in memory used, in numerical sensitivity to rounding, and in how directly the diagram maps onto the difference equation. ### Direct form I Direct form I implements the difference equation exactly as written: every feed-forward tap `b_k` multiplies a separately delayed copy of the input, every feedback tap `a_k` multiplies a separately delayed copy of the output, and the two sums are added. It needs a separate delay line for the input history and for the output history, more storage than the arrangement below, but keeps the feed-forward and feedback halves of the computation visibly apart. ### Direct form II Direct form II computes an intermediate sequence with the feedback part of the equation first and then forms the output as the feed-forward sum applied to that intermediate sequence rather than to the input directly, which lets the feed-forward and feedback delay lines share a single set of registers. This canonical form uses the fewest delays possible for a given order, though its transposed variant is often preferred in fixed-point hardware for how rounding error propagates through it.[^citeneeded1] ### Cascaded second-order sections A filter of high order is rarely built as one large direct-form block. Its transfer function is instead factored into second-order sections, each realizing one conjugate pole pair and one conjugate zero pair, connected in series, because rounding a high-order filter's coefficients directly can move a pole enough to make the whole filter unstable, while the same rounding error applied separately to several low-order sections stays small. The z-transform's pole–zero factorization is what makes the split possible: multiplying several second-order [[Transfer_function|transfer functions]] together reproduces the original filter exactly in exact arithmetic, and very nearly so once every coefficient is rounded to a fixed number of bits. ### Other forms Lattice, parallel and state-space realizations trade the same coefficients for different numerical and hardware properties again: a lattice structure suits an [[Adaptive_filter|adaptive filter]] that must update its own coefficients while running, a parallel decomposition splits a transfer function into simple first- or second-order pieces that are added rather than cascaded, and a state-space form generalises the recurrence to several coupled state variables at once. ## Comparison of analog and digital filters A digital filter is exactly repeatable: the same coefficients applied to the same input numbers always give the same output numbers, with none of the component tolerance, temperature drift or ageing that changes an analog filter's response over its working life, and a digital filter can realise responses, an exactly linear phase among them, that have no simple analog counterpart. Its price is the hardware built around it. An analog-to-digital converter and, if the result must leave the digital domain, a digital-to-analog converter both add delay and [[Quantization_(signal_processing)|quantization]] error from representing a continuous value with a finite number of bits, and the [[Nyquist_frequency|Nyquist frequency]] set by the sampling rate is a hard ceiling that no amount of clever design can move. An [[Analog_signal|analog]] filter, by contrast, processes the true continuous signal directly, at frequencies limited only by its physical components rather than by a processor's clock, and needs no conversion at either end, which is why radio-frequency filtering above what an affordable converter can sample is still done with inductors, capacitors and acoustic resonators rather than arithmetic. ## Types of digital filters Every digital filter is either [[Finite_impulse_response|finite impulse response]], covered in its own article, or [[Infinite_impulse_response|infinite impulse response]], covered in its own article in turn — the two differ enough in design method, stability and cost that each supports a full treatment on its own. An [[Adaptive_filter|adaptive filter]] belongs to either family but changes its own coefficients while running, using an algorithm such as least-mean-squares to track a signal or a channel that is itself changing, which is how an echo canceller or a noise-cancelling headset keeps working as its acoustic environment shifts. A [[Nonlinear_system|nonlinear]] filter, a median filter over a sliding window being the simplest example, cannot be described by any transfer function at all, because its output is not a fixed weighted sum of its inputs, yet it removes some kinds of noise, an occasional bad sample among them, better than any linear filter can. Statistical filters such as the [[Kalman_filter|Kalman filter]] and the [[Wiener_filter|Wiener filter]] again share the name without sharing the fixed-passband idea, choosing their effective response from a model of the signal and the noise instead of from a specification of cutoff frequencies. ## Microsims The primary microsim, *Digital filter*, puts a single second-order (biquad) stage under direct control. Two sliders set the pole radius r (0 to about 0.985) and the pole angle theta (roughly 0.06 to 3.08 radians, up to the Nyquist frequency at theta = pi), and a button cycles the filter's coefficient preset from a resonant IIR case to an FIR-equivalent case whose poles sit at the origin. Four linked panels update every frame: the magnitude and phase of the frequency response swept from 0 to pi radians per sample, a z-plane view showing the pole pair relative to the unit circle, and an impulse-response panel that runs the actual recurrence `y[n] = b0*x[n] + b1*x[n-1] + b2*x[n-2] - a1*y[n-1] - a2*y[n-2]` and reports in words whether the response is finite or, in the sketch's own phrase, "still ringing... (infinite)." A three.js companion, built from the same z-plane idea, lays a biquad's coefficients out on the transfer function's own sheet in more depth than is covered here. *Try:* Push the pole-radius slider up toward its maximum and watch the resonant peak in the magnitude panel sharpen while the impulse panel's ringing stretches almost to the edge of the window. ## Wikipedia : Wikitube **Strict pair:** [Wikipedia](https://en.wikipedia.org/wiki/Digital_filter) : [Wikitube](https://en.wikitube.io/wiki/Digital_filter) Skeleton mirrored at revision 1373886481. Prose, emphasis and the microsims are Wikitube's own. ## See also - [[Finite_impulse_response]] - [[Infinite_impulse_response]] - [[Adaptive_filter]] - [[Z-transform]] - [[Filter_(signal_processing)]] - [[Digital_signal_processing]] - [[Transfer_function]] ## References The general theory used above — realizations, the z-transform's algebra, and the sources of numerical error in a cascade — is standard textbook material and is not separately footnoted beyond the figures below, per the Wikitube style guide §6.1. [^stib072]: Stiber, M.; Stiber, B.; Larson, E. *Signal Computing: Digital Signals in the Software Domain*. 2020, p. 72 (PDF page). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/signal-computing-digital-signals-in-the-software-domain. CC BY-SA. [^stib076]: Stiber, M.; Stiber, B.; Larson, E. *Signal Computing: Digital Signals in the Software Domain*. 2020, p. 76 (PDF page). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/signal-computing-digital-signals-in-the-software-domain. CC BY-SA. [^stib071]: Stiber, M.; Stiber, B.; Larson, E. *Signal Computing: Digital Signals in the Software Domain*. 2020, p. 71 (PDF page). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/signal-computing-digital-signals-in-the-software-domain. CC BY-SA. [^citeneeded1]: Citation needed: a primary reference (textbook chapter or manufacturer application note) for the claim that the transposed Direct Form II is generally preferred over Direct Form II in fixed-point hardware; the general numerical-sensitivity argument is standard, but the specific hardware preference is not pinned to a source here. ## Further reading - Stiber, M.; Stiber, B.; Larson, E. *Signal Computing: Digital Signals in the Software Domain* (2020). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/signal-computing-digital-signals-in-the-software-domain - Tiberius, C.; Mulder, M. *Engineering Signal Analysis: From Fourier to filtering: Theory* (2026). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/engineering-signal-analysis-from-fourier-to-filtering-theory - Johnson, D. *Fundamentals of Electrical Engineering I* (2014). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/fundamentals-of-electrical-engineering-1 - Downey, A. *Think DSP: Digital Signal Processing in Python* (2012). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/think-dsp-digital-signal-processing-in-python <!-- Hubs: Signal_processing. Portals: PORTAL_Signal_Processing. Signal Processing portal wave 1 · 2026-09-17 · drafted. -->