Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Digital biquad filter

From Wikipedia, the free encyclopedia
Second order recursive digital linear filter
This article has multiple issues. Please helpimprove it or discuss these issues on thetalk page.(Learn how and when to remove these messages)
This articlemay be too technical for most readers to understand. Pleasehelp improve it tomake it understandable to non-experts, without removing the technical details.(January 2025) (Learn how and when to remove this message)
This article includes a list ofgeneral references, butit lacks sufficient correspondinginline citations. Please help toimprove this article byintroducing more precise citations.(October 2015) (Learn how and when to remove this message)
(Learn how and when to remove this message)

Insignal processing, adigital biquad filter is a second orderrecursivelinear filter, containing twopoles and twozeros.Biquad is an abbreviation ofbiquadratic, which refers to the fact that in theZ domain, itstransfer function is the ratio of twoquadratic functions:

 H(z)=b0+b1z1+b2z2a0+a1z1+a2z2{\displaystyle \ H(z)={\frac {b_{0}+b_{1}z^{-1}+b_{2}z^{-2}}{a_{0}+a_{1}z^{-1}+a_{2}z^{-2}}}}

The coefficients are often normalized such thata0 = 1:

 H(z)=b0+b1z1+b2z21+a1z1+a2z2{\displaystyle \ H(z)={\frac {b_{0}+b_{1}z^{-1}+b_{2}z^{-2}}{1+a_{1}z^{-1}+a_{2}z^{-2}}}}

High-orderinfinite impulse response filters can be highly sensitive toquantization of their coefficients, and can easily becomeunstable. 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

[edit]

Direct form 1

[edit]

The most straightforward implementation is the direct form 1, which has the followingdifference equation:

 y[n]=1a0(b0x[n]+b1x[n1]+b2x[n2]a1y[n1]a2y[n2]){\displaystyle \ y[n]={\frac {1}{a_{0}}}\left(b_{0}x[n]+b_{1}x[n-1]+b_{2}x[n-2]-a_{1}y[n-1]-a_{2}y[n-2]\right)}

or, if normalized:

 y[n]=b0x[n]+b1x[n1]+b2x[n2]a1y[n1]a2y[n2]{\displaystyle \ y[n]=b_{0}x[n]+b_{1}x[n-1]+b_{2}x[n-2]-a_{1}y[n-1]-a_{2}y[n-2]}

Here theb0{\displaystyle b_{0}},b1{\displaystyle b_{1}} andb2{\displaystyle b_{2}} coefficients determine zeros, anda1{\displaystyle a_{1}},a2{\displaystyle 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 thez1{\displaystyle z^{-1}} delay of a section output is cloned in the next section input. Two storage delay components may be eliminated between sections.

Direct form 2

[edit]

The direct form 2 implements the same normalized transfer function as direct form 1, but in two parts:

 y[n]=b0w[n]+b1w[n1]+b2w[n2],{\displaystyle \ y[n]=b_{0}w[n]+b_{1}w[n-1]+b_{2}w[n-2],}

and using thedifference equation:

 w[n]=x[n]a1w[n1]a2w[n2].{\displaystyle \ w[n]=x[n]-a_{1}w[n-1]-a_{2}w[n-2].}

Flow graph of biquad filter in direct form 2:

The direct form 2 implementation only needsN delay units, whereN is the order of the filter – potentially half as much as direct form 1. The derivation from the normalized direct form 1 is as follows:

 y[n]=b0x[n]+b1x[n1]+b2x[n2]a1y[n1]a2y[n2]{\displaystyle \ y[n]=b_{0}x[n]+b_{1}x[n-1]+b_{2}x[n-2]-a_{1}y[n-1]-a_{2}y[n-2]}

Assume the substitution:

 y[n]=b0w[n]+b1w[n1]+b2w[n2]{\displaystyle \ y[n]=b_{0}w[n]+b_{1}w[n-1]+b_{2}w[n-2]}

Which results in:

 y[n]=b0x[n]+b1x[n1]+b2x[n2]a1(b0w[n1]+b1w[n2]+b2w[n3])a2(b0w[n2]+b1w[n3]+b2w[n4]){\displaystyle \ y[n]=b_{0}x[n]+b_{1}x[n-1]+b_{2}x[n-2]-a_{1}(b_{0}w[n-1]+b_{1}w[n-2]+b_{2}w[n-3])-a_{2}(b_{0}w[n-2]+b_{1}w[n-3]+b_{2}w[n-4])}

Isolating theb0{\displaystyle b_{0}},b1{\displaystyle b_{1}} andb2{\displaystyle b_{2}} coefficients:

 y[n]=b0(x[n]a1w[n1]a2w[n2])+b1(x[n1]a1w[n2]a2w[n3])+b2(x[n2]a1w[n3]a2w[n4]){\displaystyle \ y[n]=b_{0}(x[n]-a_{1}w[n-1]-a_{2}w[n-2])+b_{1}(x[n-1]-a_{1}w[n-2]-a_{2}w[n-3])+b_{2}(x[n-2]-a_{1}w[n-3]-a_{2}w[n-4])}

Which assuming w[n]=x[n]a1w[n1]a2w[n2]{\displaystyle \ w[n]=x[n]-a_{1}w[n-1]-a_{2}w[n-2]} yields the above result:

 y[n]=b0w[n]+b1w[n1]+b2w[n2],{\displaystyle \ y[n]=b_{0}w[n]+b_{1}w[n-1]+b_{2}w[n-2],}

The disadvantage is that direct form 2 increases the possibility of arithmetic overflow for filters of highQ or resonance.[1] It has been shown that asQ increases, the round-off noise of both direct form topologies increases without bounds.[2] 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

[edit]
[icon]
This sectionneeds expansion. You can help byadding to it.(October 2015)

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.[3] 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.

Thedifference equations for transposed direct form 2 are:

 y[n]=b0x[n]+s1[n1],{\displaystyle \ y[n]=b_{0}x[n]+s_{1}[n-1],}

where

 s1[n]=s2[n1]+b1x[n]a1y[n]{\displaystyle \ s_{1}[n]=s_{2}[n-1]+b_{1}x[n]-a_{1}y[n]}

and

 s2[n]=b2x[n]a2y[n].{\displaystyle \ s_{2}[n]=b_{2}x[n]-a_{2}y[n].}

Transposed direct form 1

[edit]

The direct form 1Digital Biquad Direct Form 1 Untransformedis transposed intoFlow diagram of Biquad filter Direct Form 1

Transposed direct form 2

[edit]

The direct form 2Flow diagram of Biquad filter Direct Form 2is transposed intoFlow diagram of Biquad filter Direct Form 2

Quantizing noise

[edit]

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):Flow diagram of Biquad filter Direct Form 1

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.Flow diagram of Biquad filter Direct Form 2 with Quantizing

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

[edit]

References

[edit]
  1. ^J. O. Smith III,Direct Form II
  2. ^L. B. Jackson, "On the Interaction of Roundoff Noise and Dynamic Range in Digital Filters,"Bell Sys. Tech. J., vol. 49 (1970 Feb.), reprinted inDigital Signal Process, L. R. Rabiner and C. M. Rader, Eds. (IEEE Press, New York, 1972).
  3. ^"Transposed Direct-Forms".

External links

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=Digital_biquad_filter&oldid=1276395294"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp