1.4.4.50 libq_q31_Mac_q31_q15_q15 Function

Multiply-Accumulate function WITH saturation

Description

Function libq_q31_Mac_q31_q15_q15():

Performs a Multiply-Accumulate function WITH saturation. This routine returns the fully fractional 32-bit result From the accumulator output SAT(addOut_Q1d31)=outQ1d15 where multOut_Q1d31 + a_Q1d31 = addOut_Q1d31, and b_Q1d15 x c_Q1d15 = multOut_Q1d31. The multiply is performed on the two 16-bit fully fully fractional input values b x c which results in a 32-bit value. This result is left shifted by one to account for the extra sign bit inherent in the fully fully fractional-type multiply. The shifted number represents a Q1d31 number with the lsb set to 0. This Q1d31 number is added with the 32-bit fully fully fractional input argument a. Saturation is applied on the output of the accumulator to keep the value within the 32-bit fully fractional range and then this value is returned. This function is for fully fractional Q-type format data only and it therefore will not give the correct results for true integers.

This function relates to the ETSI L_mac function.

Parameters

q31 a 32-bit accumulator operand 1 in Q1d31

q15 b 16-bit multiplication operand 1 in Q1d15

q15 c 16-bit multiplication operand 2 in Q1d15

Returns

q31 result, a+b*c saturated

C

q31 libq_q31_Mac_q31_q15_q15 (q31, q15, q15);