CMSIS-DSP: Convert 16-bit floating point value

| CMSIS-DSP CMSIS DSP Software Library

- Main Page
- Usage and Description
- Reference

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Convert 16-bit floating point value
Support Functions

## 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

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] | pSrc | points to the f16 input vector
  [out] | pDst | points to the f32 output vector
  [in] | blockSize | number of samples in each vector

Returns
  none

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] | pSrc | points to the f16 input vector
  [out] | pDst | points to the Q15 output vector
  [in] | blockSize | number 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.