CSI-DSP  Version 1.0.0
CSI DSP Software Library
Functions

Functions

void csky_dsp_lib_vec_scale_q15 (q15_t *A, q15_t scaleFract, int8_t shift, q15_t *C, uint32_t N)
 Q15 vector scale. More...
 
void csky_dsp_lib_vec_scale_q31 (q31_t *A, q31_t scaleFract, int8_t shift, q31_t *C, uint32_t N)
 Q31 vector scale. More...
 

Description

Scale means that Multiply a vector by a scalar value. For float pointing data, the algorithm used is:

    Result = Src * scale.

For fixed-point data, scale is represented by a fractional multiplication scaleFract and an arithmetic shift shift. The shift allows the gain of the scaling operation to exceed 1.0. The algorithm used with fixed-point data is:

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

The overall scale factor applied to the fixed-point data is

    scale = scaleFract * 2^shift.

support for Q15 and Q31 data.

Function Documentation

void csky_dsp_lib_vec_scale_q15 ( q15_t A,
q15_t  scaleFract,
int8_t  shift,
q15_t C,
uint32_t  N 
)
Parameters
[in]*Apoints to the input buffer
[in]scaleFactorthe fractional multiplication
[in]shiftthe shift value
[out]*Cpoints to the output buffer
[in]Nnumber of samples in each vector
Returns
none

Scaling and Overflow Behavior:

The input data *A and scaleFract are in Q15 format. The results of they are multiplied are in Q30. So the results will be shifted with saturation at last.
void csky_dsp_lib_vec_scale_q31 ( q31_t A,
q31_t  scaleFract,
int8_t  shift,
q31_t C,
uint32_t  N 
)
Parameters
[in]*Apoints to the input buffer
[in]scaleFactorthe fractional multiplication
[in]shiftthe shift value
[out]*Cpoints to the output buffer
[in]Nnumber of samples in each vector
Returns
none

Scaling and Overflow Behavior:

The input data *A and scaleFract are in Q31 format. The results of they are multiplied are in Q62. So the results will be shifted with saturation at last.