# How to improve accuracy while converting floating point coefficients to fixed point in the case of an all pole IIR filter

I am having an all pole IIR filter of order 5 with floating point filter coefficients

[1,
-4.708642687,
9.963818327 ,
-11.99038368,
8.647611478,
-3.553230696,
0.659454607].


When an impulse input was applied to the IIR filter, the first 8 output samples obtained were

1,
4.7086,
12.20,
22.5509,
32.38,
36.9400,
32.26087.


To implement the same system in hardware, I have scaled the filter coefficients by a factor of $$2^{10}$$ and down-scaled back at the output. Similarly all the operations were done in fixed-point representation. However, the first 8 output samples obtained at the output were

1,
5,
14,
29,
49,
70,
86,
91,
82 etc.


How to reduce this large difference in the output when trying to convert from floating point to fixed point

• Could you show us the code? Also, did you compute the output using fixed-point or floating point operations, i.e., did you only quantize the coefficients or did you perform all computations using fixed-point? Jun 18 '20 at 7:58
• The equation of an all pole IIR filter which is y(n)=x(n)- Σay(n-k).Here filter coefficients a are scaled by 2^10.After that the filter coefficients are multiplied by previous output samples y(n-k).After the summation,I am dividing by 2^10.The entire system model is implemented as 16 bit two's complement form. Jun 20 '20 at 4:35
• What are your coefficients in HW implementation? Jun 20 '20 at 8:50
• The feedback coefficients a_k are obtained by scaling the floating point coefficients with 2^10 and then truncating the fractional part.So the value of a used are: [1024 -4821 10202 -12278 8855 -3638 675] Jun 22 '20 at 10:20