CSI-DSP  Version 1.0.0
CSI DSP Software Library
Functions
Vector Absolute value

Functions

void csky_dsp_lib_vec_abs16 (q15_t *A, uint32_t N, q15_t *C)
 Q15 vector absolute value. More...
 
void csky_dsp_lib_vec_abs32 (q31_t *A, uint32_t N, q31_t *C)
 Q31 vector absolute value. More...
 

Description

compute the absolute value of every element, the computaional process is:

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

support for q15 and q31 format.

Function Documentation

void csky_dsp_lib_vec_abs16 ( q15_t A,
uint32_t  N,
q15_t C 
)
Parameters
[in]*Apoints to the input buffer
[in]Nnumber of samples in each vector
[out]*Cpoints to the output buffer
Returns
none

Scaling and Overflow Behavior:

The function uses saturating arithmetic. The Q15 value -1 (0x8000) will be saturated to the maximum allowable positive value 0x7FFF.
void csky_dsp_lib_vec_abs32 ( q31_t A,
uint32_t  N,
q31_t C 
)
Parameters
[in]*Apoints to the input buffer
[in]Nnumber of samples in each vector
[out]*Cpoints to the output buffer
Returns
none

Scaling and Overflow Behavior:

The function uses saturating arithmetic. The Q31 value -1 (0x80000000) will be saturated to the maximum allowable positive value 0x7FFFFFFF.