Floating point to fixed point code conversion – Part 3: Using macros to bridge the conversion process
Programming, Speech/Voice Compression 5 CommentsBe sure to read Part 1 for an introduction to fixed point math, and Part 2 for guidelines in preparing your floating point code for conversion to fixed point.
I begin the conversion process by adding these macros to the source files to emulate the fixed point math functions which will be used later:
#define fixed32 float #define ftofix32(x) ((float)(x)) /* float value to fixed */ #define itofix32(x) ((float)(x)) /* integer value to fixed */ Read the rest of this entry »