LIBML  Version 3.2.4
LIBML DSP Software Library
Functions
Vector Fixed Point Division
Collaboration diagram for Vector Fixed Point Division:

Functions

int tpt_divide_q31 (q31_t *aQuotient, int16_t *aShift, q31_t aNumerator, q31_t aDenominator)
 Fixed point division for q31. More...
 
int tpt_divide_q15 (q15_t *aQuotient, int16_t *aShift, q15_t aNumerator, q15_t aDenominator)
 Fixed point division for q15. More...
 

Detailed Description

Fixed point division functions divide a numerator by a denominator to get a quotient value which is normalized between -1.0 and 1.0, and a shift left value will also be output to get the unnormalized quotient.

Terapines DSP library supports distinct fixed point division functions for Q15 and Q31 data types. The functions are introduced in the subsections below.

Function Documentation

◆ tpt_divide_q15()

int tpt_divide_q15 ( q15_t aQuotient,
int16_t *  aShift,
q15_t  aNumerator,
q15_t  aDenominator 
)

Fixed point division for q15.

Parameters
[out]aQuotientquotient value normalized between -1.0 and 1.0
[out]aShiftshift left value to get the unnormalized quotient
[in]aNumeratornumerator value
[in]aDenominatordenominator value
Returns
-1, when denominator equal to zero.

◆ tpt_divide_q31()

int tpt_divide_q31 ( q31_t aQuotient,
int16_t *  aShift,
q31_t  aNumerator,
q31_t  aDenominator 
)

Fixed point division for q31.

Parameters
[out]aQuotientquotient value normalized between -1.0 and 1.0
[out]aShiftshift left value to get the unnormalized quotient
[in]aNumeratornumerator value
[in]aDenominatordenominator value
Returns
-1, when denominator equal to zero.