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

General FIR

SigmaDSP & SigmaStudio Cmo Sep 4, 2019 00:00 2 replies Original on forum ↗
Subscribe
Cmo Question
Sep 4, 2019 00:00

Hello,

I finally succeed to display the curve of my filter FIR with my parameters here below:

Hz Gain

0 0
1990 0
2000 100
5000 100
5200 10
8000 10
8200 0

FIR_G.zip

What I don't understand, it is why this filter have got a 40dB gain ?

BR,

Kwanja

FIR_G.dspproj.zip

KJBob Reply
Sep 4, 2019 00:00

Hello Kwanja,

Often the last step in building a FIR filter is to normalize its kernel (list of coefficients) to force its maximum gain to unity. Evidently the method used to calculate the coefficients in your filter did not normalize the coefficients, or else was directed to produce a filter with the observed gain. Essentially, all the coefficients in your filter are approximately 100 times too large -- thus the 40 dB gain you see.

For example, the simple moving average FIR filter shown below has 10 taps, each with coefficient 1.0. Its 20 dB gain at near-DC stems from all its taps adding to each other:

To take an average we normally divide by the number of items averaged -- and this is exactly what we need to do here. Thus instead of having all the taps set to 1.0, if we make them 0.1, then the 20 dB gain goes away:

So a moving average filter where the taps are set to the value 1/N is normalized. In the general case, the math to normalize a filter is more complex. However, since you have already built your filter and know that its excess gain is 40 dB, this makes it easy. Just convert the excess gain in dB to a linear gain, then divide all your coefficients by the linear gain. With your filter -- the excess gain is 40 dB. The corresponding linear gain is G = 10^(dB/20) = 10^(40/20) = 10^2 = 100. Thus your filter will have unity gain after making all your coefficients 100x smaller.

BR,

Bob

Mov-Avg-Gain.png
Mov-Avg-Gain.png
Mov-Avg-Normalized.png
Mov-Avg-Normalized.png
Cmo Reply
Sep 5, 2019 00:00

Many thanks Bob !