I am trying to understand exactly how to do this. I know how fixed point and floating point notations work, but I was wondering how I can convert from int32 to q31 or f32.
If I understand q31 correctly it leaves 31 bits for the fractional part and one bit for the whole part, and f32 is just floating point notation.
I'm trying to figure out how can I efficiently convert between the two?
I am using the ARM CMSIS dsp Library and there are source codes to convert between q31 and f32 but I am receiving the data as int16 or int32. I'm assuming converting from int to floating point is cumbersome in comparison to going from int to fixed point so using ARM's libraries is my best be for speed I'm assuming. That being said if q31 does indeed operate this way (and I'm hoping its signed) could I just say
q31num=int32;
and leave it at that? any help would be greatly appreciated.
thanks in advance!
-scarlson