AN2874
Applications note
BQD filter design equations
A generalized set of equations is formulated for the design of first-order and second-order low-pass and high-pass filters. A specialized set of equations is then given for the design of parametric biquad EQ filters.
The parameters governing the characteristics of the filter are:
!filter cut-off frequency, fC (-3 dB corner frequency)
!sampling rate (fS).
!Q factor
!boost/cut gain value at fC.
These parameters can be used to determine the coefficients of the filter transfer function.
The transfer function for a first-order filter in the digital z-domain can be written as: H(z) = (b0 + b1.z-1) / (a0 + a1.z-1).
And for a second-order filter as:
H(z) = (b0 + b1.z-1 + b2.z-2) / (a0 + a1.z-1+ a2.z-2).
This document can be used in conjunction with all the ST digital audio devices having EAQ filters onboard. These include STA309A, STA320, STA321, STA33xBW and several others.
February 2009 |
Rev 1 |
1/6 |
www.st.com
Low-pass and high-pass filter design |
AN2874 |
|
|
First-order filter design
As a first step to obtain the coefficients for the 1st-order low-pass or high-pass filter equation on page 1, the following equations can be used:
θC = 2 π fC / fS (= the normalized cut-off frequency) K = tan(θC / 2)
α = 1 + K.
The denominator coefficients are identical for both low-pass and high-pass filters designed for the same cut-off frequency and are computed as follows:
a0 = 1
a1 = -(1 - K) / α.
The numerator coefficients for a low-pass filter can be calculated as follows:
b0 = K / α b1 = K / α.
The numerator coefficients for a high-pass filter can be calculated as follows:
b0 = 1 / α b1 = -1 / α.
Second-order filter design
As a first step to obtain the coefficients for the 2nd-order low-pass or high-pass filter equation on page 1, the following equations can be used:
θC = 2 π fC / fS K = tan(θC / 2)
W = K2
α = 1 + K / Q + W.
The denominator coefficients are the same for both low-pass and high-pass filters designed for the same cut-off frequency and are computed as follows:
a0 = 1
a1 = 2 * (W - 1) / α
a2 = (1 - K / Q + W) / α.
The numerator coefficients for a low-pass filter can be calculated as follows: b0 = W / α
b1 = 2 * W / α b2 = b0.
The numerator coefficients for a high-pass filter can be calculated as follow: b0 = 1 / α
b1 = -2 / α b2 = b0.
2/6