Digital biquad filter
   HOME

TheInfoList



OR:

In
signal processing Signal processing is an electrical engineering subfield that focuses on analyzing, modifying and synthesizing ''signals'', such as sound, images, and scientific measurements. Signal processing techniques are used to optimize transmissions, ...
, a digital biquad filter is a second order
recursive Recursion (adjective: ''recursive'') occurs when a thing is defined in terms of itself or of its type. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in mathematics ...
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 C ...
and two zeros. "Biquad" is an abbreviation of "''biquadratic''", which refers to the fact that in the Z domain, its
transfer function In engineering, a transfer function (also known as system function or network function) of a system, sub-system, or component is a mathematical function that theoretically models the system's output for each possible input. They are widely used ...
is the ratio of two quadratic functions: :\ H(z)=\frac The coefficients are often normalized such that ''a''0 = 1: :\ H(z)=\frac High-order
IIR filter Infinite impulse response (IIR) is a property applying to many linear time-invariant systems that are distinguished by having an impulse response h(t) which does not become exactly zero past a certain point, but continues indefinitely. This is i ...
s can be highly sensitive to quantization of their coefficients, and can easily become
unstable In numerous fields of study, the component of instability within a system is generally characterized by some of the outputs or internal states growing without bounds. Not all systems that are not stable are unstable; systems can also be mar ...
. 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: :\ y = \frac \left ( b_0x + b_1x -1+ b_2x -2- a_1y -1- a_2y -2\right ) or, if normalized: :\ y = b_0x + b_1x -1+ b_2x -2- a_1y -1- a_2y -2 Here the b_0, b_1 and b_2 coefficients determine zeros, and a_1, a_2 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 z^ 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: :\ y b_0 w b_1 w -1b_2 w -2 and using the difference equation: :\ w x a_1 w -1a_2 w -2 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 (z^) 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 equations for transposed direct form 2 are: :\ y b_0 x s_1 -1 where :\ s_1 s_2 -1b_1 x a_1 y /math> and :\ s_2 b_2 x a_2 y


Transposed direct form 1

The direct form 1 is transposed into


Transposed direct form 2

The direct form 2 is transposed into


Quantizing noise

When a sample of n bits is multiplied by a coefficient of m bits, the product has n+m bits. These products are typically accumulated in a DSP register, the addition of five products may need 3 overflow bits; this register is often large enough to hold n+m+3 bits. The z−1 is implemented by storing a value for one sample time; this storage register is usually n bits, the accumulator register is rounded to fit n bits, and this introduced quantizing noise. In the direct form 1 arrangement, there is a single quantizing/rounding function Q(z): In the direct form 2 arrangement, there also is a quantizing/rounding function for an intermediate value. In a cascade, the value may not need rounding between stages, but the final output may need rounding. Fixed point DSP usually prefers the non transposed forms and has an accumulator with a large number of bits, and is rounded when stored in main memory. Floating point DSP usually prefers the transposed form, each multiplication and potentially each addition are rounded; the additions are higher precision result, when both operands have similar magnitude.


See also

* Biquad filter *
Digital filter In signal processing, a digital filter is a system that performs mathematical operations on a sampled, discrete-time signal to reduce or enhance certain aspects of that signal. This is in contrast to the other major type of electronic filter, t ...


References

{{reflist


External links


Cookbook formulae for audio EQ biquad filter coefficientsBiquad filter
*https://ccrma.stanford.edu/~jos/fp/Transposed_Direct_Forms.html
WikiBook on digital signal processingMatched Second Order Digital Filters
Linear filters Audio engineering Filter theory