Wiki

This version is outdated by a newer approved version.DiffThis version (17 Nov 2016 21:33) is a draft.
Approvals: 0/1
The Previously approved version (17 Nov 2016 08:32) is available.Diff

This is an old revision of the document!


General Eq (2nd order) Slew Ext

Click here to return to the Filters page


The General (2nd-Order)Slew Ext 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 when any filter parameter is changed.

  • 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 slew time set by the user. The slew time can be set by providing the value lambda to the control pin. The parameter lambda determines the slew rate. Upon growing the number of filter stages, a new control pin is added to the module for lambda value for each stage.

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



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.

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).

classicqcontrol.jpg

resources/tools-software/sigmastudio/toolbox/filters/generaleq2ndorderslewext.1479414804.txt.gz · Last modified: 17 Nov 2016 21:33 by Prasad Kamath