Post Go back to editing

Variable band-stop / notch filters

For a feedback suppression algorithm I am looking to implement variable gain / rejection / frequency notch or band-stop filters.

On other words, I need to be able to control the center frequency and amount of rejection dynamically.

What would be the best way to implement this on an ADAU 1761?

Parents
  •      Hello Roman,

         Your final application will influence which of several approaches might work for you.  I'll try to describe these methods with their advantages and limitations.

         Second-Order IIR

         These are by far the most versatile and capable, but also the most difficult to control in real-time:

         Problem is, to adjust these filters at runtime you'll need an external means of control -- either SigmaStudio via the USBi, or a microcontroller in your final product.  This is because the five IIR coefficients needed to drive these filters have calculations too complex for a SigmaDSP to do on its own.  So instead you have your microcontroller calculate the needed coefficients for a desired response, then have it safeload them into the DSP's parameter memory via I2C or SPI bus.  I attached a spreadsheet with formulas to calculate coefficients for various filter types -- it's fairly straightforward to translate them into C code for your microcontroller.  To troubleshoot your own calculations, enter them into the IIR Coefficient version of the filter, as with the notch filter shown below:

         Once you've calculated your coefficients, safeloading them has been covered in various forum topics -- for example, https://ez.analog.com/message/61175#61175

         State-Variable Filter

         This is the only SigmaStudio filter for which the DSP figures its own coefficients, thus allowing filter control to originate within a signal flow.  It has simultaneous lowpass, highpass, and bandpass outputs.  It's possible to create a notch by subtracting its bandpass output from the original signal, but tricky to obtain a deep notch this way.

         Communications-Grade Notch

         If your application is in communications with a narrow voice bandwidth, you can borrow an idea used in radio since the 1930's -- it's far easier to move the incoming signal's frequency than to move the filter's frequency.  See an example of this technique at https://ez.analog.com/message/173545#173545

         Best regards,

         Bob

Reply
  •      Hello Roman,

         Your final application will influence which of several approaches might work for you.  I'll try to describe these methods with their advantages and limitations.

         Second-Order IIR

         These are by far the most versatile and capable, but also the most difficult to control in real-time:

         Problem is, to adjust these filters at runtime you'll need an external means of control -- either SigmaStudio via the USBi, or a microcontroller in your final product.  This is because the five IIR coefficients needed to drive these filters have calculations too complex for a SigmaDSP to do on its own.  So instead you have your microcontroller calculate the needed coefficients for a desired response, then have it safeload them into the DSP's parameter memory via I2C or SPI bus.  I attached a spreadsheet with formulas to calculate coefficients for various filter types -- it's fairly straightforward to translate them into C code for your microcontroller.  To troubleshoot your own calculations, enter them into the IIR Coefficient version of the filter, as with the notch filter shown below:

         Once you've calculated your coefficients, safeloading them has been covered in various forum topics -- for example, https://ez.analog.com/message/61175#61175

         State-Variable Filter

         This is the only SigmaStudio filter for which the DSP figures its own coefficients, thus allowing filter control to originate within a signal flow.  It has simultaneous lowpass, highpass, and bandpass outputs.  It's possible to create a notch by subtracting its bandpass output from the original signal, but tricky to obtain a deep notch this way.

         Communications-Grade Notch

         If your application is in communications with a narrow voice bandwidth, you can borrow an idea used in radio since the 1930's -- it's far easier to move the incoming signal's frequency than to move the filter's frequency.  See an example of this technique at https://ez.analog.com/message/173545#173545

         Best regards,

         Bob

Children
No Data