1.4.4.40 libq_q15_ShiftLeft_q15_i16 Function

Arithmetic Shift of the 16-bit input argument.

Description

Function libq_q15_ShiftLeft_q15_i16:

Performs an Arithmetic Shift of the 16-bit input argument a left by the input argument b bit positions. If b is a positive number, a 16-bit left shift is performed with zeros inserted to the right of the shifted bits. If b is a negative number, a right shift by abs(b) positions with sign extention Saturation is applied if shifting causes an overflow or an underflow.

positive value: # of bits to left shift (zeros inserted at LSBs) {To not always saturate: if a=0, then max b=15, else max b=14}

negative value: # of bits to right shift (sign extend)

This function relates to the ETSI shl function.

Parameters

q15 a 16-bit signed integer value to be shifted.

i16 b 16-bit signed integer shift value

Returns

q15 result - arithmetically shifted 16-bit signed integer output

C

q15 libq_q15_ShiftLeft_q15_i16 (q15, i16);