1.4.4.52 libq_q31_Mult2_q15_q15 Function

Fractional multiplication of two 16-bit fractional values.

Description

Function libq_q31_Mult2_q15_q15:

Performs fractional multiplication of two 16-bit fractional values and returns the 32-bit fractional scaled result. The function performs the Q15xQ15->Q30 fractional bit multiply. It then shifts the result left by 1, to give a Q31 type result, (the lsb is zero-filled). This automatic shift left is done to get rid of the extra sign bit that occurs in the interpretation of the fractional multiply result. Saturation is applied to any results that overflow, and then the function returns the 32-bit fractional q31 result. This function is for fractional Q data only and it therefore will not give correct results for true integers (because left shift by 1). For the special case where both inputs equal the MINFRACT16, the function returns a value equal to MAXFACT32, i.e. 0x7fffffff = libq_q15_mult_q15_q31(0x8000,0x8000).

This function relates to the ETSI L_mult function.

Parameters

q15 a multiplicand a

q15 b multiplicand b

Returns

q31, a*b

C

q31 libq_q31_Mult2_q15_q15 (q15, q15);