I am having difficulties implementing state-space filters in (32-bit) fixed-point. This is because the coefficients have a huge dynamic range, for example (MATLAB code):
A = [0.989923894 -116924.375; 4.34027786e-10 1];
B = [1; 0];
C = [0.010076086 1];
D = 0;
When converted to biquad sections:
[sos, gain] = ss2sos(A,B,C,D);
the coeffs are pretty normal:
sos = 0 1.0000 -1.0000 1.0000 -1.9899 0.9900
b0 = 0.0000
b1 = 1.0000
b2 = -1.0000
a0 = 1.0000
a1 = -1.9899
a2 = 0.9900
gain = 0.0101
Is there anything I can do to make my life easier? Any advice most welcome.
fixed
type? or will you be implementing this usingint
orlong
? $\endgroup$ – robert bristow-johnson Oct 30 '20 at 16:25