FIR Filter II, not able to get unity gain
Hi
I have designed a 26 taps FIR filter in Matlab. The coefficients are float (between -1 to 1) and the sum of the coefficient is close to 1 ( sum(taps) = 0.9991 ).
In FIR II IP generator (Quartus 17.1) the filter is set up with:
- 24b coefficients signed binary with auto scale
- 24b input signed binary
- 24b output signed binary, where the LSBs are removed to get 24b
The problem is that the filter does not have unity gain. Simulations (Matlab and ModelSim) show that the output level is approximately 1/16 of the input level at low frequencies signals (i.e. signals well within the passband).
Why? Can anyone share some insight here? Have I configured Fir II incorrectly?
I can of course remove some of the MSB bits but I did not think that should be necessary, and one need to be careful to avoid saturation. The FIR filter is part of a 3 stage decimation filter, and if each step has gain loss the dynamic range will suffer.
BR
AD