Hi,
I am trying to go from floating point maths to fixed point maths to optimize the speed but when I use the IQMath library the duration to run the code gets worse. I may be using the library wrong but can't see how. The code below is what I wrote to try and understand IQMath library and to see if fixed point is faster as it should be but wasn't.
/* This code section is in floating point */
float floating_point_array [300];
float num1 = 0.089;
float num2 = 5.68;
int i;
for (i = 0; i < 300; ++i)
{
floating_point_array[i] = num1 * num2;
}
/* This code section is in fixed point */
_iq17 fixed_point_array[300];
_iq17 x = _IQ17 (0.089);
_iq17 y = _IQ17(5.68);
_iq17 i;
for (i = 0; i < 300; ++i)
{
fixed_point_array[i] = _IQ17mpy (x, y);
}
Many thanks,
Shiromini