I have to implement an IIR controller in dsPIC 33EP (16-bit, fixed-point, two's complement, wrap-around, 40-bit accumulator, 32-bit multiply, 12-bit ADC) and I am using cascaded, Direct Form I second order sections (ordering up).
Now, I am having trouble with the scaling procedure, since I'read a lot about $L^2$-norm, but can't quite figure out how to apply it properly.
When I get the sos matrix and gain using MATLAB (by either using tf2sos
, fdatool
, or filterbuilder
) using $L^2$ norm, the gain values are always 1 for all of the intermediate sections.
- Is this correct?
- Or do I need to scale the input for each section?
(I have no experience implementing IIR systems and your help would mean a lot.)
Ben