- What is Q31 format?
- How to convert float to Q15?
- What is a Q15 type?
- How do you convert a fixed point to a floating point?
What is Q31 format?
Representation in fixed point:
Consider floating point number 0.5 . To represent this number in Q31 format (31 bits for fractional part), the number has to be multiplied by 231. Hence, 0.5 can be represented in Q31 format as 0.5* 231=1073741824.
How to convert float to Q15?
The equation used for the conversion process is: pDst[n] = (q15_t)(pSrc[n] * 32768); 0 <= n < blockSize. The function uses saturating arithmetic. Results outside of the allowable Q15 range [0x8000 0x7FFF] are saturated.
What is a Q15 type?
For example, the Q15 is a popular format in which the most significant bit is the sign bit, followed by 15 bits of fraction. The Q15 number has a decimal range between –1 and 0.9999 (0x8000 to 0x7FFF). This Q-value specifies how many binary digits are allocated for the fractional portion of the number.
How do you convert a fixed point to a floating point?
Converting from fixed-point to floating-point
Divide the number by 2^n (2 to the power of n).