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

9.963818327 ,

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


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

82 etc.

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

  • 1
    $\begingroup$ 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? $\endgroup$
    – Matt L.
    Commented Jun 18, 2020 at 7:58
  • $\begingroup$ 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. $\endgroup$
    – Aami
    Commented Jun 20, 2020 at 4:35
  • $\begingroup$ What are your coefficients in HW implementation? $\endgroup$
    – Juha P
    Commented Jun 20, 2020 at 8:50
  • $\begingroup$ 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] $\endgroup$
    – Aami
    Commented Jun 22, 2020 at 10:20

1 Answer 1


Where are the poles of your filter? If they are close to the unit circle, then quantizing them can cause some of them to cross beyond the unit circle, causing the quantized filter to be unstable. You should check the poles of your filter before quantizing and after quantizing. See how close they match.

Secondly, it's risky, albeit not impossible, to implement an order-5 IIR filter directly in fixed-point arithmetic. Usually, it's a good idead to split it in cascaded order-2 filters, each of these order-2 IIR filters is usually called a "biquad". In your case you would have 2 cascaded biquads with one order-1 IIR filter.

There are many references that you can check out such as this one.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.