In
signal processing, a digital biquad filter is a second order
recursive linear filter
Linear filters process time-varying input signals to produce output signals, subject to the constraint of linearity. In most cases these linear filters are also time invariant (or shift invariant) in which case they can be analyzed exactly using ...
, containing two
poles
Poles,, ; singular masculine: ''Polak'', singular feminine: ''Polka'' or Polish people, are a West Slavic nation and ethnic group, who share a common history, culture, the Polish language and are identified with the country of Poland in Ce ...
and two
zeros. "Biquad" is an abbreviation of "''biquadratic''", which refers to the fact that in the
Z domain, its
transfer function is the ratio of two
quadratic function
In mathematics, a quadratic polynomial is a polynomial of degree two in one or more variables. A quadratic function is the polynomial function defined by a quadratic polynomial. Before 20th century, the distinction was unclear between a polynomial ...
s:
:
The coefficients are often normalized such that ''a''
0 = 1:
:
High-order
IIR filters can be highly sensitive to
quantization of their coefficients, and can easily become
unstable. This is much less of a problem with first and second-order filters; therefore, higher-order filters are typically implemented as serially-cascaded biquad sections (and a first-order filter if necessary). The two poles of the biquad filter must be inside the unit circle for it to be stable. In general, this is true for all discrete filters i.e. all poles must be inside the unit circle in the Z-domain for the filter to be stable.
Implementation
Direct form 1
The most straightforward implementation is the direct form 1, which has the following
difference equation
In mathematics, a recurrence relation is an equation according to which the nth term of a sequence of numbers is equal to some combination of the previous terms. Often, only k previous terms of the sequence appear in the equation, for a parameter ...
:
:
or, if normalized:
:
Here the
,
and
coefficients determine zeros, and
,
determine the position of the poles.
Flow graph of biquad filter in direct form 1:

When these sections are cascaded for filters of order greater than 2, efficiency of implementation can be improved by noticing the
delay of a section output is cloned in the next section input. Two storage delay components may be eliminated between sections.
Direct form 2
The direct form 2 implements the same normalized transfer function as direct form 1, but in two parts:
:
and using the
difference equation
In mathematics, a recurrence relation is an equation according to which the nth term of a sequence of numbers is equal to some combination of the previous terms. Often, only k previous terms of the sequence appear in the equation, for a parameter ...
:
:
Flow graph of biquad filter in direct form 2:

The direct form 2 implementation only needs ''N'' delay units, where ''N'' is the order of the filter – potentially half as much as direct form 1. This structure is obtained by reversing the order of the numerator and denominator sections of direct Form 1, since they are in fact two linear systems, and the commutativity property applies. Then, one will notice that there are two columns of delays (
) that tap off the center net, and these can be combined since they are redundant, yielding the implementation as shown.
The disadvantage is that direct form 2 increases the possibility of arithmetic overflow for filters of high ''Q'' or resonance. It has been shown that as ''Q'' increases, the round-off noise of both direct form topologies increases without bounds. This is because, conceptually, the signal is first passed through an all-pole filter (which normally boosts gain at the resonant frequencies) before the result of that is saturated, then passed through an all-zero filter (which often attenuates much of what the all-pole half amplifies).
The direct form 2 implementation is called the canonical form, because it uses the minimal amount of delays, adders and multipliers, yielding in the same transfer function as the direct form 1 implementation.
Transposed direct forms
Each of the two direct forms may be transposed by reversing the flow graph without altering the transfer function. Branch points are changed to summers and summers are changed to branch points.
These provide modified implementations that accomplish the same transfer function which can be mathematically significant in a real-world implementation where precision may be lost in state storage.
The
difference equation
In mathematics, a recurrence relation is an equation according to which the nth term of a sequence of numbers is equal to some combination of the previous terms. Often, only k previous terms of the sequence appear in the equation, for a parameter ...
s for transposed direct form 2 are:
:
where
: