AnsweredAssumed Answered

Gain compensation when dynamically changing filter coefficients in SigmaStudio

Question asked by johanda on Aug 17, 2017
Latest reply on Aug 25, 2017 by johanda



I want to dynamically calculate the coefficients and set the frequency of a general filter, in this case Bandpass Filter with a VERY small bandwidth value (0.01). The problem I'm having is that I would like the output at the chosen frequency to be 0 dB. As you can see on the screenshots, the output gain changes with the frequency in periodic way (seemingly).


My idea was that if I could determine a function that takes the frequency and outputs a scale-factor which to multiply the gain parameter that is used to calulate gainLinear = 10 ^ (gain/20). This in order to always have the ouput to be 0 no matter the frequency like in fig 2 & fig 4.


Figure 4 shows an example of a wanted result, where input f0 = 800, a gain value of 4.5 is generated and the output is ~ 0.


I'm using the bandpass equation defined in:


Any help or ideas is highly appreciated.


// Johan


fig 1.

f0 = 800, gain = 0


fig 2.

f0 = 804, gain = 0


fig 3.

f0 = 816, gain = 0


fig 4.

f0 = 800, gain = 4.5