This version is outdated by a newer approved version.DiffThis version (20 Dec 2016 13:05) was approved by Venkatesan Krishnamoorthy.The Previously approved version (17 Nov 2016 08:26) is available.Diff

This is an old revision of the document!

General Eq (2nd order) Slew -(ADAU145x)

Click here to return to the Filters page

The General (2nd-Order) block gives access to a wide variety of 2nd-order (biquad)filter algorithms. The Slew time can be entered in seconds (0-1) to slew from the initial set of coefficients to the target value.

  • The available filter types are:
  • Parametric
  • Shelving
  • General High-Pass
  • General Low-Pass
  • General Band-Pass
  • General Band-Stop
  • Butterworth Low-Pass / High-Pass
  • Bessel Low-Pass / High-Pass
  • Tone Control
  • 1st-Order Low-Pass / High-Pass
  • All-pass
  • Peaking
  • Notch
  • Chebyshev Low-Pass / High-Pass

The slewing functionality is added for smooth transition from one set of filter coefficients to another when the filter parameters are changed. The slewing takes place approximately in the time set by the user in the GUI. The slew time can be entered in the GUI slew Text box, or open the filter control window by clicking on the icon button and enter the slew time in the slew text box or by using the slew slider. The slew time range is limited between (0 to 1 second).

To open the filter control window, click on the icon button: Select the desired filter type from the drop-down combo-box list. The filter controls and the icon button image will change to reflect the selected filter type.

This block's algorithms use biquad filter designs (Direct Form II) based on Robert Bristow-Johnson's work in this field.

H(z)={b_0 + b_1 z^-1 + b_2 z^-2}/{1 + a_1 z^-1 + a_2 z^-2}

common variables:

  • omega_0 = {2 pi f_0}/{F_s}
  • gainLinear = 10^{gain/20}

Note that the b0 and b2 coefficients for the high pass filter below are inverted from what is stored in RAM. The correct equations for b0, b1, and b2 for a high pass filter are as follows:
b0 = -(1 + cos(ω0)) * gainLinear / 2
b1 = -(1 + cos(ω0)) * gainLinear
b2 = -(1 + cos(ω0)) * gainLinear / 2

Note that the minus signs on b0 and b2 values are erroneous for the Butterworth HP and Bessel HP. They should not be included. See

Slew function:
lambda= e^{-1/{timeconstant*F_s}}
Current Coefficient= Current Coffcicient* lambda + Target Coefficient * (1-lambda)

The above slewing function implements RC slewing. The parameter lambda is calculated based on the slewing time constant. The computations for slewing of filter coefficients is done on the DSP. The slew computation is always performed in single precision.

For all of the above filters, the coefficients are divided by a0, normalizing them and making a0 = 1 so that only 5 coefficients must be stored. In the actual implementation on the DSP, when the coefficients are stored in parameter RAM, a1 and a2 need to be inverted. This is done automatically, in software, before the parameters are written to memory.

The Q is shown with the value adjusted (from the classical EE definition) so that a boost of N dB followed by a cut of N dB for identical Q and f0/Fs results in a precisely flat unity gain filter or “wire”. This is equal to A*Q, where A = 10^(dBgain/40).

NOTE: Due to fixed point operations, the filter coefficients do not slew exactly in the set slew time.

resources/tools-software/sigmastudio/toolbox/filters/generaleq2ndorderslew.1480414579.txt.gz · Last modified: 29 Nov 2016 11:16 by Mazher Khan