0
$\begingroup$

I am working on IIR filter design, I got filter coefficients, now I want to truncate the coefficients so as to perform scaling.

let 0.2145678340000 be one of my coefficients. I want to truncate to 0.21456

I used below code to do that, but it wont work.

x_tr = fix(x*2^5)/2^5

can someone help me

thanks

$\endgroup$
  • $\begingroup$ "truncate the coefficients so as to perform scaling": um, scaling and truncating are different things; what is it that you want to do? $\endgroup$ – Marcus Müller Jul 28 at 12:54
  • 2
    $\begingroup$ $ x_tr = fix(x*10^5)/(10^5)$ if you want truncate to 5 digits, you need to us a base-10 scale factor, not base 2. Base-2 truncates to 5 bits, not 5 digits $\endgroup$ – Hilmar Jul 28 at 12:56
  • 3
    $\begingroup$ Be very careful about truncating IIR filter coefficients as the effect on the frequency response can be substantial (Be sure to review the before/after response) $\endgroup$ – Dan Boschen Jul 28 at 15:03
  • $\begingroup$ 1. Hi Marcus, I am working on reduced adder graph algorithm, in order to scale my coefficients first I need to truncate so that my coefficients are in look up table. $\endgroup$ – hari Jul 29 at 0:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.