CSI-DSP  Version 1.0.0
CSI DSP Software Library
Functions

Functions

void csky_dsp_lib_vec_shf16 (q15_t *A, int8_t shift_val, uint32_t N, q15_t *C)
 Q15 vector shift. More...
 
void csky_dsp_lib_vec_shf32 (q31_t *A, int8_t shift_val, uint32_t N, q31_t *C)
 Q31 vector shift. More...
 

Description

Shift every element of a input vector by a specified number of bits, the computaional process is:

    *(C+i) = *(A+i)  << shift,   0 <= i < N.

If shift_val is positive, then the elements will be shifted to left. And if shift_val is negative, then the elements will be shifted to right. Support for q15 and q31 format.

Function Documentation

void csky_dsp_lib_vec_shf16 ( q15_t A,
int8_t  shift_val,
uint32_t  N,
q15_t C 
)
Parameters
[in]*Apoints to the input buffer a
[in]shift_valnumber of bits to be shift
[in]Nnumber of samples in the vector
[out]*Cpoints to the output buffer
Returns
none

Scaling and Overflow Behavior:

The function uses saturating arithmetic. The result will be saturated, so the output value is in the range of [0x8000, 0x7FFF].
void csky_dsp_lib_vec_shf32 ( q31_t A,
int8_t  shift_val,
uint32_t  N,
q31_t C 
)
Parameters
[in]*Apoints to the input buffer a
[in]shift_valnumber of bits to be shift
[in]Nnumber of samples in the vector
[out]*Cpoints to the output buffer
Returns
none

Scaling and Overflow Behavior:

The function uses saturating arithmetic. The result will be saturated, so the output value is in the range of [0x80000000, 0x7FFFFFFF].