# Analog Devices Wiki

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

This is an old revision of the document!

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

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.

common variables:

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 http://ez.analog.com/message/4769

The above slewing function implements RC slewing. The parameter 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.