1.4.4.56 libq_q31_ShiftRight_q31_i16 Function

Arithmetic RIGHT Shift on a 32-bit value.

Description

Function libq_q31_ShiftRight_q31_q15:

Performs an Arithmetic RIGHT Shift on a 32-bit input by b bit positions. For positive shift directions (b>0), b Lsb-bits are shifted out to the right and b sign-extended Msb-bits fill in From the left. For negative shift directions (b<0), b Lsbs are shifted to the LEFT with 0s filling in the empty lsb position. The left shifting causes b Msb-bits to fall off to the left, saturation is applied to any shift left value that overflows. This function calls the left-shift function to perform any 32-bit left shifts. This function does not provide any status-type information to indicate when overflows occur.

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

negative value: # of bits to left shift (zeros inserted at LSBs)

This function relates to the ETSI L_shr function.

Parameters

q31 a 32-bit signed integer value to be shifted

i16 b 16-bit signed integer shift index

Returns

q31 result - Arithmetically shifted 32-bit signed integer output

C

q31 libq_q31_ShiftRight_q31_i16 (q31, i16);