Altera_Forum
Honored Contributor
11 years agoFIR Compiler II fractional signed fractional binary (integer bits output width)
Hi all!
I'm using FIR Compiler II for some time, and now I have a question about it. My point is to have a unity gain after filter for a purpose of temperature filtering, so I use test constant input to calculate filter gain and delete filter output by that gain. I choose signed fractional binary format. So, I'm using lowpass FIR (20 coeffs moving average (each coeff = 0.05)), input data type is signed fractional binary (24 fractional, 8 integer, 32 total) and coefficient data type signed fractional binary (1 bit). Filter generates Output Full Bit Width 39 bit, Output Full Fractional Bit Width 25 bit, so that means that integer part consists of 14 bit. I tested filter with a constant input (0x01880000 equals 24.5 Celsius) and received output, which first 14 bits were: 00000011110101 (245 dec). But that means that filter gain is 10 (dec), when I'm expected to see 20 (dec). It's not a problem to use that coefficient, but I can't understand why filter behaves like that. I tested another lowpass FIR (101 coeffs, and coeffs were not equal), input data type was still signed fractional binary (24 fractional) and coefficient data type signed fractional binary (12 bit), and filter generated output with 16 bit integer width, and its coefficient gain was much closer to the amount of coefficients (about 101). So my question is, why in my first test (20 coeffs moving average) filter gain is a half of the coefficints amount, and in second test it was about the amount of filter coefficients?