CMSIS-DSP  
CMSIS DSP Software Library
Convert 16-bit floating point value

Functions

void arm_f16_to_float (const float16_t *pSrc, float32_t *pDst, uint32_t blockSize)
 Converts the elements of the f16 vector to f32 vector. More...
 
void arm_f16_to_q15 (const float16_t *pSrc, q15_t *pDst, uint32_t blockSize)
 Converts the elements of the f16 vector to Q15 vector. More...
 

Description

Function Documentation

◆ arm_f16_to_float()

void arm_f16_to_float ( const float16_t *  pSrc,
float32_t pDst,
uint32_t  blockSize 
)

Converts the elements of the floating-point vector to Q31 vector.

Parameters
[in]pSrcpoints to the f16 input vector
[out]pDstpoints to the f32 output vector
[in]blockSizenumber of samples in each vector
Returns
none

◆ arm_f16_to_q15()

void arm_f16_to_q15 ( const float16_t *  pSrc,
q15_t pDst,
uint32_t  blockSize 
)

Converts the elements of the floating-point vector to Q31 vector.

Parameters
[in]pSrcpoints to the f16 input vector
[out]pDstpoints to the Q15 output vector
[in]blockSizenumber of samples in each vector
Returns
none
Details
The equation used for the conversion process is:
    pDst[n] = (q15_t)(pSrc[n] * 32768);   0 <= n < blockSize.
Scaling and Overflow Behavior
The function uses saturating arithmetic. Results outside of the allowable Q15 range [0x8000 0x7FFF] are saturated.
Note
In order to apply rounding in scalar version, the library should be rebuilt with the ROUNDING macro defined in the preprocessor section of project options.