1.4.4.27 Fx16Norm Function

Normalize the 16-bit fractional value.

Description

Function Fx16Norm:

Produces then number of left shifts needed to Normalize the 16-bit fully 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.

the 16-bit input on range: 0 => result < 16 (i.e. NUMBITSFRACT16) If a>0: 0x4000 > Normalized Value <= 0x7fff i.e. (MAXFRACT16+1)/2 > aNorm <= MAXFRACT16 If a<0: 0x8000 >= Normalilzed Value < 0xC000 i.e. MINFRACT16>= aNorm <

MINFRACT16/2

This function relates to the ETSI norm_s function.

Parameters

q15 a in Q1.15

Returns

i16 result - The number of left shifts required to normalize

C

int16_t Fx16Norm (q15);