LIBML  Version 3.2.4
LIBML DSP Software Library
Functions
Convert 32-bit floating point value
Collaboration diagram for Convert 32-bit floating point value:

Functions

void tpt_f32_to_q15 (q15_t *aOutData, const f32_t *aInData, uint32_t aCount)
 Converts the elements of the floating-point vector to Q15 vector. More...
 
void tpt_f32_to_q31 (q31_t *aOutData, const f32_t *aInData, uint32_t aCount)
 Converts the elements of the floating-point vector to Q31 vector. More...
 
void tpt_f32_to_q7 (q7_t *aOutData, const f32_t *aInData, uint32_t aCount)
 Converts the elements of the floating-point vector to Q7 vector. More...
 
void tpt_f64_to_q15 (q15_t *aOutData, const f64_t *aInData, uint32_t aCount)
 Converts the elements of the floating-point vector to Q15 vector. More...
 
void tpt_f64_to_q31 (q31_t *aOutData, const f64_t *aInData, uint32_t aCount)
 Converts the elements of the floating-point vector to Q31 vector. More...
 
void tpt_f64_to_q7 (q7_t *aOutData, const f64_t *aInData, uint32_t aCount)
 Converts the elements of the floating-point vector to Q7 vector. More...
 

Detailed Description

Function Documentation

◆ tpt_f32_to_q15()

void tpt_f32_to_q15 ( q15_t aOutData,
const f32_t aInData,
uint32_t  aCount 
)

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

Parameters
[out]aOutDatapoints to the Q15 output vector
[in]aInDatapoints to the floating-point input vector
[in]aCountnumber of samples in each vector
Returns
none
Details
The equation used for the conversion process is:
   aOutData[n] = (q15_t)(aInData[n] * 32768);   0 <= n < aCount.
 
Scaling and Overflow Behavior
The function uses saturating arithmetic. Results outside of the allowable Q15 range [0x8000 0x7FFF] are saturated.

◆ tpt_f32_to_q31()

void tpt_f32_to_q31 ( q31_t aOutData,
const f32_t aInData,
uint32_t  aCount 
)

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

Parameters
[out]aOutDatapoints to the Q31 output vector
[in]aInDatapoints to the floating-point input vector
[in]aCountnumber of samples in each vector
Returns
none
Details
The equation used for the conversion process is:
    aOutData[n] = (q31_t)(aInData[n] * 2147483648);   0 <= n < aCount.
  
Scaling and Overflow Behavior
The function uses saturating arithmetic. Results outside of the allowable Q31 range[0x80000000 0x7FFFFFFF] are saturated.

◆ tpt_f32_to_q7()

void tpt_f32_to_q7 ( q7_t aOutData,
const f32_t aInData,
uint32_t  aCount 
)

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

Parameters
[out]aOutDatapoints to the Q7 output vector
[in]aInDatapoints to the floating-point input vector
[in]aCountlength of the input vector
Returns
none.
Description:
The equation used for the conversion process is:
    aOutData[n] = (q7_t)(aInData[n] * 128);   0 <= n < aCount.
  
Scaling and Overflow Behavior:
The function uses saturating arithmetic. Results outside of the allowable Q7 range [0x80 0x7F] will be saturated.

◆ tpt_f64_to_q15()

void tpt_f64_to_q15 ( q15_t aOutData,
const f64_t aInData,
uint32_t  aCount 
)

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

Parameters
[out]aOutDatapoints to the Q15 output vector
[in]aInDatapoints to the floating-point input vector
[in]aCountnumber of samples in each vector
Returns
none
Details
The equation used for the conversion process is:
   aOutData[n] = (q15_t)(aInData[n] * 32768);   0 <= n < aCount.
 
Scaling and Overflow Behavior
The function uses saturating arithmetic. Results outside of the allowable Q15 range [0x8000 0x7FFF] are saturated.

◆ tpt_f64_to_q31()

void tpt_f64_to_q31 ( q31_t aOutData,
const f64_t aInData,
uint32_t  aCount 
)

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

Parameters
[out]aOutDatapoints to the Q31 output vector
[in]aInDatapoints to the floating-point input vector
[in]aCountnumber of samples in each vector
Returns
none
Details
The equation used for the conversion process is:
    aOutData[n] = (q31_t)(aInData[n] * 2147483648);   0 <= n < aCount.
  
Scaling and Overflow Behavior
The function uses saturating arithmetic. Results outside of the allowable Q31 range[0x80000000 0x7FFFFFFF] are saturated.

◆ tpt_f64_to_q7()

void tpt_f64_to_q7 ( q7_t aOutData,
const f64_t aInData,
uint32_t  aCount 
)

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

Parameters
[out]aOutDatapoints to the Q7 output vector
[in]aInDatapoints to the floating-point input vector
[in]aCountlength of the input vector
Returns
none.
Description:
The equation used for the conversion process is:
    aOutData[n] = (q7_t)(aInData[n] * 128);   0 <= n < aCount.
  
Scaling and Overflow Behavior:
The function uses saturating arithmetic. Results outside of the allowable Q7 range [0x80 0x7F] will be saturated.