1.4.4.28 Fx32Norm Function
Normalize the 32-bit number.
Description
Function Fx32Norm:
Produces then number of left shifts needed to Normalize the 32-bit fractional input. If the input a is a positive number, it will produce the number of left shifts required to normalized it to the range of a minimum of to a maximum of . If the input a is a negative number, it will produce the number of left shifts required to normalized it to the range of a minimum of to a maximum of . This function does not actually normalize the input, it just produces the number of left shifts required. To actually normalize the value the left-shift function should be used with the value returned from this function.
32-bit input on range: 0 => result < 32 (i.e. NUMBITSFRACT32)
If a>0: 0x40000000 > Normalized Value <= 0x7fffffff i.e.,
(MAXFRACT32+1)/2 > aNorm <= MAXFRACT32
If a<0: 0x80000000 >= Normalized Value < 0xC0000000 i.e., MINFRACT32>= aNorm < MINFRACT32/2
This function relates to the ETSI norm_l function.
Parameters
q31 a 32-bit Q1.d31 to be normalized
Returns
int16_t result - The number of left shifts required to normalize the
C
int16_t Fx32Norm (q31);