Wiki

This version (23 Jun 2020 22:22) was approved by Joshua Berlin.The Previously approved version (28 Jan 2020 10:44) is available.Diff

General Filters

Click here to return to the Filters page

  1. General 2nd Order
  2. Coefficient Calculations on DSP (ADAU145X)

——————————————————————————————————

1.General 2nd Order


The General (2nd-Order) block gives access to a wide variety of 2nd-order (biquad)filter algorithms.The coefficient calculations happen in the controller.

  • 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

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(DF1) 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



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. SigmaStudio performs this operation automatically, in software, before the parameters are written to DSP memory. Microcontrollers must invert a1 and a2 before writing new coefficients to DSP memory.

By default, 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

The “Classic EQ” version of Q can optionally be shown by clicking the small circular button next to the Q control.

classicqdisplay.jpg

2.Coefficient Calculations on DSP

The General (2nd-Order) block gives access to a wide variety of 2nd-order (biquad)filter algorithms.The coefficient calculations happen in the controller.

  • 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
  • All-pass
  • Peaking
  • Notch
  • Chebyshev Low-Pass / High-Pass

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.



GUI Control

GUI Control NameDefault ValueRangeFunction Description
Filter Type LowpassLowPass/Highpass/BandPass/BandStopType of the filter
Frequency1000 Hz0-96000 HzThe cut off frequency of the filter
Gain0 dB -15 to 15 Filter Gain
Q Factor0 0 to 16 Q Factor of the filter
Enable1 0 t0 1 Enable or disable filter
Phase Shift0 0 to 1 Phase shift by 180 deg

DSP parameter Information

GUI Control NameCompiler NameFunction Description
FrequencyFREQ_DSP_CALC0_ _The cut off frequency of the filter
GainGAIN_DSP_CALC0_ _Filter Gain
Q FactorQ_DSP_CALC0_ _Q Factor of the filter
Filter TypeFILTER_TYPE0_ _Type of the filter
NAINVERT__Negate the Coefficients corresponding to the input
NAONE_BY_FS_DSP_CALC0_ _1/ Sample Rate
NAADDRESS_DSP_CALC0_ _Starting Address of the filter coefficients.
NAMEM_SELECTION_DSP_CALC0_ _Memory section the filter coefficients are located (DM0/DM1)

It is possible to selectively disable filters which are not going to be used.To select only those filters to be used, right click on the module and select Configure Supported Filters and select only those filters which might be used.


resources/tools-software/sigmastudio/toolbox/filters/general2ndorder.txt · Last modified: 23 Jun 2020 22:22 by Joshua Berlin