![]() |
![]() |
Collaboration diagram for DSP_recip16:
![]() |
void | DSP_recip16 (const short *restrict x, short *restrict rfrac, short *restrict rexp, short nx) |
void DSP_recip16 | ( | const short *restrict | x, | |
short *restrict | rfrac, | |||
short *restrict | rexp, | |||
short | nx | |||
) |
This program performs a reciprocal on a vector of Q15 numbers. The result is stored in two parts: a Q15 part and an exponent (power of two) of the fraction. First, the input is loaded, then its absolute value is taken, then it is normalized, then divided using a loop of conditional subtracts, and finally it is negated if the original input was negative.
x | = Input data array of shorts | |
rfrac | = Output data array containing fractions | |
rexp | = Output data array containing exponents | |
nx | = Number of elements in the arrays |