ΣSigmaStudio Ask AI Русский Log in

EQ Low- and High-Shelf filter coefficients comming back - Mysterious S factor.

SigmaDSP & SigmaStudio wielad Oct 7, 2014 00:00 9 replies Original on forum ↗
Thread Summary

Thread Summary

The user encountered issues with the S factor in EQ shelving filters for the ADAU1701, leading to invalid coefficient calculations. The S factor is related to the Q parameter and is described in Robert Bristow-Johnson's Audio EQ Cookbook. The engineer provided a corrected spreadsheet for calculating IIR coefficients for shelving filters, addressing the problem. It was also clarified that SigmaDSPs use Direct Form 1 for filter implementation.
AI Generated Content
Subscribe
wielad Question
Oct 7, 2014 00:00

Hi everybody

I have to calculate EQ coefficients before start my ADAU1701 every time. The first filter in EQ is LowShelf filter and last one - High-Shelf. Rest are peaking filters. There are some threads on this forum about calculation of EQ filter coefficients, but only about EQ peaking filter. I found new problem: mysterious S factor in EQ shelving filters.

I thought the S factor means "Slope" parameter of Low- or High-Shelf filter. Slope can vary from 0 to 2 in graphics editor. But there is not Slope in FilterTableGen. There is Q parameter, which can vary from 0,01 to 20.

I detected the problem when I started to change the parameter S in excel -> argument of sqrt function sometimes is going under the 0.

For ex.:

Boost = 5dB; S=1,7

Boost = -5dB; S=0,7

Does somebody knows what t. h. is S? And how to mold the curve of the shelving filter using coefficients?

There is well known excel file: Parameteric_EQ_IIR_Coefficient_Calculator.xls with calculations, but only for peaking filter type of EQ filter. Maybe someone could expand on the functions of shelving filters.

I

Audio Signal Processors

SigmaDSP Audio Processors

adau1701

5d571178dbdf1f9b3dad2bfacfd2933b.png
5d571178dbdf1f9b3dad2bfacfd2933b.png
5d571178dbdf1f9b3dad2bfacfd2933b.png-300x300.png
5d571178dbdf1f9b3dad2bfacfd2933b.png-300x300.png
KJBob Reply
Oct 9, 2014 00:00

Hello,

The slope factor S is related to Q in a direct but nonlinear way described in Robert Robert Bristow-Johnson's work. One reference to it is here: http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt

Bi-quad coefficients given there are for the Direct Form I topology. SigmaDSPs use Direct Form II, which appears to fold the a0 coefficient into the others.

The SigmaStudio toolbox wiki at: General 2nd Order [Analog Devices Wiki]

provides the coefficient calculations used by all Sigma bi-quad filters. The Parametric EQ formulas in Brett G's famous spreadsheet agree with those in the wiki, so it seemed easy enough to extend the spreadsheet for shelving filters. I tried doing this today, it felt like I was painting over a Picasso. The shelving calculations are quite complex, and the resulting filter's response varies wildly with tiny coefficient variations. My coefficients produced a grotesque result -- and I've yet to uncover my error(s).

Best regards,

Bob

KJBob Reply
Oct 13, 2014 00:00

Hello wielad,

I have the spreadsheet working now -- it calculates IRR coefficients for all three filters commonly found in parametric EQs: Peaking, Low Shelf, and High Shelf.

Best regards,

Bob

affbfe8ca5ef2f0ed649de792c300d20.png
affbfe8ca5ef2f0ed649de792c300d20.png
affbfe8ca5ef2f0ed649de792c300d20.png-620x320.png
affbfe8ca5ef2f0ed649de792c300d20.png-620x320.png
wielad Reply
Oct 13, 2014 00:00

Great job, thanx a lot.

So there is a mistake in Sigmastudio help and Audio-EQ-Cookbook.txt. Multiplying instead of exponentiation.

ADIApproved Reply
May 6, 2015 00:00

Hi all:

SigmaStudio does not use Direct Form 2, it uses Direct Form 1, it's just that there is an assembly code minus in front of some of the denominator coefficients of the filter. This is due to the possibility of the SigmaDSP hardware to do a minus in hardware. In other words, it's a simple implementation difference between different ways in the way the Direct Form 1 can be implemented on the SigmaDSP. Direct Form1 is the correct way of doing audio filtering in fixed point hardware to avoid quantization problems.

Regards

Miguel

KJBob Reply
May 6, 2015 00:00

Hi Miguel,

Did this change since JeradL's post from the year 2010 (below)? Or does it differ among different cores / compilers?

https://ez.analog.com/message/16011#16011

Best regards,

Bob

DaveThib Reply
Mar 28, 2019 00:00

Note for all,

The link that is in this post for the Audio EQ Cookbook is no longer a valid link. This new link should have the info that was in the old link:

http://shepazu.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html

Dave T

DaveThib Reply
Feb 5, 2020 00:00

Hello Bob,

I just fixed JaredL's response on that old post to correct it. It was incorrect. The filters are Direct Form 1

Dave T

KJBob Reply
Jun 6, 2020 00:00

Thanks, Dave for fixing the Cookbook link as well as the filter topology issue. Now thanks to shihong sun's inquiry here, I found an error in my shelf-filter coefficient calculations, The error causes a Q lower than expected, which matters mostly for slope >1. The corrected spreadsheet is below.

Best regards,

Bob

1st-2nd-Order_IIR_Coefficient_Calc.zip

DaveThib Reply
Jun 10, 2020 00:00

Awesome work Bob!

You really are good at this digital filtering. :)

Dave T