DSP API Reference
Functions
-
void csi_fir_q7(const csi_fir_instance_q7 *S, const q7_t *pSrc, q7_t *pDst, uint32_t blockSize)
Processing function for the Q7 FIR filter.
- Parameters:
S – [in] points to an instance of the Q7 FIR filter structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of samples to process.
-
void csi_fir_init_q7(csi_fir_instance_q7 *S, uint16_t numTaps, const q7_t *pCoeffs, q7_t *pState, uint32_t blockSize)
Initialization function for the Q7 FIR filter.
- Parameters:
S – [inout] points to an instance of the Q7 FIR structure.
numTaps – [in] Number of filter coefficients in the filter.
pCoeffs – [in] points to the filter coefficients.
pState – [in] points to the state buffer.
blockSize – [in] number of samples that are processed.
-
void csi_fir_q15(const csi_fir_instance_q15 *S, const q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Processing function for the Q15 FIR filter.
- Parameters:
S – [in] points to an instance of the Q15 FIR structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of samples to process.
-
void csi_fir_fast_q15(const csi_fir_instance_q15 *S, const q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Processing function for the fast Q15 FIR filter (fast version).
- Parameters:
S – [in] points to an instance of the Q15 FIR filter structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of samples to process.
-
csi_status csi_fir_init_q15(csi_fir_instance_q15 *S, uint16_t numTaps, const q15_t *pCoeffs, q15_t *pState, uint32_t blockSize)
Initialization function for the Q15 FIR filter.
- Parameters:
S – [inout] points to an instance of the Q15 FIR filter structure.
numTaps – [in] Number of filter coefficients in the filter. Must be even and greater than or equal to 4.
pCoeffs – [in] points to the filter coefficients.
pState – [in] points to the state buffer.
blockSize – [in] number of samples that are processed at a time.
- Returns:
The function returns either
CSI_MATH_SUCCESS
if initialization was successful orCSI_MATH_ARGUMENT_ERROR
ifnumTaps
is not a supported value.
-
void csi_fir_q31(const csi_fir_instance_q31 *S, const q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Processing function for the Q31 FIR filter.
- Parameters:
S – [in] points to an instance of the Q31 FIR filter structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of samples to process.
-
void csi_fir_fast_q31(const csi_fir_instance_q31 *S, const q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Processing function for the fast Q31 FIR filter (fast version).
- Parameters:
S – [in] points to an instance of the Q31 FIR filter structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of samples to process.
-
void csi_fir_init_q31(csi_fir_instance_q31 *S, uint16_t numTaps, const q31_t *pCoeffs, q31_t *pState, uint32_t blockSize)
Initialization function for the Q31 FIR filter.
- Parameters:
S – [inout] points to an instance of the Q31 FIR structure.
numTaps – [in] Number of filter coefficients in the filter.
pCoeffs – [in] points to the filter coefficients.
pState – [in] points to the state buffer.
blockSize – [in] number of samples that are processed at a time.
-
void csi_fir_f32(const csi_fir_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for the floating-point FIR filter.
- Parameters:
S – [in] points to an instance of the floating-point FIR structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of samples to process.
-
void csi_fir_init_f32(csi_fir_instance_f32 *S, uint16_t numTaps, const float32_t *pCoeffs, float32_t *pState, uint32_t blockSize)
Initialization function for the floating-point FIR filter.
- Parameters:
S – [inout] points to an instance of the floating-point FIR filter structure.
numTaps – [in] Number of filter coefficients in the filter.
pCoeffs – [in] points to the filter coefficients.
pState – [in] points to the state buffer.
blockSize – [in] number of samples that are processed at a time.
-
void csi_biquad_cascade_df1_q15(const csi_biquad_casd_df1_inst_q15 *S, const q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Processing function for the Q15 Biquad cascade filter.
- Parameters:
S – [in] points to an instance of the Q15 Biquad cascade structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of samples to process.
-
void csi_biquad_cascade_df1_init_q15(csi_biquad_casd_df1_inst_q15 *S, uint8_t numStages, const q15_t *pCoeffs, q15_t *pState, int8_t postShift)
Initialization function for the Q15 Biquad cascade filter.
- Parameters:
S – [inout] points to an instance of the Q15 Biquad cascade structure.
numStages – [in] number of 2nd order stages in the filter.
pCoeffs – [in] points to the filter coefficients.
pState – [in] points to the state buffer.
postShift – [in] Shift to be applied to the output. Varies according to the coefficients format
-
void csi_biquad_cascade_df1_fast_q15(const csi_biquad_casd_df1_inst_q15 *S, const q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4.
- Parameters:
S – [in] points to an instance of the Q15 Biquad cascade structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of samples to process.
-
void csi_biquad_cascade_df1_q31(const csi_biquad_casd_df1_inst_q31 *S, const q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Processing function for the Q31 Biquad cascade filter.
- Parameters:
S – [in] points to an instance of the Q31 Biquad cascade structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of samples to process.
-
void csi_biquad_cascade_df1_fast_q31(const csi_biquad_casd_df1_inst_q31 *S, const q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4.
- Parameters:
S – [in] points to an instance of the Q31 Biquad cascade structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of samples to process.
-
void csi_biquad_cascade_df1_init_q31(csi_biquad_casd_df1_inst_q31 *S, uint8_t numStages, const q31_t *pCoeffs, q31_t *pState, int8_t postShift)
Initialization function for the Q31 Biquad cascade filter.
- Parameters:
S – [inout] points to an instance of the Q31 Biquad cascade structure.
numStages – [in] number of 2nd order stages in the filter.
pCoeffs – [in] points to the filter coefficients.
pState – [in] points to the state buffer.
postShift – [in] Shift to be applied to the output. Varies according to the coefficients format
-
void csi_biquad_cascade_df1_f32(const csi_biquad_casd_df1_inst_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for the floating-point Biquad cascade filter.
- Parameters:
S – [in] points to an instance of the floating-point Biquad cascade structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of samples to process.
-
void csi_biquad_cascade_df1_init_f32(csi_biquad_casd_df1_inst_f32 *S, uint8_t numStages, const float32_t *pCoeffs, float32_t *pState)
Initialization function for the floating-point Biquad cascade filter.
- Parameters:
S – [inout] points to an instance of the floating-point Biquad cascade structure.
numStages – [in] number of 2nd order stages in the filter.
pCoeffs – [in] points to the filter coefficients.
pState – [in] points to the state buffer.
-
csi_status csi_mat_add_f32(const csi_matrix_instance_f32 *pSrcA, const csi_matrix_instance_f32 *pSrcB, csi_matrix_instance_f32 *pDst)
Floating-point matrix addition.
- Parameters:
pSrcA – [in] points to the first input matrix structure
pSrcB – [in] points to the second input matrix structure
pDst – [out] points to output matrix structure
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_add_q15(const csi_matrix_instance_q15 *pSrcA, const csi_matrix_instance_q15 *pSrcB, csi_matrix_instance_q15 *pDst)
Q15 matrix addition.
- Parameters:
pSrcA – [in] points to the first input matrix structure
pSrcB – [in] points to the second input matrix structure
pDst – [out] points to output matrix structure
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_add_q31(const csi_matrix_instance_q31 *pSrcA, const csi_matrix_instance_q31 *pSrcB, csi_matrix_instance_q31 *pDst)
Q31 matrix addition.
- Parameters:
pSrcA – [in] points to the first input matrix structure
pSrcB – [in] points to the second input matrix structure
pDst – [out] points to output matrix structure
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_cmplx_mult_f32(const csi_matrix_instance_f32 *pSrcA, const csi_matrix_instance_f32 *pSrcB, csi_matrix_instance_f32 *pDst)
Floating-point, complex, matrix multiplication.
- Parameters:
pSrcA – [in] points to the first input matrix structure
pSrcB – [in] points to the second input matrix structure
pDst – [out] points to output matrix structure
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_cmplx_mult_q15(const csi_matrix_instance_q15 *pSrcA, const csi_matrix_instance_q15 *pSrcB, csi_matrix_instance_q15 *pDst)
Q15, complex, matrix multiplication.
- Parameters:
pSrcA – [in] points to the first input matrix structure
pSrcB – [in] points to the second input matrix structure
pDst – [out] points to output matrix structure
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
void csi_mult_q15xq31_sht(q15_t *pSrcA, q31_t *pSrcB, uint32_t shiftValue, uint32_t blockSize)
-
csi_status csi_mat_cmplx_mult_q31(const csi_matrix_instance_q31 *pSrcA, const csi_matrix_instance_q31 *pSrcB, csi_matrix_instance_q31 *pDst)
Q31, complex, matrix multiplication.
- Parameters:
pSrcA – [in] points to the first input matrix structure
pSrcB – [in] points to the second input matrix structure
pDst – [out] points to output matrix structure
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_trans_f32(const csi_matrix_instance_f32 *pSrc, csi_matrix_instance_f32 *pDst)
Floating-point matrix transpose.
- Parameters:
pSrc – [in] points to the input matrix
pDst – [out] points to the output matrix
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_trans_q15(const csi_matrix_instance_q15 *pSrc, csi_matrix_instance_q15 *pDst)
Q15 matrix transpose.
- Parameters:
pSrc – [in] points to the input matrix
pDst – [out] points to the output matrix
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_trans_q31(const csi_matrix_instance_q31 *pSrc, csi_matrix_instance_q31 *pDst)
Q31 matrix transpose.
- Parameters:
pSrc – [in] points to the input matrix
pDst – [out] points to the output matrix
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_mult_f32(const csi_matrix_instance_f32 *pSrcA, const csi_matrix_instance_f32 *pSrcB, csi_matrix_instance_f32 *pDst)
Floating-point matrix multiplication.
- Parameters:
pSrcA – [in] points to the first input matrix structure
pSrcB – [in] points to the second input matrix structure
pDst – [out] points to output matrix structure
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_mult_q15(const csi_matrix_instance_q15 *pSrcA, const csi_matrix_instance_q15 *pSrcB, csi_matrix_instance_q15 *pDst)
Q15 matrix multiplication.
- Parameters:
pSrcA – [in] points to the first input matrix structure
pSrcB – [in] points to the second input matrix structure
pDst – [out] points to output matrix structure
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_mult_trans_q15(const csi_matrix_instance_q15 *pSrcA, const csi_matrix_instance_q15 *pSrcB, csi_matrix_instance_q15 *pDst)
-
csi_status csi_mat_mult_fast_q15(const csi_matrix_instance_q15 *pSrcA, const csi_matrix_instance_q15 *pSrcB, csi_matrix_instance_q15 *pDst)
Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4.
- Parameters:
pSrcA – [in] points to the first input matrix structure
pSrcB – [in] points to the second input matrix structure
pDst – [out] points to output matrix structure
pState – [in] points to the array for storing intermediate results
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_mult_q31(const csi_matrix_instance_q31 *pSrcA, const csi_matrix_instance_q31 *pSrcB, csi_matrix_instance_q31 *pDst)
Q31 matrix multiplication.
- Parameters:
pSrcA – [in] points to the first input matrix structure
pSrcB – [in] points to the second input matrix structure
pDst – [out] points to output matrix structure
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_mult_trans_q31(const csi_matrix_instance_q31 *pSrcA, const csi_matrix_instance_q31 *pSrcB, csi_matrix_instance_q31 *pDst)
-
csi_status csi_mat_mult_fast_q31(const csi_matrix_instance_q31 *pSrcA, const csi_matrix_instance_q31 *pSrcB, csi_matrix_instance_q31 *pDst)
Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4.
- Parameters:
pSrcA – [in] points to the first input matrix structure
pSrcB – [in] points to the second input matrix structure
pDst – [out] points to output matrix structure
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_sub_f32(const csi_matrix_instance_f32 *pSrcA, const csi_matrix_instance_f32 *pSrcB, csi_matrix_instance_f32 *pDst)
Floating-point matrix subtraction.
- Parameters:
pSrcA – [in] points to the first input matrix structure
pSrcB – [in] points to the second input matrix structure
pDst – [out] points to output matrix structure
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_sub_q15(const csi_matrix_instance_q15 *pSrcA, const csi_matrix_instance_q15 *pSrcB, csi_matrix_instance_q15 *pDst)
Q15 matrix subtraction.
- Parameters:
pSrcA – [in] points to the first input matrix structure
pSrcB – [in] points to the second input matrix structure
pDst – [out] points to output matrix structure
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_sub_q31(const csi_matrix_instance_q31 *pSrcA, const csi_matrix_instance_q31 *pSrcB, csi_matrix_instance_q31 *pDst)
Q31 matrix subtraction.
- Parameters:
pSrcA – [in] points to the first input matrix structure
pSrcB – [in] points to the second input matrix structure
pDst – [out] points to output matrix structure
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
void csi_sum_q15(q15_t *pSrcA, q63_t *pDst, uint32_t blockSize)
-
csi_status csi_mat_scale_f32(const csi_matrix_instance_f32 *pSrc, float32_t scale, csi_matrix_instance_f32 *pDst)
Floating-point matrix scaling.
- Parameters:
pSrc – [in] points to the input matrix
scale – [in] scale factor
pDst – [out] points to the output matrix
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_scale_q15(const csi_matrix_instance_q15 *pSrc, q15_t scaleFract, int32_t shift, csi_matrix_instance_q15 *pDst)
Q15 matrix scaling.
- Parameters:
pSrc – [in] points to input matrix
scaleFract – [in] fractional portion of the scale factor
shift – [in] number of bits to shift the result by
pDst – [out] points to output matrix
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
csi_status csi_mat_scale_q31(const csi_matrix_instance_q31 *pSrc, q31_t scaleFract, int32_t shift, csi_matrix_instance_q31 *pDst)
Q31 matrix scaling.
- Parameters:
pSrc – [in] points to input matrix
scaleFract – [in] fractional portion of the scale factor
shift – [in] number of bits to shift the result by
pDst – [out] points to output matrix structure
- Returns:
The function returns either
CSI_MATH_SIZE_MISMATCH
orCSI_MATH_SUCCESS
based on the outcome of size checking.
-
void csi_mat_init_q31(csi_matrix_instance_q31 *S, uint16_t nRows, uint16_t nColumns, q31_t *pData)
Q31 matrix initialization.
- Parameters:
S – [inout] points to an instance of the floating-point matrix structure.
nRows – [in] number of rows in the matrix.
nColumns – [in] number of columns in the matrix.
pData – [in] points to the matrix data array.
-
void csi_mat_init_q15(csi_matrix_instance_q15 *S, uint16_t nRows, uint16_t nColumns, q15_t *pData)
Q15 matrix initialization.
- Parameters:
S – [inout] points to an instance of the floating-point matrix structure.
nRows – [in] number of rows in the matrix.
nColumns – [in] number of columns in the matrix.
pData – [in] points to the matrix data array.
-
void csi_mat_init_f32(csi_matrix_instance_f32 *S, uint16_t nRows, uint16_t nColumns, float32_t *pData)
Floating-point matrix initialization.
- Parameters:
S – [inout] points to an instance of the floating-point matrix structure.
nRows – [in] number of rows in the matrix.
nColumns – [in] number of columns in the matrix.
pData – [in] points to the matrix data array.
-
void csi_pid_init_f32(csi_pid_instance_f32 *S, int32_t resetStateFlag)
Initialization function for the floating-point PID Control.
- Parameters:
S – [inout] points to an instance of the PID structure.
resetStateFlag – [in] flag to reset the state. 0 = no change in state 1 = reset the state.
-
void csi_pid_reset_f32(csi_pid_instance_f32 *S)
Reset function for the floating-point PID Control.
- Parameters:
S – [inout] is an instance of the floating-point PID Control structure
-
void csi_pid_init_q31(csi_pid_instance_q31 *S, int32_t resetStateFlag)
Initialization function for the Q31 PID Control.
- Parameters:
S – [inout] points to an instance of the Q15 PID structure.
resetStateFlag – [in] flag to reset the state. 0 = no change in state 1 = reset the state.
-
void csi_pid_reset_q31(csi_pid_instance_q31 *S)
Reset function for the Q31 PID Control.
- Parameters:
S – [inout] points to an instance of the Q31 PID Control structure
-
void csi_pid_init_q15(csi_pid_instance_q15 *S, int32_t resetStateFlag)
Initialization function for the Q15 PID Control.
- Parameters:
S – [inout] points to an instance of the Q15 PID structure.
resetStateFlag – [in] flag to reset the state. 0 = no change in state 1 = reset the state.
-
void csi_pid_reset_q15(csi_pid_instance_q15 *S)
Reset function for the Q15 PID Control.
- Parameters:
S – [inout] points to an instance of the q15 PID Control structure
-
void csi_mult_q7(const q7_t *pSrcA, const q7_t *pSrcB, q7_t *pDst, uint32_t blockSize)
Q7 vector multiplication.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in each vector
-
void csi_mult_q15(const q15_t *pSrcA, const q15_t *pSrcB, q15_t *pDst, uint32_t blockSize)
Q15 vector multiplication.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in each vector
-
void csi_mult_rnd_q15(q15_t *pSrcA, q15_t *pSrcB, q15_t *pDst, uint32_t blockSize)
-
void csi_mult_q31(const q31_t *pSrcA, const q31_t *pSrcB, q31_t *pDst, uint32_t blockSize)
Q31 vector multiplication.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in each vector
-
void csi_mult_f32(const float32_t *pSrcA, const float32_t *pSrcB, float32_t *pDst, uint32_t blockSize)
Floating-point vector multiplication.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in each vector
-
csi_status csi_cfft_radix2_init_q15(csi_cfft_radix2_instance_q15 *S, uint16_t fftLen, uint8_t ifftFlag, uint8_t bitReverseFlag)
-
void csi_cfft_radix2_q15(const csi_cfft_radix2_instance_q15 *S, q15_t *pSrc)
-
csi_status csi_cfft_radix4_init_q15(csi_cfft_radix4_instance_q15 *S, uint16_t fftLen, uint8_t ifftFlag, uint8_t bitReverseFlag)
-
void csi_cfft_radix4_q15(const csi_cfft_radix4_instance_q15 *S, q15_t *pSrc)
-
csi_status csi_cfft_radix2_init_q31(csi_cfft_radix2_instance_q31 *S, uint16_t fftLen, uint8_t ifftFlag, uint8_t bitReverseFlag)
-
void csi_cfft_radix2_q31(const csi_cfft_radix2_instance_q31 *S, q31_t *pSrc)
-
void csi_cfft_radix4_q31(const csi_cfft_radix4_instance_q31 *S, q31_t *pSrc)
-
csi_status csi_cfft_radix4_init_q31(csi_cfft_radix4_instance_q31 *S, uint16_t fftLen, uint8_t ifftFlag, uint8_t bitReverseFlag)
-
csi_status csi_cfft_radix2_init_f32(csi_cfft_radix2_instance_f32 *S, uint16_t fftLen, uint8_t ifftFlag, uint8_t bitReverseFlag)
-
void csi_cfft_radix2_f32(const csi_cfft_instance_f32 *S, float32_t *p1, uint8_t ifftFlag, uint8_t bitReverseFlag, float32_t onebyfftLen)
-
csi_status csi_cfft_radix4_init_f32(csi_cfft_radix4_instance_f32 *S, uint16_t fftLen, uint8_t ifftFlag, uint8_t bitReverseFlag)
-
void csi_cfft_radix4_f32(const csi_cfft_instance_f32 *S, float32_t *p1, uint8_t ifftFlag, uint8_t bitReverseFlag, float32_t onebyfftLen)
-
void csi_cfft_fast_radix4_f32(const csi_cfft_instance_f32 *S, float32_t *p1, uint8_t ifftFlag, uint8_t bitReverseFlag, float32_t onebyfftLen)
-
void csi_cfft_q15(const csi_cfft_instance_q15 *S, q15_t *p1, uint8_t ifftFlag, uint8_t bitReverseFlag)
-
void csi_cfft_fast_q15(const csi_cfft_instance_q15 *S, q15_t *p1, uint8_t ifftFlag, uint8_t bitReverseFlag)
-
void csi_cfft_q31(const csi_cfft_instance_q31 *S, q31_t *p1, uint8_t ifftFlag, uint8_t bitReverseFlag)
-
void csi_cfft_fast_q31(const csi_cfft_instance_q31 *S, q31_t *p1, uint8_t ifftFlag, uint8_t bitReverseFlag)
-
void csi_cfft_f32(const csi_cfft_instance_f32 *S, float32_t *p1, uint8_t ifftFlag, uint8_t bitReverseFlag)
-
csi_status csi_rfft_init_q15(csi_rfft_instance_q15 *S, uint32_t fftLenReal, uint32_t ifftFlagR, uint32_t bitReverseFlag)
-
void csi_rfft_q15(const csi_rfft_instance_q15 *S, q15_t *pSrc, q15_t *pDst)
-
void csi_rfft_fast_q15(const csi_rfft_fast_instance_q15 *S, q15_t *pSrc, q15_t *pDst)
-
csi_status csi_rfft_init_q31(csi_rfft_instance_q31 *S, uint32_t fftLenReal, uint32_t ifftFlagR, uint32_t bitReverseFlag)
-
void csi_rfft_q31(const csi_rfft_instance_q31 *S, q31_t *pSrc, q31_t *pDst)
-
void csi_rfft_fast_q31(const csi_rfft_fast_instance_q31 *S, q31_t *pSrc, q31_t *pDst)
-
csi_status csi_rfft_init_f32(csi_rfft_instance_f32 *S, csi_cfft_radix4_instance_f32 *S_CFFT, uint32_t fftLenReal, uint32_t ifftFlagR, uint32_t bitReverseFlag)
-
void csi_rfft_f32(const csi_rfft_instance_f32 *S, float32_t *pSrc, float32_t *pDst)
-
csi_status csi_rfft_fast_init_f32(csi_rfft_fast_instance_f32 *S, uint16_t fftLen)
-
csi_status csi_rfft_32_fast_init_f32(csi_rfft_fast_instance_f32 *S)
-
csi_status csi_rfft_64_fast_init_f32(csi_rfft_fast_instance_f32 *S)
-
csi_status csi_rfft_128_fast_init_f32(csi_rfft_fast_instance_f32 *S)
-
csi_status csi_rfft_256_fast_init_f32(csi_rfft_fast_instance_f32 *S)
-
csi_status csi_rfft_512_fast_init_f32(csi_rfft_fast_instance_f32 *S)
-
csi_status csi_rfft_1024_fast_init_f32(csi_rfft_fast_instance_f32 *S)
-
csi_status csi_rfft_2048_fast_init_f32(csi_rfft_fast_instance_f32 *S)
-
csi_status csi_rfft_4096_fast_init_f32(csi_rfft_fast_instance_f32 *S)
-
void csi_rfft_fast_f32(csi_rfft_fast_instance_f32 *S, float32_t *p, float32_t *pOut, uint8_t ifftFlag)
-
csi_status csi_dct4_init_f32(csi_dct4_instance_f32 *S, csi_rfft_fast_instance_f32 *S_RFFT, csi_cfft_radix4_instance_f32 *S_CFFT, uint16_t N, uint16_t Nby2, float32_t normalize)
Initialization function for the floating-point DCT4/IDCT4.
- Parameters:
S – [inout] points to an instance of floating-point DCT4/IDCT4 structure.
S_RFFT – [in] points to an instance of floating-point RFFT/RIFFT structure.
S_CFFT – [in] points to an instance of floating-point CFFT/CIFFT structure.
N – [in] length of the DCT4.
Nby2 – [in] half of the length of the DCT4.
normalize – [in] normalizing factor.
- Returns:
csi_status function returns CSI_MATH_SUCCESS if initialization is successful or CSI_MATH_ARGUMENT_ERROR if
fftLenReal
is not a supported transform length.
-
void csi_dct4_f32(const csi_dct4_instance_f32 *S, float32_t *pState, float32_t *pInlineBuffer)
Processing function for the floating-point DCT4/IDCT4.
- Parameters:
S – [in] points to an instance of the floating-point DCT4/IDCT4 structure.
pState – [in] points to state buffer.
pInlineBuffer – [inout] points to the in-place input and output buffer.
-
csi_status csi_dct4_init_q31(csi_dct4_instance_q31 *S, csi_rfft_instance_q31 *S_RFFT, csi_cfft_radix4_instance_q31 *S_CFFT, uint16_t N, uint16_t Nby2, q31_t normalize)
Initialization function for the Q31 DCT4/IDCT4.
- Parameters:
S – [inout] points to an instance of Q31 DCT4/IDCT4 structure.
S_RFFT – [in] points to an instance of Q31 RFFT/RIFFT structure
S_CFFT – [in] points to an instance of Q31 CFFT/CIFFT structure
N – [in] length of the DCT4.
Nby2 – [in] half of the length of the DCT4.
normalize – [in] normalizing factor.
- Returns:
csi_status function returns CSI_MATH_SUCCESS if initialization is successful or CSI_MATH_ARGUMENT_ERROR if
N
is not a supported transform length.
-
void csi_dct4_q31(const csi_dct4_instance_q31 *S, q31_t *pState, q31_t *pInlineBuffer)
Processing function for the Q31 DCT4/IDCT4.
- Parameters:
S – [in] points to an instance of the Q31 DCT4 structure.
pState – [in] points to state buffer.
pInlineBuffer – [inout] points to the in-place input and output buffer.
-
void csi_dct4_fast_q31(const csi_dct4_fast_instance_q31 *S, q31_t *pState, q31_t *pInlineBuffer)
-
csi_status csi_dct4_init_q15(csi_dct4_instance_q15 *S, csi_rfft_instance_q15 *S_RFFT, csi_cfft_radix4_instance_q15 *S_CFFT, uint16_t N, uint16_t Nby2, q15_t normalize)
Initialization function for the Q15 DCT4/IDCT4.
- Parameters:
S – [inout] points to an instance of Q15 DCT4/IDCT4 structure.
S_RFFT – [in] points to an instance of Q15 RFFT/RIFFT structure.
S_CFFT – [in] points to an instance of Q15 CFFT/CIFFT structure.
N – [in] length of the DCT4.
Nby2 – [in] half of the length of the DCT4.
normalize – [in] normalizing factor.
- Returns:
csi_status function returns CSI_MATH_SUCCESS if initialization is successful or CSI_MATH_ARGUMENT_ERROR if
N
is not a supported transform length.
-
void csi_dct4_q15(const csi_dct4_instance_q15 *S, q15_t *pState, q15_t *pInlineBuffer)
Processing function for the Q15 DCT4/IDCT4.
- Parameters:
S – [in] points to an instance of the Q15 DCT4 structure.
pState – [in] points to state buffer.
pInlineBuffer – [inout] points to the in-place input and output buffer.
-
void csi_dct4_fast_q15(const csi_dct4_fast_instance_q15 *S, q15_t *pState, q15_t *pInlineBuffer)
-
void csi_add_f32(const float32_t *pSrcA, const float32_t *pSrcB, float32_t *pDst, uint32_t blockSize)
Floating-point vector addition.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in each vector
-
void csi_add_q7(const q7_t *pSrcA, const q7_t *pSrcB, q7_t *pDst, uint32_t blockSize)
Q7 vector addition.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in each vector
-
void csi_add_q15(const q15_t *pSrcA, const q15_t *pSrcB, q15_t *pDst, uint32_t blockSize)
Q15 vector addition.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in each vector
-
void csi_add_q31(const q31_t *pSrcA, const q31_t *pSrcB, q31_t *pDst, uint32_t blockSize)
Q31 vector addition.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in each vector
-
void csi_sub_f32(const float32_t *pSrcA, const float32_t *pSrcB, float32_t *pDst, uint32_t blockSize)
Floating-point vector subtraction.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in each vector
-
void csi_sub_q7(const q7_t *pSrcA, const q7_t *pSrcB, q7_t *pDst, uint32_t blockSize)
Q7 vector subtraction.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in each vector
-
void csi_sub_q15(const q15_t *pSrcA, const q15_t *pSrcB, q15_t *pDst, uint32_t blockSize)
Q15 vector subtraction.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in each vector
-
void csi_sub_q31(const q31_t *pSrcA, const q31_t *pSrcB, q31_t *pDst, uint32_t blockSize)
Q31 vector subtraction.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in each vector
-
void csi_scale_f32(const float32_t *pSrc, float32_t scale, float32_t *pDst, uint32_t blockSize)
Multiplies a floating-point vector by a scalar.
- Parameters:
pSrc – [in] points to the input vector
scale – [in] scale factor to be applied
pDst – [out] points to the output vector
blockSize – [in] number of samples in the vector
-
void csi_scale_q7(const q7_t *pSrc, q7_t scaleFract, int8_t shift, q7_t *pDst, uint32_t blockSize)
Multiplies a Q7 vector by a scalar.
- Parameters:
pSrc – [in] points to the input vector
scaleFract – [in] fractional portion of the scale value
shift – [in] number of bits to shift the result by
pDst – [out] points to the output vector
blockSize – [in] number of samples in the vector
-
void csi_scale_q15(const q15_t *pSrc, q15_t scaleFract, int8_t shift, q15_t *pDst, uint32_t blockSize)
Multiplies a Q15 vector by a scalar.
- Parameters:
pSrc – [in] points to the input vector
scaleFract – [in] fractional portion of the scale value
shift – [in] number of bits to shift the result by
pDst – [out] points to the output vector
blockSize – [in] number of samples in the vector
-
void csi_scale_q31(const q31_t *pSrc, q31_t scaleFract, int8_t shift, q31_t *pDst, uint32_t blockSize)
Multiplies a Q31 vector by a scalar.
- Parameters:
pSrc – [in] points to the input vector
scaleFract – [in] fractional portion of the scale value
shift – [in] number of bits to shift the result by
pDst – [out] points to the output vector
blockSize – [in] number of samples in the vector
-
void csi_abs_q7(const q7_t *pSrc, q7_t *pDst, uint32_t blockSize)
Q7 vector absolute value.
- Parameters:
pSrc – [in] points to the input buffer
pDst – [out] points to the output buffer
blockSize – [in] number of samples in each vector
-
void csi_abs_f32(const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Floating-point vector absolute value.
- Parameters:
pSrc – [in] points to the input buffer
pDst – [out] points to the output buffer
blockSize – [in] number of samples in each vector
-
void csi_abs_q15(const q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Q15 vector absolute value.
- Parameters:
pSrc – [in] points to the input buffer
pDst – [out] points to the output buffer
blockSize – [in] number of samples in each vector
-
void csi_abs_q31(const q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Q31 vector absolute value.
- Parameters:
pSrc – [in] points to the input buffer
pDst – [out] points to the output buffer
blockSize – [in] number of samples in each vector
-
void csi_abs_max_q15(q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
-
void csi_abs_max_q31(q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
-
void csi_dot_prod_f32(const float32_t *pSrcA, const float32_t *pSrcB, uint32_t blockSize, float32_t *result)
Dot product of floating-point vectors.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
blockSize – [in] number of samples in each vector
result – [out] output result returned here
-
void csi_dot_prod_q7(const q7_t *pSrcA, const q7_t *pSrcB, uint32_t blockSize, q31_t *result)
Dot product of Q7 vectors.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
blockSize – [in] number of samples in each vector
result – [out] output result returned here
-
void csi_dot_prod_q15(const q15_t *pSrcA, const q15_t *pSrcB, uint32_t blockSize, q63_t *result)
Dot product of Q15 vectors.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
blockSize – [in] number of samples in each vector
result – [out] output result returned here
-
void csi_dot_prod_q31(const q31_t *pSrcA, const q31_t *pSrcB, uint32_t blockSize, q63_t *result)
Dot product of Q31 vectors.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
blockSize – [in] number of samples in each vector
result – [out] output result returned here
-
void csi_shift_q7(const q7_t *pSrc, int8_t shiftBits, q7_t *pDst, uint32_t blockSize)
Shifts the elements of a Q7 vector a specified number of bits.
- Parameters:
pSrc – [in] points to the input vector
shiftBits – [in] number of bits to shift. A positive value shifts left; a negative value shifts right.
pDst – [out] points to the output vector
blockSize – [in] number of samples in the vector
-
void csi_shift_q15(const q15_t *pSrc, int8_t shiftBits, q15_t *pDst, uint32_t blockSize)
Shifts the elements of a Q15 vector a specified number of bits.
- Parameters:
pSrc – [in] points to the input vector
shiftBits – [in] number of bits to shift. A positive value shifts left; a negative value shifts right.
pDst – [out] points to the output vector
blockSize – [in] number of samples in the vector
-
void csi_shift_q31(const q31_t *pSrc, int8_t shiftBits, q31_t *pDst, uint32_t blockSize)
Shifts the elements of a Q31 vector a specified number of bits.
- Parameters:
pSrc – [in] points to the input vector
shiftBits – [in] number of bits to shift. A positive value shifts left; a negative value shifts right.
pDst – [out] points to the output vector
blockSize – [in] number of samples in the vector
-
void csi_offset_f32(const float32_t *pSrc, float32_t offset, float32_t *pDst, uint32_t blockSize)
Adds a constant offset to a floating-point vector.
- Parameters:
pSrc – [in] points to the input vector
offset – [in] is the offset to be added
pDst – [out] points to the output vector
blockSize – [in] number of samples in the vector
-
void csi_offset_q7(const q7_t *pSrc, q7_t offset, q7_t *pDst, uint32_t blockSize)
Adds a constant offset to a Q7 vector.
- Parameters:
pSrc – [in] points to the input vector
offset – [in] is the offset to be added
pDst – [out] points to the output vector
blockSize – [in] number of samples in the vector
-
void csi_offset_q15(const q15_t *pSrc, q15_t offset, q15_t *pDst, uint32_t blockSize)
Adds a constant offset to a Q15 vector.
- Parameters:
pSrc – [in] points to the input vector
offset – [in] is the offset to be added
pDst – [out] points to the output vector
blockSize – [in] number of samples in the vector
-
void csi_offset_q31(const q31_t *pSrc, q31_t offset, q31_t *pDst, uint32_t blockSize)
Adds a constant offset to a Q31 vector.
- Parameters:
pSrc – [in] points to the input vector
offset – [in] is the offset to be added
pDst – [out] points to the output vector
blockSize – [in] number of samples in the vector
-
void csi_negate_f32(const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Negates the elements of a floating-point vector.
- Parameters:
pSrc – [in] points to the input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in the vector
-
void csi_negate_q7(const q7_t *pSrc, q7_t *pDst, uint32_t blockSize)
Negates the elements of a Q7 vector.
- Parameters:
pSrc – [in] points to the input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in the vector
-
void csi_negate_q15(const q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Negates the elements of a Q15 vector.
- Parameters:
pSrc – [in] points to the input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in the vector
-
void csi_negate_q31(const q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Negates the elements of a Q31 vector.
- Parameters:
pSrc – [in] points to the input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in the vector
-
void csi_copy_f32(const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Copies the elements of a floating-point vector.
- Parameters:
pSrc – [in] input pointer
pDst – [out] output pointer
blockSize – [in] number of samples to process
-
void csi_copy_q7(const q7_t *pSrc, q7_t *pDst, uint32_t blockSize)
Copies the elements of a Q7 vector.
- Parameters:
pSrc – [in] input pointer
pDst – [out] output pointer
blockSize – [in] number of samples to process
-
void csi_copy_q15(const q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Copies the elements of a Q15 vector.
- Parameters:
pSrc – [in] input pointer
pDst – [out] output pointer
blockSize – [in] number of samples to process
-
void csi_copy_q31(const q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Copies the elements of a Q31 vector.
- Parameters:
pSrc – [in] input pointer
pDst – [out] output pointer
blockSize – [in] number of samples to process
-
void csi_fill_f32(float32_t value, float32_t *pDst, uint32_t blockSize)
Fills a constant value into a floating-point vector.
- Parameters:
value – [in] input value to be filled
pDst – [out] output pointer
blockSize – [in] number of samples to process
-
void csi_fill_q7(q7_t value, q7_t *pDst, uint32_t blockSize)
Fills a constant value into a Q7 vector.
- Parameters:
value – [in] input value to be filled
pDst – [out] output pointer
blockSize – [in] number of samples to process
-
void csi_fill_q15(q15_t value, q15_t *pDst, uint32_t blockSize)
Fills a constant value into a Q15 vector.
- Parameters:
value – [in] input value to be filled
pDst – [out] output pointer
blockSize – [in] number of samples to process
-
void csi_fill_q31(q31_t value, q31_t *pDst, uint32_t blockSize)
Fills a constant value into a Q31 vector.
- Parameters:
value – [in] input value to be filled
pDst – [out] output pointer
blockSize – [in] number of samples to process
-
void csi_conv_f32(const float32_t *pSrcA, uint32_t srcALen, const float32_t *pSrcB, uint32_t srcBLen, float32_t *pDst)
Convolution of floating-point sequences.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the location where the output result is written. Length srcALen+srcBLen-1.
-
void csi_conv_opt_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, q15_t *pScratch1, q15_t *pScratch2)
Convolution of Q15 sequences.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data Length srcALen+srcBLen-1.
pScratch1 – [in] points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
pScratch2 – [in] points to scratch buffer of size min(srcALen, srcBLen).
-
void csi_conv_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst)
Convolution of Q15 sequences.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the location where the output result is written. Length srcALen+srcBLen-1.
-
void csi_conv_fast_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst)
Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data Length srcALen+srcBLen-1.
-
void csi_conv_fast_opt_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, q15_t *pScratch1, q15_t *pScratch2)
Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data Length srcALen+srcBLen-1.
pScratch1 – [in] points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
pScratch2 – [in] points to scratch buffer of size min(srcALen, srcBLen).
-
void csi_conv_q31(const q31_t *pSrcA, uint32_t srcALen, const q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst)
Convolution of Q31 sequences.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data Length srcALen+srcBLen-1.
-
void csi_conv_fast_q31(const q31_t *pSrcA, uint32_t srcALen, const q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst)
Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data Length srcALen+srcBLen-1.
-
void csi_conv_opt_q7(const q7_t *pSrcA, uint32_t srcALen, const q7_t *pSrcB, uint32_t srcBLen, q7_t *pDst, q15_t *pScratch1, q15_t *pScratch2)
Convolution of Q7 sequences.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data Length srcALen+srcBLen-1.
pScratch1 – [in] points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
pScratch2 – [in] points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
-
void csi_conv_q7(const q7_t *pSrcA, uint32_t srcALen, const q7_t *pSrcB, uint32_t srcBLen, q7_t *pDst)
Convolution of Q7 sequences.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data Length srcALen+srcBLen-1.
-
csi_status csi_conv_partial_f32(const float32_t *pSrcA, uint32_t srcALen, const float32_t *pSrcB, uint32_t srcBLen, float32_t *pDst, uint32_t firstIndex, uint32_t numPoints)
Partial convolution of floating-point sequences.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data
firstIndex – [in] is the first output sample to start with.
numPoints – [in] is the number of output points to be computed.
- Returns:
Returns either CSI_MATH_SUCCESS if the function completed correctly or CSI_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
-
csi_status csi_conv_partial_opt_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, uint32_t firstIndex, uint32_t numPoints, q15_t *pScratch1, q15_t *pScratch2)
Partial convolution of Q15 sequences.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data
firstIndex – [in] is the first output sample to start with.
numPoints – [in] is the number of output points to be computed.
pScratch1 – [in] points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
pScratch2 – [in] points to scratch buffer of size min(srcALen, srcBLen).
- Returns:
Returns either CSI_MATH_SUCCESS if the function completed correctly or CSI_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
-
csi_status csi_conv_partial_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, uint32_t firstIndex, uint32_t numPoints)
Partial convolution of Q15 sequences.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data
firstIndex – [in] is the first output sample to start with.
numPoints – [in] is the number of output points to be computed.
- Returns:
Returns either CSI_MATH_SUCCESS if the function completed correctly or CSI_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
-
csi_status csi_conv_partial_fast_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, uint32_t firstIndex, uint32_t numPoints)
Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data
firstIndex – [in] is the first output sample to start with.
numPoints – [in] is the number of output points to be computed.
- Returns:
Returns either CSI_MATH_SUCCESS if the function completed correctly or CSI_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
-
csi_status csi_conv_partial_fast_opt_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, uint32_t firstIndex, uint32_t numPoints, q15_t *pScratch1, q15_t *pScratch2)
Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data
firstIndex – [in] is the first output sample to start with.
numPoints – [in] is the number of output points to be computed.
pScratch1 – [in] points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
pScratch2 – [in] points to scratch buffer of size min(srcALen, srcBLen).
- Returns:
Returns either CSI_MATH_SUCCESS if the function completed correctly or CSI_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
-
csi_status csi_conv_partial_q31(const q31_t *pSrcA, uint32_t srcALen, const q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst, uint32_t firstIndex, uint32_t numPoints)
Partial convolution of Q31 sequences.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data
firstIndex – [in] is the first output sample to start with.
numPoints – [in] is the number of output points to be computed.
- Returns:
Returns either CSI_MATH_SUCCESS if the function completed correctly or CSI_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
-
csi_status csi_conv_partial_fast_q31(const q31_t *pSrcA, uint32_t srcALen, const q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst, uint32_t firstIndex, uint32_t numPoints)
Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data
firstIndex – [in] is the first output sample to start with.
numPoints – [in] is the number of output points to be computed.
- Returns:
Returns either CSI_MATH_SUCCESS if the function completed correctly or CSI_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
-
csi_status csi_conv_partial_opt_q7(const q7_t *pSrcA, uint32_t srcALen, const q7_t *pSrcB, uint32_t srcBLen, q7_t *pDst, uint32_t firstIndex, uint32_t numPoints, q15_t *pScratch1, q15_t *pScratch2)
Partial convolution of Q7 sequences.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data
firstIndex – [in] is the first output sample to start with.
numPoints – [in] is the number of output points to be computed.
pScratch1 – [in] points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
pScratch2 – [in] points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
- Returns:
Returns either CSI_MATH_SUCCESS if the function completed correctly or CSI_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
-
csi_status csi_conv_partial_q7(const q7_t *pSrcA, uint32_t srcALen, const q7_t *pSrcB, uint32_t srcBLen, q7_t *pDst, uint32_t firstIndex, uint32_t numPoints)
Partial convolution of Q7 sequences.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data
firstIndex – [in] is the first output sample to start with.
numPoints – [in] is the number of output points to be computed.
- Returns:
Returns either CSI_MATH_SUCCESS if the function completed correctly or CSI_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2].
-
void csi_fir_decimate_f32(const csi_fir_decimate_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for floating-point FIR decimator.
- Parameters:
S – [in] points to an instance of the floating-point FIR decimator structure
pSrc – [in] points to the block of input data
pDst – [out] points to the block of output data
blockSize – [in] number of samples to process
-
csi_status csi_fir_decimate_init_f32(csi_fir_decimate_instance_f32 *S, uint16_t numTaps, uint8_t M, const float32_t *pCoeffs, float32_t *pState, uint32_t blockSize)
Initialization function for the floating-point FIR decimator.
- Parameters:
S – [inout] points to an instance of the floating-point FIR decimator structure
numTaps – [in] number of coefficients in the filter
M – [in] decimation factor
pCoeffs – [in] points to the filter coefficients
pState – [in] points to the state buffer
blockSize – [in] number of input samples to process per call
- Returns:
execution status
CSI_MATH_SUCCESS : Operation successful
CSI_MATH_LENGTH_ERROR :
blockSize
is not a multiple ofM
-
void csi_fir_decimate_q15(const csi_fir_decimate_instance_q15 *S, const q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Processing function for the Q15 FIR decimator.
- Parameters:
S – [in] points to an instance of the Q15 FIR decimator structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data
blockSize – [in] number of input samples to process per call.
-
void csi_fir_decimate_fast_q15(const csi_fir_decimate_instance_q15 *S, const q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
- Parameters:
S – [in] points to an instance of the Q15 FIR decimator structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data
blockSize – [in] number of input samples to process per call.
-
csi_status csi_fir_decimate_init_q15(csi_fir_decimate_instance_q15 *S, uint16_t numTaps, uint8_t M, const q15_t *pCoeffs, q15_t *pState, uint32_t blockSize)
Initialization function for the Q15 FIR decimator.
- Parameters:
S – [inout] points to an instance of the Q15 FIR decimator structure.
numTaps – [in] number of coefficients in the filter.
M – [in] decimation factor.
pCoeffs – [in] points to the filter coefficients.
pState – [in] points to the state buffer.
blockSize – [in] number of input samples to process per call.
- Returns:
The function returns CSI_MATH_SUCCESS if initialization is successful or CSI_MATH_LENGTH_ERROR if
blockSize
is not a multiple ofM
.
-
void csi_fir_decimate_q31(const csi_fir_decimate_instance_q31 *S, const q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Processing function for the Q31 FIR decimator.
- Parameters:
S – [in] points to an instance of the Q31 FIR decimator structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data
blockSize – [in] number of input samples to process per call.
-
void csi_fir_decimate_fast_q31(const csi_fir_decimate_instance_q31 *S, const q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4.
- Parameters:
S – [in] points to an instance of the Q31 FIR decimator structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data
blockSize – [in] number of input samples to process per call.
-
csi_status csi_fir_decimate_init_q31(csi_fir_decimate_instance_q31 *S, uint16_t numTaps, uint8_t M, const q31_t *pCoeffs, q31_t *pState, uint32_t blockSize)
Initialization function for the Q31 FIR decimator.
- Parameters:
S – [inout] points to an instance of the Q31 FIR decimator structure.
numTaps – [in] number of coefficients in the filter.
M – [in] decimation factor.
pCoeffs – [in] points to the filter coefficients.
pState – [in] points to the state buffer.
blockSize – [in] number of input samples to process per call.
- Returns:
The function returns CSI_MATH_SUCCESS if initialization is successful or CSI_MATH_LENGTH_ERROR if
blockSize
is not a multiple ofM
.
-
void csi_fir_interpolate_q15(const csi_fir_interpolate_instance_q15 *S, const q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Processing function for the Q15 FIR interpolator.
- Parameters:
S – [in] points to an instance of the Q15 FIR interpolator structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of input samples to process per call.
-
csi_status csi_fir_interpolate_init_q15(csi_fir_interpolate_instance_q15 *S, uint8_t L, uint16_t numTaps, const q15_t *pCoeffs, q15_t *pState, uint32_t blockSize)
Initialization function for the Q15 FIR interpolator.
- Parameters:
S – [inout] points to an instance of the Q15 FIR interpolator structure.
L – [in] upsample factor.
numTaps – [in] number of filter coefficients in the filter.
pCoeffs – [in] points to the filter coefficient buffer.
pState – [in] points to the state buffer.
blockSize – [in] number of input samples to process per call.
- Returns:
The function returns CSI_MATH_SUCCESS if initialization is successful or CSI_MATH_LENGTH_ERROR if the filter length
numTaps
is not a multiple of the interpolation factorL
.
-
void csi_fir_interpolate_q31(const csi_fir_interpolate_instance_q31 *S, const q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Processing function for the Q31 FIR interpolator.
- Parameters:
S – [in] points to an instance of the Q15 FIR interpolator structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of input samples to process per call.
-
csi_status csi_fir_interpolate_init_q31(csi_fir_interpolate_instance_q31 *S, uint8_t L, uint16_t numTaps, const q31_t *pCoeffs, q31_t *pState, uint32_t blockSize)
Initialization function for the Q31 FIR interpolator.
- Parameters:
S – [inout] points to an instance of the Q31 FIR interpolator structure.
L – [in] upsample factor.
numTaps – [in] number of filter coefficients in the filter.
pCoeffs – [in] points to the filter coefficient buffer.
pState – [in] points to the state buffer.
blockSize – [in] number of input samples to process per call.
- Returns:
The function returns CSI_MATH_SUCCESS if initialization is successful or CSI_MATH_LENGTH_ERROR if the filter length
numTaps
is not a multiple of the interpolation factorL
.
-
void csi_fir_interpolate_f32(const csi_fir_interpolate_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for the floating-point FIR interpolator.
- Parameters:
S – [in] points to an instance of the floating-point FIR interpolator structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of input samples to process per call.
-
csi_status csi_fir_interpolate_init_f32(csi_fir_interpolate_instance_f32 *S, uint8_t L, uint16_t numTaps, const float32_t *pCoeffs, float32_t *pState, uint32_t blockSize)
Initialization function for the floating-point FIR interpolator.
- Parameters:
S – [inout] points to an instance of the floating-point FIR interpolator structure.
L – [in] upsample factor.
numTaps – [in] number of filter coefficients in the filter.
pCoeffs – [in] points to the filter coefficient buffer.
pState – [in] points to the state buffer.
blockSize – [in] number of input samples to process per call.
- Returns:
The function returns CSI_MATH_SUCCESS if initialization is successful or CSI_MATH_LENGTH_ERROR if the filter length
numTaps
is not a multiple of the interpolation factorL
.
-
void csi_biquad_cas_df1_32x64_q31(const csi_biquad_cas_df1_32x64_ins_q31 *S, const q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
- Parameters:
S – [in] points to an instance of the high precision Q31 Biquad cascade filter structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data
blockSize – [in] number of samples to process.
-
void csi_biquad_cas_df1_32x64_init_q31(csi_biquad_cas_df1_32x64_ins_q31 *S, uint8_t numStages, const q31_t *pCoeffs, q63_t *pState, uint8_t postShift)
- Parameters:
S – [inout] points to an instance of the high precision Q31 Biquad cascade filter structure.
numStages – [in] number of 2nd order stages in the filter.
pCoeffs – [in] points to the filter coefficients.
pState – [in] points to the state buffer.
postShift – [in] shift to be applied to the output. Varies according to the coefficients format
-
void csi_biquad_cascade_df2T_f32(const csi_biquad_cascade_df2T_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for the floating-point transposed direct form II Biquad cascade filter.
- Parameters:
S – [in] points to an instance of the filter data structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data
blockSize – [in] number of samples to process.
-
void csi_biquad_cascade_stereo_df2T_f32(const csi_biquad_cascade_stereo_df2T_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels.
- Parameters:
S – [in] points to an instance of the filter data structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data
blockSize – [in] number of samples to process.
-
void csi_biquad_cascade_df2T_f64(const csi_biquad_cascade_df2T_instance_f64 *S, float64_t *pSrc, float64_t *pDst, uint32_t blockSize)
Processing function for the floating-point transposed direct form II Biquad cascade filter.
- Parameters:
S – [in] points to an instance of the filter data structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data
blockSize – [in] number of samples to process.
-
void csi_biquad_cascade_df2T_init_f32(csi_biquad_cascade_df2T_instance_f32 *S, uint8_t numStages, const float32_t *pCoeffs, float32_t *pState)
Initialization function for the floating-point transposed direct form II Biquad cascade filter.
- Parameters:
S – [inout] points to an instance of the filter data structure.
numStages – [in] number of 2nd order stages in the filter.
pCoeffs – [in] points to the filter coefficients.
pState – [in] points to the state buffer.
-
void csi_biquad_cascade_stereo_df2T_init_f32(csi_biquad_cascade_stereo_df2T_instance_f32 *S, uint8_t numStages, const float32_t *pCoeffs, float32_t *pState)
Initialization function for the floating-point transposed direct form II Biquad cascade filter.
- Parameters:
S – [inout] points to an instance of the filter data structure.
numStages – [in] number of 2nd order stages in the filter.
pCoeffs – [in] points to the filter coefficients.
pState – [in] points to the state buffer.
-
void csi_biquad_cascade_df2T_init_f64(csi_biquad_cascade_df2T_instance_f64 *S, uint8_t numStages, float64_t *pCoeffs, float64_t *pState)
Initialization function for the floating-point transposed direct form II Biquad cascade filter.
- Parameters:
S – [inout] points to an instance of the filter data structure.
numStages – [in] number of 2nd order stages in the filter.
pCoeffs – [in] points to the filter coefficients.
pState – [in] points to the state buffer.
-
void csi_fir_lattice_init_q15(csi_fir_lattice_instance_q15 *S, uint16_t numStages, const q15_t *pCoeffs, q15_t *pState)
Initialization function for the Q15 FIR lattice filter.
- Parameters:
S – [in] points to an instance of the Q15 FIR lattice structure.
numStages – [in] number of filter stages.
pCoeffs – [in] points to the coefficient buffer. The array is of length numStages.
pState – [in] points to the state buffer. The array is of length numStages.
-
void csi_fir_lattice_q15(const csi_fir_lattice_instance_q15 *S, const q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Processing function for the Q15 FIR lattice filter.
- Parameters:
S – [in] points to an instance of the Q15 FIR lattice structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of samples to process.
-
void csi_fir_lattice_init_q31(csi_fir_lattice_instance_q31 *S, uint16_t numStages, const q31_t *pCoeffs, q31_t *pState)
Initialization function for the Q31 FIR lattice filter.
- Parameters:
S – [in] points to an instance of the Q31 FIR lattice structure.
numStages – [in] number of filter stages.
pCoeffs – [in] points to the coefficient buffer. The array is of length numStages.
pState – [in] points to the state buffer. The array is of length numStages.
-
void csi_fir_lattice_q31(const csi_fir_lattice_instance_q31 *S, const q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Processing function for the Q31 FIR lattice filter.
- Parameters:
S – [in] points to an instance of the Q31 FIR lattice structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data
blockSize – [in] number of samples to process.
-
void csi_fir_lattice_init_f32(csi_fir_lattice_instance_f32 *S, uint16_t numStages, const float32_t *pCoeffs, float32_t *pState)
Initialization function for the floating-point FIR lattice filter.
- Parameters:
S – [in] points to an instance of the floating-point FIR lattice structure.
numStages – [in] number of filter stages.
pCoeffs – [in] points to the coefficient buffer. The array is of length numStages.
pState – [in] points to the state buffer. The array is of length numStages.
-
void csi_fir_lattice_f32(const csi_fir_lattice_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for the floating-point FIR lattice filter.
- Parameters:
S – [in] points to an instance of the floating-point FIR lattice structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data
blockSize – [in] number of samples to process.
-
void csi_iir_lattice_f32(const csi_iir_lattice_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Processing function for the floating-point IIR lattice filter.
- Parameters:
S – [in] points to an instance of the floating-point IIR lattice structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of samples to process.
-
void csi_iir_lattice_init_f32(csi_iir_lattice_instance_f32 *S, uint16_t numStages, float32_t *pkCoeffs, float32_t *pvCoeffs, float32_t *pState, uint32_t blockSize)
Initialization function for the floating-point IIR lattice filter.
- Parameters:
S – [in] points to an instance of the floating-point IIR lattice structure.
numStages – [in] number of stages in the filter.
pkCoeffs – [in] points to the reflection coefficient buffer. The array is of length numStages.
pvCoeffs – [in] points to the ladder coefficient buffer. The array is of length numStages+1.
pState – [in] points to the state buffer. The array is of length numStages+blockSize-1.
blockSize – [in] number of samples to process.
-
void csi_iir_lattice_q31(const csi_iir_lattice_instance_q31 *S, const q31_t *pSrc, q31_t *pDst, uint32_t blockSize)
Processing function for the Q31 IIR lattice filter.
- Parameters:
S – [in] points to an instance of the Q31 IIR lattice structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of samples to process.
-
void csi_iir_lattice_init_q31(csi_iir_lattice_instance_q31 *S, uint16_t numStages, q31_t *pkCoeffs, q31_t *pvCoeffs, q31_t *pState, uint32_t blockSize)
Initialization function for the Q31 IIR lattice filter.
- Parameters:
S – [in] points to an instance of the Q31 IIR lattice structure.
numStages – [in] number of stages in the filter.
pkCoeffs – [in] points to the reflection coefficient buffer. The array is of length numStages.
pvCoeffs – [in] points to the ladder coefficient buffer. The array is of length numStages+1.
pState – [in] points to the state buffer. The array is of length numStages+blockSize.
blockSize – [in] number of samples to process.
-
void csi_iir_lattice_q15(const csi_iir_lattice_instance_q15 *S, const q15_t *pSrc, q15_t *pDst, uint32_t blockSize)
Processing function for the Q15 IIR lattice filter.
- Parameters:
S – [in] points to an instance of the Q15 IIR lattice structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data.
blockSize – [in] number of samples to process.
-
void csi_iir_lattice_init_q15(csi_iir_lattice_instance_q15 *S, uint16_t numStages, q15_t *pkCoeffs, q15_t *pvCoeffs, q15_t *pState, uint32_t blockSize)
Initialization function for the Q15 IIR lattice filter.
- Parameters:
S – [in] points to an instance of the fixed-point Q15 IIR lattice structure.
numStages – [in] number of stages in the filter.
pkCoeffs – [in] points to reflection coefficient buffer. The array is of length numStages.
pvCoeffs – [in] points to ladder coefficient buffer. The array is of length numStages+1.
pState – [in] points to state buffer. The array is of length numStages+blockSize.
blockSize – [in] number of samples to process per call.
-
void csi_lms_f32(const csi_lms_instance_f32 *S, const float32_t *pSrc, float32_t *pRef, float32_t *pOut, float32_t *pErr, uint32_t blockSize)
Processing function for floating-point LMS filter.
- Parameters:
S – [in] points to an instance of the floating-point LMS filter structure.
pSrc – [in] points to the block of input data.
pRef – [in] points to the block of reference data.
pOut – [out] points to the block of output data.
pErr – [out] points to the block of error data.
blockSize – [in] number of samples to process.
-
void csi_lms_init_f32(csi_lms_instance_f32 *S, uint16_t numTaps, const float32_t *pCoeffs, float32_t *pState, float32_t mu, uint32_t blockSize)
Initialization function for floating-point LMS filter.
- Parameters:
S – [in] points to an instance of the floating-point LMS filter structure.
numTaps – [in] number of filter coefficients.
pCoeffs – [in] points to the coefficient buffer.
pState – [in] points to state buffer.
mu – [in] step size that controls filter coefficient updates.
blockSize – [in] number of samples to process.
-
void csi_lms_init_q15(csi_lms_instance_q15 *S, uint16_t numTaps, q15_t *pCoeffs, q15_t *pState, q15_t mu, uint32_t blockSize, uint32_t postShift)
Initialization function for the Q15 LMS filter.
- Parameters:
S – [in] points to an instance of the Q15 LMS filter structure.
numTaps – [in] number of filter coefficients.
pCoeffs – [in] points to the coefficient buffer.
pState – [in] points to the state buffer.
mu – [in] step size that controls filter coefficient updates.
blockSize – [in] number of samples to process.
postShift – [in] bit shift applied to coefficients.
-
void csi_lms_q15(const csi_lms_instance_q15 *S, const q15_t *pSrc, q15_t *pRef, q15_t *pOut, q15_t *pErr, uint32_t blockSize)
Processing function for Q15 LMS filter.
- Parameters:
S – [in] points to an instance of the Q15 LMS filter structure.
pSrc – [in] points to the block of input data.
pRef – [in] points to the block of reference data.
pOut – [out] points to the block of output data.
pErr – [out] points to the block of error data.
blockSize – [in] number of samples to process.
-
void csi_lms_q31(const csi_lms_instance_q31 *S, const q31_t *pSrc, q31_t *pRef, q31_t *pOut, q31_t *pErr, uint32_t blockSize)
Processing function for Q31 LMS filter.
- Parameters:
S – [in] points to an instance of the Q15 LMS filter structure.
pSrc – [in] points to the block of input data.
pRef – [in] points to the block of reference data.
pOut – [out] points to the block of output data.
pErr – [out] points to the block of error data.
blockSize – [in] number of samples to process.
-
void csi_lms_init_q31(csi_lms_instance_q31 *S, uint16_t numTaps, q31_t *pCoeffs, q31_t *pState, q31_t mu, uint32_t blockSize, uint32_t postShift)
Initialization function for Q31 LMS filter.
- Parameters:
S – [in] points to an instance of the Q31 LMS filter structure.
numTaps – [in] number of filter coefficients.
pCoeffs – [in] points to coefficient buffer.
pState – [in] points to state buffer.
mu – [in] step size that controls filter coefficient updates.
blockSize – [in] number of samples to process.
postShift – [in] bit shift applied to coefficients.
-
void csi_lms_norm_f32(csi_lms_norm_instance_f32 *S, const float32_t *pSrc, float32_t *pRef, float32_t *pOut, float32_t *pErr, uint32_t blockSize)
Processing function for floating-point normalized LMS filter.
- Parameters:
S – [in] points to an instance of the floating-point normalized LMS filter structure.
pSrc – [in] points to the block of input data.
pRef – [in] points to the block of reference data.
pOut – [out] points to the block of output data.
pErr – [out] points to the block of error data.
blockSize – [in] number of samples to process.
-
void csi_lms_norm_init_f32(csi_lms_norm_instance_f32 *S, uint16_t numTaps, const float32_t *pCoeffs, float32_t *pState, float32_t mu, uint32_t blockSize)
Initialization function for floating-point normalized LMS filter.
- Parameters:
S – [in] points to an instance of the floating-point LMS filter structure.
numTaps – [in] number of filter coefficients.
pCoeffs – [in] points to coefficient buffer.
pState – [in] points to state buffer.
mu – [in] step size that controls filter coefficient updates.
blockSize – [in] number of samples to process.
-
void csi_lms_norm_q31(csi_lms_norm_instance_q31 *S, const q31_t *pSrc, q31_t *pRef, q31_t *pOut, q31_t *pErr, uint32_t blockSize)
Processing function for Q31 normalized LMS filter.
- Parameters:
S – [in] points to an instance of the Q31 normalized LMS filter structure.
pSrc – [in] points to the block of input data.
pRef – [in] points to the block of reference data.
pOut – [out] points to the block of output data.
pErr – [out] points to the block of error data.
blockSize – [in] number of samples to process.
-
void csi_lms_norm_init_q31(csi_lms_norm_instance_q31 *S, uint16_t numTaps, q31_t *pCoeffs, q31_t *pState, q31_t mu, uint32_t blockSize, uint8_t postShift)
Initialization function for Q31 normalized LMS filter.
- Parameters:
S – [in] points to an instance of the Q31 normalized LMS filter structure.
numTaps – [in] number of filter coefficients.
pCoeffs – [in] points to coefficient buffer.
pState – [in] points to state buffer.
mu – [in] step size that controls filter coefficient updates.
blockSize – [in] number of samples to process.
postShift – [in] bit shift applied to coefficients.
-
void csi_lms_norm_q15(csi_lms_norm_instance_q15 *S, const q15_t *pSrc, q15_t *pRef, q15_t *pOut, q15_t *pErr, uint32_t blockSize)
Processing function for Q15 normalized LMS filter.
- Parameters:
S – [in] points to an instance of the Q15 normalized LMS filter structure.
pSrc – [in] points to the block of input data.
pRef – [in] points to the block of reference data.
pOut – [out] points to the block of output data.
pErr – [out] points to the block of error data.
blockSize – [in] number of samples to process.
-
void csi_lms_norm_init_q15(csi_lms_norm_instance_q15 *S, uint16_t numTaps, q15_t *pCoeffs, q15_t *pState, q15_t mu, uint32_t blockSize, uint8_t postShift)
Initialization function for Q15 normalized LMS filter.
- Parameters:
S – [in] points to an instance of the Q15 normalized LMS filter structure.
numTaps – [in] number of filter coefficients.
pCoeffs – [in] points to coefficient buffer.
pState – [in] points to state buffer.
mu – [in] step size that controls filter coefficient updates.
blockSize – [in] number of samples to process.
postShift – [in] bit shift applied to coefficients.
-
void csi_correlate_f32(const float32_t *pSrcA, uint32_t srcALen, const float32_t *pSrcB, uint32_t srcBLen, float32_t *pDst)
Correlation of floating-point sequences.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
-
void csi_correlate_opt_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, q15_t *pScratch)
Correlation of Q15 sequences.
- Parameters:
pSrcA – [in] points to the first input sequence
srcALen – [in] length of the first input sequence
pSrcB – [in] points to the second input sequence
srcBLen – [in] length of the second input sequence
pDst – [out] points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
pScratch – [in] points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
-
void csi_correlate_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst)
Correlation of Q15 sequences.
- Parameters:
pSrcA – [in] points to the first input sequence
srcALen – [in] length of the first input sequence
pSrcB – [in] points to the second input sequence
srcBLen – [in] length of the second input sequence
pDst – [out] points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
-
void csi_correlate_fast_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst)
Correlation of Q15 sequences (fast version).
- Parameters:
pSrcA – [in] points to the first input sequence
srcALen – [in] length of the first input sequence
pSrcB – [in] points to the second input sequence
srcBLen – [in] length of the second input sequence
pDst – [out] points to the location where the output result is written. Length 2 * max(srcALen, srcBLen) - 1.
- Returns:
none
-
void csi_correlate_fast_opt_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, q15_t *pScratch)
Correlation of Q15 sequences (fast version).
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
pScratch – [in] points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
-
void csi_correlate_q31(const q31_t *pSrcA, uint32_t srcALen, const q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst)
Correlation of Q31 sequences.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
-
void csi_correlate_fast_q31(const q31_t *pSrcA, uint32_t srcALen, const q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst)
Correlation of Q31 sequences (fast version).
- Parameters:
pSrcA – [in] points to the first input sequence
srcALen – [in] length of the first input sequence
pSrcB – [in] points to the second input sequence
srcBLen – [in] length of the second input sequence
pDst – [out] points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
-
void csi_correlate_opt_q7(const q7_t *pSrcA, uint32_t srcALen, const q7_t *pSrcB, uint32_t srcBLen, q7_t *pDst, q15_t *pScratch1, q15_t *pScratch2)
Correlation of Q7 sequences.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
pScratch1 – [in] points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.
pScratch2 – [in] points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).
-
void csi_correlate_q7(const q7_t *pSrcA, uint32_t srcALen, const q7_t *pSrcB, uint32_t srcBLen, q7_t *pDst)
Correlation of Q7 sequences.
- Parameters:
pSrcA – [in] points to the first input sequence.
srcALen – [in] length of the first input sequence.
pSrcB – [in] points to the second input sequence.
srcBLen – [in] length of the second input sequence.
pDst – [out] points to the block of output data Length 2 * max(srcALen, srcBLen) - 1.
-
void csi_fir_sparse_f32(csi_fir_sparse_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, float32_t *pScratchIn, uint32_t blockSize)
Processing function for the floating-point sparse FIR filter.
- Parameters:
S – [in] points to an instance of the floating-point sparse FIR structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data
pScratchIn – [in] points to a temporary buffer of size blockSize.
blockSize – [in] number of input samples to process per call.
-
void csi_fir_sparse_init_f32(csi_fir_sparse_instance_f32 *S, uint16_t numTaps, const float32_t *pCoeffs, float32_t *pState, int32_t *pTapDelay, uint16_t maxDelay, uint32_t blockSize)
Initialization function for the floating-point sparse FIR filter.
- Parameters:
S – [inout] points to an instance of the floating-point sparse FIR structure.
numTaps – [in] number of nonzero coefficients in the filter.
pCoeffs – [in] points to the array of filter coefficients.
pState – [in] points to the state buffer.
pTapDelay – [in] points to the array of offset times.
maxDelay – [in] maximum offset time supported.
blockSize – [in] number of samples that will be processed per block.
-
void csi_fir_sparse_q31(csi_fir_sparse_instance_q31 *S, const q31_t *pSrc, q31_t *pDst, q31_t *pScratchIn, uint32_t blockSize)
Processing function for the Q31 sparse FIR filter.
- Parameters:
S – [in] points to an instance of the Q31 sparse FIR structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data
pScratchIn – [in] points to a temporary buffer of size blockSize.
blockSize – [in] number of input samples to process per call.
-
void csi_fir_sparse_init_q31(csi_fir_sparse_instance_q31 *S, uint16_t numTaps, const q31_t *pCoeffs, q31_t *pState, int32_t *pTapDelay, uint16_t maxDelay, uint32_t blockSize)
Initialization function for the Q31 sparse FIR filter.
- Parameters:
S – [inout] points to an instance of the Q31 sparse FIR structure.
numTaps – [in] number of nonzero coefficients in the filter.
pCoeffs – [in] points to the array of filter coefficients.
pState – [in] points to the state buffer.
pTapDelay – [in] points to the array of offset times.
maxDelay – [in] maximum offset time supported.
blockSize – [in] number of samples that will be processed per block.
-
void csi_fir_sparse_q15(csi_fir_sparse_instance_q15 *S, const q15_t *pSrc, q15_t *pDst, q15_t *pScratchIn, q31_t *pScratchOut, uint32_t blockSize)
Processing function for the Q15 sparse FIR filter.
- Parameters:
S – [in] points to an instance of the Q15 sparse FIR structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data
pScratchIn – [in] points to a temporary buffer of size blockSize.
pScratchOut – [in] points to a temporary buffer of size blockSize.
blockSize – [in] number of input samples to process per call.
-
void csi_fir_sparse_init_q15(csi_fir_sparse_instance_q15 *S, uint16_t numTaps, const q15_t *pCoeffs, q15_t *pState, int32_t *pTapDelay, uint16_t maxDelay, uint32_t blockSize)
Initialization function for the Q15 sparse FIR filter.
- Parameters:
S – [inout] points to an instance of the Q15 sparse FIR structure.
numTaps – [in] number of nonzero coefficients in the filter.
pCoeffs – [in] points to the array of filter coefficients.
pState – [in] points to the state buffer.
pTapDelay – [in] points to the array of offset times.
maxDelay – [in] maximum offset time supported.
blockSize – [in] number of samples that will be processed per block.
-
void csi_fir_sparse_q7(csi_fir_sparse_instance_q7 *S, const q7_t *pSrc, q7_t *pDst, q7_t *pScratchIn, q31_t *pScratchOut, uint32_t blockSize)
Processing function for the Q7 sparse FIR filter.
- Parameters:
S – [in] points to an instance of the Q7 sparse FIR structure.
pSrc – [in] points to the block of input data.
pDst – [out] points to the block of output data
pScratchIn – [in] points to a temporary buffer of size blockSize.
pScratchOut – [in] points to a temporary buffer of size blockSize.
blockSize – [in] number of input samples to process per call.
-
void csi_fir_sparse_init_q7(csi_fir_sparse_instance_q7 *S, uint16_t numTaps, const q7_t *pCoeffs, q7_t *pState, int32_t *pTapDelay, uint16_t maxDelay, uint32_t blockSize)
Initialization function for the Q7 sparse FIR filter.
- Parameters:
S – [inout] points to an instance of the Q7 sparse FIR structure.
numTaps – [in] number of nonzero coefficients in the filter.
pCoeffs – [in] points to the array of filter coefficients.
pState – [in] points to the state buffer.
pTapDelay – [in] points to the array of offset times.
maxDelay – [in] maximum offset time supported.
blockSize – [in] number of samples that will be processed per block.
-
void csi_sin_cos_f32(float32_t theta, float32_t *pSinVal, float32_t *pCosVal)
Floating-point sin_cos function.
- Parameters:
theta – [in] input value in degrees
pSinVal – [out] points to the processed sine output.
pCosVal – [out] points to the processed cos output.
-
void csi_sin_cos_q31(q31_t theta, q31_t *pSinVal, q31_t *pCosVal)
Q31 sin_cos function.
- Parameters:
theta – [in] scaled input value in degrees
pSinVal – [out] points to the processed sine output.
pCosVal – [out] points to the processed cosine output.
-
void csi_cmplx_conj_f32(const float32_t *pSrc, float32_t *pDst, uint32_t numSamples)
Floating-point complex conjugate.
- Parameters:
pSrc – [in] points to the input vector
pDst – [out] points to the output vector
numSamples – [in] number of complex samples in each vector
-
void csi_cmplx_conj_q31(const q31_t *pSrc, q31_t *pDst, uint32_t numSamples)
Q31 complex conjugate.
- Parameters:
pSrc – [in] points to the input vector
pDst – [out] points to the output vector
numSamples – [in] number of complex samples in each vector
-
void csi_cmplx_conj_q15(const q15_t *pSrc, q15_t *pDst, uint32_t numSamples)
Q15 complex conjugate.
- Parameters:
pSrc – [in] points to the input vector
pDst – [out] points to the output vector
numSamples – [in] number of complex samples in each vector
-
void csi_cmplx_mag_squared_f32(const float32_t *pSrc, float32_t *pDst, uint32_t numSamples)
Floating-point complex magnitude squared.
- Parameters:
pSrc – [in] points to the complex input vector
pDst – [out] points to the real output vector
numSamples – [in] number of complex samples in the input vector
-
void csi_cmplx_mag_squared_q31(const q31_t *pSrc, q31_t *pDst, uint32_t numSamples)
Q31 complex magnitude squared.
- Parameters:
pSrc – [in] points to the complex input vector
pDst – [out] points to the real output vector
numSamples – [in] number of complex samples in the input vector
-
void csi_cmplx_mag_squared_q31_basic(q31_t *pSrc, q63_t *pDst, uint32_t numSamples)
-
void csi_cmplx_mag_squared_q15(const q15_t *pSrc, q15_t *pDst, uint32_t numSamples)
Q15 complex magnitude squared.
- Parameters:
pSrc – [in] points to the complex input vector
pDst – [out] points to the real output vector
numSamples – [in] number of complex samples in the input vector
- __STATIC_FORCEINLINE float32_t csi_pid_f32 (csi_pid_instance_f32 *S, float32_t in)
Process function for the floating-point PID Control.
- Parameters:
S – [inout] is an instance of the floating-point PID Control structure
in – [in] input sample to process
- Returns:
processed output sample.
- __STATIC_FORCEINLINE q31_t csi_pid_q31 (csi_pid_instance_q31 *S, q31_t in)
Process function for the Q31 PID Control.
- Scaling and Overflow Behavior
The function is implemented using an internal 64-bit accumulator. The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit. Thus, if the accumulator result overflows it wraps around rather than clip. In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions. After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format.
- Parameters:
S – [inout] points to an instance of the Q31 PID Control structure
in – [in] input sample to process
- Returns:
processed output sample.
- __STATIC_FORCEINLINE q15_t csi_pid_q15 (csi_pid_instance_q15 *S, q15_t in)
Process function for the Q15 PID Control.
- Scaling and Overflow Behavior
The function is implemented using a 64-bit internal accumulator. Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result. The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format. There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved. After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits. Lastly, the accumulator is saturated to yield a result in 1.15 format.
- Parameters:
S – [inout] points to an instance of the Q15 PID Control structure
in – [in] input sample to process
- Returns:
processed output sample.
-
csi_status csi_mat_inverse_f32(const csi_matrix_instance_f32 *src, csi_matrix_instance_f32 *dst)
Floating-point matrix inverse.
end of PID group
- Parameters:
src – [in] points to the instance of the input floating-point matrix structure.
dst – [out] points to the instance of the output floating-point matrix structure.
- Returns:
The function returns CSI_MATH_SIZE_MISMATCH, if the dimensions do not match. If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status CSI_MATH_SINGULAR.
-
csi_status csi_mat_inverse_f64(const csi_matrix_instance_f64 *src, csi_matrix_instance_f64 *dst)
Floating-point matrix inverse.
- Parameters:
src – [in] points to the instance of the input floating-point matrix structure.
dst – [out] points to the instance of the output floating-point matrix structure.
- Returns:
The function returns CSI_MATH_SIZE_MISMATCH, if the dimensions do not match. If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status CSI_MATH_SINGULAR.
- __STATIC_FORCEINLINE void csi_clarke_f32 (float32_t Ia, float32_t Ib, float32_t *pIalpha, float32_t *pIbeta)
Floating-point Clarke transform.
- Parameters:
Ia – [in] input three-phase coordinate
a
Ib – [in] input three-phase coordinate
b
pIalpha – [out] points to output two-phase orthogonal vector axis alpha
pIbeta – [out] points to output two-phase orthogonal vector axis beta
- Returns:
none
- __STATIC_FORCEINLINE void csi_clarke_q31 (q31_t Ia, q31_t Ib, q31_t *pIalpha, q31_t *pIbeta)
Clarke transform for Q31 version.
- Scaling and Overflow Behavior
The function is implemented using an internal 32-bit accumulator. The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. There is saturation on the addition, hence there is no risk of overflow.
- Parameters:
Ia – [in] input three-phase coordinate
a
Ib – [in] input three-phase coordinate
b
pIalpha – [out] points to output two-phase orthogonal vector axis alpha
pIbeta – [out] points to output two-phase orthogonal vector axis beta
- Returns:
none
- __STATIC_FORCEINLINE void csi_inv_clarke_f32 (float32_t Ialpha, float32_t Ibeta, float32_t *pIa, float32_t *pIb)
Floating-point Inverse Clarke transform.
- Parameters:
Ialpha – [in] input two-phase orthogonal vector axis alpha
Ibeta – [in] input two-phase orthogonal vector axis beta
pIa – [out] points to output three-phase coordinate
a
pIb – [out] points to output three-phase coordinate
b
- Returns:
none
- __STATIC_FORCEINLINE void csi_inv_clarke_q31 (q31_t Ialpha, q31_t Ibeta, q31_t *pIa, q31_t *pIb)
Inverse Clarke transform for Q31 version.
- Scaling and Overflow Behavior
The function is implemented using an internal 32-bit accumulator. The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. There is saturation on the subtraction, hence there is no risk of overflow.
- Parameters:
Ialpha – [in] input two-phase orthogonal vector axis alpha
Ibeta – [in] input two-phase orthogonal vector axis beta
pIa – [out] points to output three-phase coordinate
a
pIb – [out] points to output three-phase coordinate
b
- Returns:
none
- __STATIC_FORCEINLINE void csi_park_f32 (float32_t Ialpha, float32_t Ibeta, float32_t *pId, float32_t *pIq, float32_t sinVal, float32_t cosVal)
Floating-point Park transform.
The function implements the forward Park transform.
- Parameters:
Ialpha – [in] input two-phase vector coordinate alpha
Ibeta – [in] input two-phase vector coordinate beta
pId – [out] points to output rotor reference frame d
pIq – [out] points to output rotor reference frame q
sinVal – [in] sine value of rotation angle theta
cosVal – [in] cosine value of rotation angle theta
- Returns:
none
- __STATIC_FORCEINLINE void csi_park_q31 (q31_t Ialpha, q31_t Ibeta, q31_t *pId, q31_t *pIq, q31_t sinVal, q31_t cosVal)
Park transform for Q31 version.
- Scaling and Overflow Behavior
The function is implemented using an internal 32-bit accumulator. The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. There is saturation on the addition and subtraction, hence there is no risk of overflow.
- Parameters:
Ialpha – [in] input two-phase vector coordinate alpha
Ibeta – [in] input two-phase vector coordinate beta
pId – [out] points to output rotor reference frame d
pIq – [out] points to output rotor reference frame q
sinVal – [in] sine value of rotation angle theta
cosVal – [in] cosine value of rotation angle theta
- Returns:
none
- __STATIC_FORCEINLINE void csi_inv_park_f32 (float32_t Id, float32_t Iq, float32_t *pIalpha, float32_t *pIbeta, float32_t sinVal, float32_t cosVal)
Floating-point Inverse Park transform.
- Parameters:
Id – [in] input coordinate of rotor reference frame d
Iq – [in] input coordinate of rotor reference frame q
pIalpha – [out] points to output two-phase orthogonal vector axis alpha
pIbeta – [out] points to output two-phase orthogonal vector axis beta
sinVal – [in] sine value of rotation angle theta
cosVal – [in] cosine value of rotation angle theta
- Returns:
none
- __STATIC_FORCEINLINE void csi_inv_park_q31 (q31_t Id, q31_t Iq, q31_t *pIalpha, q31_t *pIbeta, q31_t sinVal, q31_t cosVal)
Inverse Park transform for Q31 version.
- Scaling and Overflow Behavior
The function is implemented using an internal 32-bit accumulator. The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. There is saturation on the addition, hence there is no risk of overflow.
- Parameters:
Id – [in] input coordinate of rotor reference frame d
Iq – [in] input coordinate of rotor reference frame q
pIalpha – [out] points to output two-phase orthogonal vector axis alpha
pIbeta – [out] points to output two-phase orthogonal vector axis beta
sinVal – [in] sine value of rotation angle theta
cosVal – [in] cosine value of rotation angle theta
- Returns:
none
- __STATIC_FORCEINLINE float32_t csi_linear_interp_f32 (csi_linear_interp_instance_f32 *S, float32_t x)
Process function for the floating-point Linear Interpolation Function.
- Parameters:
S – [inout] is an instance of the floating-point Linear Interpolation structure
x – [in] input sample to process
- Returns:
y processed output sample.
- __STATIC_FORCEINLINE q31_t csi_linear_interp_q31 (q31_t *pYData, q31_t x, uint32_t nValues)
Process function for the Q31 Linear Interpolation Function.
Input sample
x
is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. This function can support maximum of table size 2^12.
- Parameters:
pYData – [in] pointer to Q31 Linear Interpolation table
x – [in] input sample to process
nValues – [in] number of table values
- Returns:
y processed output sample.
- __STATIC_FORCEINLINE q15_t csi_linear_interp_q15 (q15_t *pYData, q31_t x, uint32_t nValues)
Process function for the Q15 Linear Interpolation Function.
Input sample
x
is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. This function can support maximum of table size 2^12.
- Parameters:
pYData – [in] pointer to Q15 Linear Interpolation table
x – [in] input sample to process
nValues – [in] number of table values
- Returns:
y processed output sample.
- __STATIC_FORCEINLINE q7_t csi_linear_interp_q7 (q7_t *pYData, q31_t x, uint32_t nValues)
Process function for the Q7 Linear Interpolation Function.
Input sample
x
is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. This function can support maximum of table size 2^12.
- Parameters:
pYData – [in] pointer to Q7 Linear Interpolation table
x – [in] input sample to process
nValues – [in] number of table values
- Returns:
y processed output sample.
-
float32_t csi_sin_f32(float32_t x)
Fast approximation to the trigonometric sine function for floating-point data.
end of LinearInterpolate group
- Parameters:
x – [in] input value in radians.
- Returns:
sin(x).
-
q31_t csi_sin_q31(q31_t x)
Fast approximation to the trigonometric sine function for Q31 data.
- Parameters:
x – [in] Scaled input value in radians.
- Returns:
sin(x).
-
q15_t csi_sin_q15(q15_t x)
Fast approximation to the trigonometric sine function for Q15 data.
- Parameters:
x – [in] Scaled input value in radians.
- Returns:
sin(x).
-
float32_t csi_cos_f32(float32_t x)
Fast approximation to the trigonometric cosine function for floating-point data.
- Parameters:
x – [in] input value in radians.
- Returns:
cos(x).
-
q31_t csi_cos_q31(q31_t x)
Fast approximation to the trigonometric cosine function for Q31 data.
- Parameters:
x – [in] Scaled input value in radians.
- Returns:
cos(x).
-
q15_t csi_cos_q15(q15_t x)
Fast approximation to the trigonometric cosine function for Q15 data.
- Parameters:
x – [in] Scaled input value in radians.
- Returns:
cos(x).
-
void csi_vlog_f32(const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Floating-point vector of log values.
- Parameters:
pSrc – [in] points to the input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in each vector
- Returns:
none
-
void csi_vexp_f32(const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
Floating-point vector of exp values.
- Parameters:
pSrc – [in] points to the input vector
pDst – [out] points to the output vector
blockSize – [in] number of samples in each vector
- Returns:
none
-
csi_status csi_sqrt_q15(q15_t in, q15_t *pOut)
Q15 square root function.
- Parameters:
in – [in] input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF
pOut – [out] points to square root of input value
- Returns:
execution status
CSI_MATH_SUCCESS : input value is positive
CSI_MATH_ARGUMENT_ERROR : input value is negative; *pOut is set to 0
-
csi_status csi_sqrt_f32(float32_t in, float32_t *pOut)
Floating-point square root function.
- Parameters:
in – [in] input value
pOut – [out] square root of input value
- Returns:
execution status
CSI_MATH_SUCCESS : input value is positive
CSI_MATH_ARGUMENT_ERROR : input value is negative; *pOut is set to 0
-
csi_status csi_sqrt_q31(q31_t in, q31_t *pOut)
Q31 square root function.
- Parameters:
in – [in] input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF
pOut – [out] points to square root of input value
- Returns:
execution status
CSI_MATH_SUCCESS : input value is positive
CSI_MATH_ARGUMENT_ERROR : input value is negative; *pOut is set to 0
- __STATIC_FORCEINLINE void csi_vsqrt_f32 (float32_t *pIn, float32_t *pOut, uint16_t len)
Vector Floating-point square root function.
- Parameters:
pIn – [in] input vector.
pOut – [out] vector of square roots of input elements.
len – [in] length of input vector.
- Returns:
The function returns CSI_MATH_SUCCESS if input value is positive value or CSI_MATH_ARGUMENT_ERROR if
in
is negative value and returns zero output for negative values.
- __STATIC_FORCEINLINE void csi_vsqrt_q15 (q15_t *pIn, q15_t *pOut, uint16_t len)
- __STATIC_FORCEINLINE void csi_vsqrt_q31 (q31_t *pIn, q31_t *pOut, uint16_t len)
- __STATIC_FORCEINLINE void csi_circularWrite_f32 (int32_t *circBuffer, int32_t L, uint16_t *writeOffset, int32_t bufferInc, const int32_t *src, int32_t srcInc, uint32_t blockSize)
floating-point Circular write function. a
end of SQRT group
- __STATIC_FORCEINLINE void csi_circularRead_f32 (int32_t *circBuffer, int32_t L, int32_t *readOffset, int32_t bufferInc, int32_t *dst, int32_t *dst_base, int32_t dst_length, int32_t dstInc, uint32_t blockSize)
floating-point Circular Read function.
-
void csi_power_q31(const q31_t *pSrc, uint32_t blockSize, q63_t *pResult)
Sum of the squares of the elements of a Q31 vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_power_int32(int32_t *pSrc, uint32_t blockSize, q63_t *pResult)
-
void csi_power_f32(const float32_t *pSrc, uint32_t blockSize, float32_t *pResult)
Sum of the squares of the elements of a floating-point vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_power_q15(const q15_t *pSrc, uint32_t blockSize, q63_t *pResult)
Sum of the squares of the elements of a Q15 vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_power_q7(const q7_t *pSrc, uint32_t blockSize, q31_t *pResult)
Sum of the squares of the elements of a Q7 vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_mean_q7(const q7_t *pSrc, uint32_t blockSize, q7_t *pResult)
Mean value of a Q7 vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_mean_q15(const q15_t *pSrc, uint32_t blockSize, q15_t *pResult)
Mean value of a Q15 vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_mean_q31(const q31_t *pSrc, uint32_t blockSize, q31_t *pResult)
Mean value of a Q31 vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_mean_f32(const float32_t *pSrc, uint32_t blockSize, float32_t *pResult)
Mean value of a floating-point vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_var_f32(const float32_t *pSrc, uint32_t blockSize, float32_t *pResult)
Variance of the elements of a floating-point vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_var_q31(const q31_t *pSrc, uint32_t blockSize, q31_t *pResult)
Variance of the elements of a Q31 vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_var_q15(const q15_t *pSrc, uint32_t blockSize, q15_t *pResult)
Variance of the elements of a Q15 vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_rms_f32(const float32_t *pSrc, uint32_t blockSize, float32_t *pResult)
Root Mean Square of the elements of a floating-point vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_rms_q31(const q31_t *pSrc, uint32_t blockSize, q31_t *pResult)
Root Mean Square of the elements of a Q31 vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_rms_q15(const q15_t *pSrc, uint32_t blockSize, q15_t *pResult)
Root Mean Square of the elements of a Q15 vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_std_f32(const float32_t *pSrc, uint32_t blockSize, float32_t *pResult)
Standard deviation of the elements of a floating-point vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_std_q31(const q31_t *pSrc, uint32_t blockSize, q31_t *pResult)
Standard deviation of the elements of a Q31 vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_std_q15(const q15_t *pSrc, uint32_t blockSize, q15_t *pResult)
Standard deviation of the elements of a Q15 vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output value.
-
void csi_cmplx_mag_f32(const float32_t *pSrc, float32_t *pDst, uint32_t numSamples)
Floating-point complex magnitude.
- Parameters:
pSrc – [in] points to the complex input vector
pDst – [out] points to the real output vector
numSamples – [in] number of complex samples in the input vector
-
void csi_cmplx_mag_q31(const q31_t *pSrc, q31_t *pDst, uint32_t numSamples)
Q31 complex magnitude.
- Parameters:
pSrc – [in] points to the complex input vector
pDst – [out] points to the real output vector
numSamples – [in] number of complex samples in the input vector
-
void csi_cmplx_mag_q15(const q15_t *pSrc, q15_t *pDst, uint32_t numSamples)
Q15 complex magnitude.
- Parameters:
pSrc – [in] points to the complex input vector
pDst – [out] points to the real output vector
numSamples – [in] number of complex samples in the input vector
-
void csi_cmplx_dot_prod_q15(const q15_t *pSrcA, const q15_t *pSrcB, uint32_t numSamples, q31_t *realResult, q31_t *imagResult)
Q15 complex dot product.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
numSamples – [in] number of complex samples in each vector
realResult – [out] real part of the result returned here
imagResult – [out] imaginary part of the result returned here
-
void csi_cmplx_dot_prod_q31(const q31_t *pSrcA, const q31_t *pSrcB, uint32_t numSamples, q63_t *realResult, q63_t *imagResult)
Q31 complex dot product.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
numSamples – [in] number of complex samples in each vector
realResult – [out] real part of the result returned here
imagResult – [out] imaginary part of the result returned here
-
void csi_dot_prod_u64xu8(uint8_t *pSrcA, uint64_t *pSrcB, uint32_t blockSize, uint64_t *result)
-
void csi_cmplx_dot_prod_f32(const float32_t *pSrcA, const float32_t *pSrcB, uint32_t numSamples, float32_t *realResult, float32_t *imagResult)
Floating-point complex dot product.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
numSamples – [in] number of complex samples in each vector
realResult – [out] real part of the result returned here
imagResult – [out] imaginary part of the result returned here
-
void csi_cmplx_mult_real_q15(const q15_t *pSrcCmplx, const q15_t *pSrcReal, q15_t *pCmplxDst, uint32_t numSamples)
Q15 complex-by-real multiplication.
- Parameters:
pSrcCmplx – [in] points to the complex input vector
pSrcReal – [in] points to the real input vector
pCmplxDst – [out] points to the complex output vector
numSamples – [in] number of samples in each vector
-
void csi_cmplx_mult_real_q31(const q31_t *pSrcCmplx, const q31_t *pSrcReal, q31_t *pCmplxDst, uint32_t numSamples)
Q31 complex-by-real multiplication.
- Parameters:
pSrcCmplx – [in] points to the complex input vector
pSrcReal – [in] points to the real input vector
pCmplxDst – [out] points to the complex output vector
numSamples – [in] number of samples in each vector
-
void csi_cmplx_mult_real_f32(const float32_t *pSrcCmplx, const float32_t *pSrcReal, float32_t *pCmplxDst, uint32_t numSamples)
Floating-point complex-by-real multiplication.
- Parameters:
pSrcCmplx – [in] points to the complex input vector
pSrcReal – [in] points to the real input vector
pCmplxDst – [out] points to the complex output vector
numSamples – [in] number of samples in each vector
-
void csi_min_q7(const q7_t *pSrc, uint16_t blockSize, q7_t *result, uint16_t *index)
Minimum value of a Q7 vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
result – [out] is output pointer
index – [in] is the array index of the minimum value in the input buffer.
-
void csi_min_q15(const q15_t *pSrc, uint16_t blockSize, q15_t *pResult, uint16_t *pIndex)
Minimum value of a Q15 vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output pointer
pIndex – [in] is the array index of the minimum value in the input buffer.
-
void csi_min_q31(const q31_t *pSrc, uint32_t blockSize, q31_t *pResult, uint32_t *pIndex)
Minimum value of a Q31 vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output pointer
pIndex – [out] is the array index of the minimum value in the input buffer.
-
void csi_min_f32(const float32_t *pSrc, uint32_t blockSize, float32_t *pResult, uint32_t *pIndex)
Minimum value of a floating-point vector.
- Parameters:
pSrc – [in] is input pointer
blockSize – [in] is the number of samples to process
pResult – [out] is output pointer
pIndex – [out] is the array index of the minimum value in the input buffer.
-
void csi_max_q7(const q7_t *pSrc, uint16_t blockSize, q7_t *pResult, uint16_t *pIndex)
Maximum value of a Q7 vector.
- Parameters:
pSrc – [in] points to the input buffer
blockSize – [in] length of the input vector
pResult – [out] maximum value returned here
pIndex – [out] index of maximum value returned here
-
void csi_max_q15(const q15_t *pSrc, uint16_t blockSize, q15_t *pResult, uint16_t *pIndex)
Maximum value of a Q15 vector.
- Parameters:
pSrc – [in] points to the input buffer
blockSize – [in] length of the input vector
pResult – [out] maximum value returned here
pIndex – [out] index of maximum value returned here
-
void csi_max_q31(const q31_t *pSrc, uint32_t blockSize, q31_t *pResult, uint32_t *pIndex)
Maximum value of a Q31 vector.
- Parameters:
pSrc – [in] points to the input buffer
blockSize – [in] length of the input vector
pResult – [out] maximum value returned here
pIndex – [out] index of maximum value returned here
-
void csi_max_f32(const float32_t *pSrc, uint32_t blockSize, float32_t *pResult, uint32_t *pIndex)
Maximum value of a floating-point vector.
- Parameters:
pSrc – [in] points to the input buffer
blockSize – [in] length of the input vector
pResult – [out] maximum value returned here
pIndex – [out] index of maximum value returned here
-
void csi_max_no_idx_f32(const float32_t *pSrc, uint32_t blockSize, float32_t *pResult)
Maximum value of a floating-point vector.
- Parameters:
pSrc – [in] points to the input vector
blockSize – [in] number of samples in input vector
pResult – [out] maximum value returned here
- Returns:
none
-
void csi_cmplx_mult_cmplx_q15(const q15_t *pSrcA, const q15_t *pSrcB, q15_t *pDst, uint32_t numSamples)
Q15 complex-by-complex multiplication.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
pDst – [out] points to the output vector
numSamples – [in] number of complex samples in each vector
-
void csi_cmplx_mult_cmplx_q31(const q31_t *pSrcA, const q31_t *pSrcB, q31_t *pDst, uint32_t numSamples)
Q31 complex-by-complex multiplication.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
pDst – [out] points to the output vector
numSamples – [in] number of complex samples in each vector
-
void csi_cmplx_mult_cmplx_f32(const float32_t *pSrcA, const float32_t *pSrcB, float32_t *pDst, uint32_t numSamples)
Floating-point complex-by-complex multiplication.
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
pDst – [out] points to the output vector
numSamples – [in] number of complex samples in each vector
-
void csi_cmplx_mult_cmplx_re_f32(const float32_t *pSrcA, const float32_t *pSrcB, float32_t *pDst, uint32_t numSamples)
-
void csi_float_to_q31(const float32_t *pSrc, q31_t *pDst, uint32_t blockSize)
Converts the elements of the floating-point vector to Q31 vector.
- Parameters:
pSrc – [in] points to the floating-point input vector
pDst – [out] points to the Q31 output vector
blockSize – [in] length of the input vector
-
void csi_float_to_q15(const float32_t *pSrc, q15_t *pDst, uint32_t blockSize)
Converts the elements of the floating-point vector to Q15 vector.
- Parameters:
pSrc – [in] points to the floating-point input vector
pDst – [out] points to the Q15 output vector
blockSize – [in] length of the input vector
-
void csi_float_to_q7(const float32_t *pSrc, q7_t *pDst, uint32_t blockSize)
Converts the elements of the floating-point vector to Q7 vector.
- Parameters:
pSrc – [in] points to the floating-point input vector
pDst – [out] points to the Q7 output vector
blockSize – [in] length of the input vector
-
void csi_q31_to_float(const q31_t *pSrc, float32_t *pDst, uint32_t blockSize)
Converts the elements of the Q31 vector to floating-point vector.
- Parameters:
pSrc – [in] is input pointer
pDst – [out] is output pointer
blockSize – [in] is the number of samples to process
-
void csi_q31_to_q15(const q31_t *pSrc, q15_t *pDst, uint32_t blockSize)
Converts the elements of the Q31 vector to Q15 vector.
- Parameters:
pSrc – [in] is input pointer
pDst – [out] is output pointer
blockSize – [in] is the number of samples to process
-
void csi_q31_to_q7_rs(q31_t *pSrc, q7_t *pDst, uint32_t shiftValue, uint32_t blockSize)
-
void csi_q63_to_q31_rs(q63_t *pSrc, q31_t *pDst, uint32_t shiftValue, uint32_t blockSize)
-
void csi_q31_to_q7(const q31_t *pSrc, q7_t *pDst, uint32_t blockSize)
Converts the elements of the Q31 vector to Q7 vector.
- Parameters:
pSrc – [in] is input pointer
pDst – [out] is output pointer
blockSize – [in] is the number of samples to process
-
void csi_q15_to_float(const q15_t *pSrc, float32_t *pDst, uint32_t blockSize)
Converts the elements of the Q15 vector to floating-point vector.
- Parameters:
pSrc – [in] is input pointer
pDst – [out] is output pointer
blockSize – [in] is the number of samples to process
-
void csi_q15_to_q31(const q15_t *pSrc, q31_t *pDst, uint32_t blockSize)
Converts the elements of the Q15 vector to Q31 vector.
- Parameters:
pSrc – [in] is input pointer
pDst – [out] is output pointer
blockSize – [in] is the number of samples to process
-
void csi_q15_to_q7(const q15_t *pSrc, q7_t *pDst, uint32_t blockSize)
Converts the elements of the Q15 vector to Q7 vector.
- Parameters:
pSrc – [in] is input pointer
pDst – [out] is output pointer
blockSize – [in] is the number of samples to process
-
void csi_q7_to_float(const q7_t *pSrc, float32_t *pDst, uint32_t blockSize)
Converts the elements of the Q7 vector to floating-point vector.
- Parameters:
pSrc – [in] is input pointer
pDst – [out] is output pointer
blockSize – [in] is the number of samples to process
-
void csi_q7_to_q31(const q7_t *pSrc, q31_t *pDst, uint32_t blockSize)
Converts the elements of the Q7 vector to Q31 vector.
- Parameters:
pSrc – [in] input pointer
pDst – [out] output pointer
blockSize – [in] number of samples to process
-
void csi_q7_to_q15(const q7_t *pSrc, q15_t *pDst, uint32_t blockSize)
Converts the elements of the Q7 vector to Q15 vector.
- Parameters:
pSrc – [in] input pointer
pDst – [out] output pointer
blockSize – [in] number of samples to process
-
void csi_svm_linear_init_f32(csi_svm_linear_instance_f32 *S, uint32_t nbOfSupportVectors, uint32_t vectorDimension, float32_t intercept, const float32_t *dualCoefficients, const float32_t *supportVectors, const int32_t *classes)
SVM linear instance init function.
- Parameters:
S – [in] Parameters for SVM functions
nbOfSupportVectors – [in] Number of support vectors
vectorDimension – [in] Dimension of vector space
intercept – [in] Intercept
dualCoefficients – [in] Array of dual coefficients
supportVectors – [in] Array of support vectors
classes – [in] Array of 2 classes ID
- Returns:
none.
-
void csi_svm_linear_predict_f32(const csi_svm_linear_instance_f32 *S, const float32_t *in, int32_t *pResult)
SVM linear prediction.
- Parameters:
S – [in] Pointer to an instance of the linear SVM structure.
in – [in] Pointer to input vector
pResult – [out] Decision value
- Returns:
none.
-
void csi_svm_polynomial_init_f32(csi_svm_polynomial_instance_f32 *S, uint32_t nbOfSupportVectors, uint32_t vectorDimension, float32_t intercept, const float32_t *dualCoefficients, const float32_t *supportVectors, const int32_t *classes, int32_t degree, float32_t coef0, float32_t gamma)
SVM polynomial instance init function.
- Parameters:
S – [in] points to an instance of the polynomial SVM structure.
nbOfSupportVectors – [in] Number of support vectors
vectorDimension – [in] Dimension of vector space
intercept – [in] Intercept
dualCoefficients – [in] Array of dual coefficients
supportVectors – [in] Array of support vectors
classes – [in] Array of 2 classes ID
degree – [in] Polynomial degree
coef0 – [in] coeff0 (scikit-learn terminology)
gamma – [in] gamma (scikit-learn terminology)
- Returns:
none.
-
void csi_svm_polynomial_predict_f32(const csi_svm_polynomial_instance_f32 *S, const float32_t *in, int32_t *pResult)
SVM polynomial prediction.
- Parameters:
S – [in] Pointer to an instance of the polynomial SVM structure.
in – [in] Pointer to input vector
pResult – [out] Decision value
- Returns:
none.
-
void csi_svm_rbf_init_f32(csi_svm_rbf_instance_f32 *S, uint32_t nbOfSupportVectors, uint32_t vectorDimension, float32_t intercept, const float32_t *dualCoefficients, const float32_t *supportVectors, const int32_t *classes, float32_t gamma)
SVM radial basis function instance init function.
- Parameters:
S – [in] points to an instance of the polynomial SVM structure.
nbOfSupportVectors – [in] Number of support vectors
vectorDimension – [in] Dimension of vector space
intercept – [in] Intercept
dualCoefficients – [in] Array of dual coefficients
supportVectors – [in] Array of support vectors
classes – [in] Array of 2 classes ID
gamma – [in] gamma (scikit-learn terminology)
- Returns:
none.
-
void csi_svm_rbf_predict_f32(const csi_svm_rbf_instance_f32 *S, const float32_t *in, int32_t *pResult)
SVM rbf prediction.
- Parameters:
S – [in] Pointer to an instance of the rbf SVM structure.
in – [in] Pointer to input vector
pResult – [out] decision value
- Returns:
none.
-
void csi_svm_sigmoid_init_f32(csi_svm_sigmoid_instance_f32 *S, uint32_t nbOfSupportVectors, uint32_t vectorDimension, float32_t intercept, const float32_t *dualCoefficients, const float32_t *supportVectors, const int32_t *classes, float32_t coef0, float32_t gamma)
SVM sigmoid instance init function.
- Parameters:
S – [in] points to an instance of the rbf SVM structure.
nbOfSupportVectors – [in] Number of support vectors
vectorDimension – [in] Dimension of vector space
intercept – [in] Intercept
dualCoefficients – [in] Array of dual coefficients
supportVectors – [in] Array of support vectors
classes – [in] Array of 2 classes ID
coef0 – [in] coeff0 (scikit-learn terminology)
gamma – [in] gamma (scikit-learn terminology)
- Returns:
none.
-
void csi_svm_sigmoid_predict_f32(const csi_svm_sigmoid_instance_f32 *S, const float32_t *in, int32_t *pResult)
SVM sigmoid prediction.
- Parameters:
S – [in] Pointer to an instance of the rbf SVM structure.
in – [in] Pointer to input vector
pResult – [out] Decision value
- Returns:
none.
-
uint32_t csi_gaussian_naive_bayes_predict_f32(const csi_gaussian_naive_bayes_instance_f32 *S, const float32_t *in, float32_t *pBuffer)
Naive Gaussian Bayesian Estimator.
- Parameters:
S – [in] points to a naive bayes instance structure
in – [in] points to the elements of the input vector.
pBuffer – [in] points to a buffer of length numberOfClasses
- Returns:
The predicted class
-
float32_t csi_logsumexp_f32(const float32_t *in, uint32_t blockSize)
Computation of the LogSumExp.
In probabilistic computations, the dynamic of the probability values can be very wide because they come from gaussian functions. To avoid underflow and overflow issues, the values are represented by their log. In this representation, multiplying the original exp values is easy : their logs are added. But adding the original exp values is requiring some special handling and it is the goal of the LogSumExp function.
If the values are x1…xn, the function is computing:
ln(exp(x1) + … + exp(xn)) and the computation is done in such a way that rounding issues are minimised.
The max xm of the values is extracted and the function is computing: xm + ln(exp(x1 - xm) + … + exp(xn - xm))
- Parameters:
*in – [in] Pointer to an array of input values.
blockSize – [in] Number of samples in the input array.
- Returns:
LogSumExp
-
float32_t csi_logsumexp_dot_prod_f32(const float32_t *pSrcA, const float32_t *pSrcB, uint32_t blockSize, float32_t *pTmpBuffer)
Dot product with log arithmetic.
Vectors are containing the log of the samples
- Parameters:
pSrcA – [in] points to the first input vector
pSrcB – [in] points to the second input vector
blockSize – [in] number of samples in each vector
pTmpBuffer – [in] temporary buffer of length blockSize
- Returns:
The log of the dot product .
-
float32_t csi_entropy_f32(const float32_t *pSrcA, uint32_t blockSize)
Entropy.
- Parameters:
pSrcA – [in] Array of input values.
blockSize – [in] Number of samples in the input array.
- Returns:
Entropy -Sum(p ln p)
-
float32_t csi_kullback_leibler_f32(const float32_t *pSrcA, const float32_t *pSrcB, uint32_t blockSize)
Kullback-Leibler.
- Parameters:
pSrcA – [in] Pointer to an array of input values for probability distribution A.
pSrcB – [in] Pointer to an array of input values for probability distribution B.
blockSize – [in] Number of samples in the input array.
- Returns:
Kullback-Leibler Divergence D(A || B)
-
float32_t csi_weighted_sum_f32(const float32_t *in, const float32_t *weigths, uint32_t blockSize)
Weighted sum.
- Parameters:
*in – [in] Array of input values.
*weigths – [in] Weights
blockSize – [in] Number of samples in the input array.
- Returns:
Weighted sum
-
void csi_barycenter_f32(const float32_t *in, const float32_t *weights, float32_t *out, uint32_t nbVectors, uint32_t vecDim)
Barycenter.
- Parameters:
in – [in] List of vectors
weights – [in] Weights of the vectors
out – [out] Barycenter
nbVectors – [in] Number of vectors
vecDim – [in] Dimension of space (vector dimension)
- Returns:
None
-
float32_t csi_euclidean_distance_f32(const float32_t *pA, const float32_t *pB, uint32_t blockSize)
Euclidean distance between two vectors.
- Parameters:
pA – [in] First vector
pB – [in] Second vector
blockSize – [in] vector length
- Returns:
distance
-
float32_t csi_braycurtis_distance_f32(const float32_t *pA, const float32_t *pB, uint32_t blockSize)
Bray-Curtis distance between two vectors.
- Parameters:
pA – [in] First vector
pB – [in] Second vector
blockSize – [in] vector length
- Returns:
distance
-
float32_t csi_canberra_distance_f32(const float32_t *pA, const float32_t *pB, uint32_t blockSize)
Canberra distance between two vectors.
This function may divide by zero when samples pA[i] and pB[i] are both zero. The result of the computation will be correct. So the division per zero may be ignored.
- Parameters:
pA – [in] First vector
pB – [in] Second vector
blockSize – [in] vector length
- Returns:
distance
-
float32_t csi_chebyshev_distance_f32(const float32_t *pA, const float32_t *pB, uint32_t blockSize)
Chebyshev distance between two vectors.
- Parameters:
pA – [in] First vector
pB – [in] Second vector
blockSize – [in] vector length
- Returns:
distance
-
float32_t csi_cityblock_distance_f32(const float32_t *pA, const float32_t *pB, uint32_t blockSize)
Cityblock (Manhattan) distance between two vectors.
- Parameters:
pA – [in] First vector
pB – [in] Second vector
blockSize – [in] vector length
- Returns:
distance
-
float32_t csi_correlation_distance_f32(float32_t *pA, float32_t *pB, uint32_t blockSize)
Correlation distance between two vectors.
The input vectors are modified in place !
- Parameters:
pA – [in] First vector
pB – [in] Second vector
blockSize – [in] vector length
- Returns:
distance
-
float32_t csi_cosine_distance_f32(const float32_t *pA, const float32_t *pB, uint32_t blockSize)
Cosine distance between two vectors.
- Parameters:
pA – [in] First vector
pB – [in] Second vector
blockSize – [in] vector length
- Returns:
distance
-
float32_t csi_jensenshannon_distance_f32(const float32_t *pA, const float32_t *pB, uint32_t blockSize)
Jensen-Shannon distance between two vectors.
This function is assuming that elements of second vector are > 0 and 0 only when the corresponding element of first vector is 0. Otherwise the result of the computation does not make sense and for speed reasons, the cases returning NaN or Infinity are not managed.
When the function is computing x log (x / y) with x 0 and y 0, it will compute the right value (0) but a division per zero will occur and shoudl be ignored in client code.
- Parameters:
pA – [in] First vector
pB – [in] Second vector
blockSize – [in] vector length
- Returns:
distance
-
float32_t csi_minkowski_distance_f32(const float32_t *pA, const float32_t *pB, int32_t order, uint32_t blockSize)
Minkowski distance between two vectors.
- Parameters:
pA – [in] First vector
pB – [in] Second vector
n – [in] Norm order (>= 2)
blockSize – [in] vector length
- Returns:
distance
-
float32_t csi_dice_distance(const uint32_t *pA, const uint32_t *pB, uint32_t numberOfBools)
Dice distance between two vectors.
- Parameters:
pA – [in] First vector of packed booleans
pB – [in] Second vector of packed booleans
order – [in] Distance order
blockSize – [in] Number of samples
- Returns:
distance
-
float32_t csi_hamming_distance(const uint32_t *pA, const uint32_t *pB, uint32_t numberOfBools)
Hamming distance between two vectors.
- Parameters:
pA – [in] First vector of packed booleans
pB – [in] Second vector of packed booleans
numberOfBools – [in] Number of booleans
- Returns:
distance
-
float32_t csi_jaccard_distance(const uint32_t *pA, const uint32_t *pB, uint32_t numberOfBools)
Jaccard distance between two vectors.
- Parameters:
pA – [in] First vector of packed booleans
pB – [in] Second vector of packed booleans
numberOfBools – [in] Number of booleans
- Returns:
distance
-
float32_t csi_kulsinski_distance(const uint32_t *pA, const uint32_t *pB, uint32_t numberOfBools)
Kulsinski distance between two vectors.
- Parameters:
pA – [in] First vector of packed booleans
pB – [in] Second vector of packed booleans
numberOfBools – [in] Number of booleans
- Returns:
distance
-
float32_t csi_rogerstanimoto_distance(const uint32_t *pA, const uint32_t *pB, uint32_t numberOfBools)
Roger Stanimoto distance between two vectors.
- Parameters:
pA – [in] First vector of packed booleans
pB – [in] Second vector of packed booleans
numberOfBools – [in] Number of booleans
- Returns:
distance
-
float32_t csi_russellrao_distance(const uint32_t *pA, const uint32_t *pB, uint32_t numberOfBools)
Russell-Rao distance between two vectors.
- Parameters:
pA – [in] First vector of packed booleans
pB – [in] Second vector of packed booleans
numberOfBools – [in] Number of booleans
- Returns:
distance
-
float32_t csi_sokalmichener_distance(const uint32_t *pA, const uint32_t *pB, uint32_t numberOfBools)
Sokal-Michener distance between two vectors.
- Parameters:
pA – [in] First vector of packed booleans
pB – [in] Second vector of packed booleans
numberOfBools – [in] Number of booleans
- Returns:
distance
-
float32_t csi_sokalsneath_distance(const uint32_t *pA, const uint32_t *pB, uint32_t numberOfBools)
Sokal-Sneath distance between two vectors.
- Parameters:
pA – [in] First vector of packed booleans
pB – [in] Second vector of packed booleans
numberOfBools – [in] Number of booleans
- Returns:
distance
-
float32_t csi_yule_distance(const uint32_t *pA, const uint32_t *pB, uint32_t numberOfBools)
Yule distance between two vectors.
- Parameters:
pA – [in] First vector of packed booleans
pB – [in] Second vector of packed booleans
numberOfBools – [in] Number of booleans
- Returns:
distance
- __STATIC_FORCEINLINE float32_t csi_bilinear_interp_f32 (const csi_bilinear_interp_instance_f32 *S, float32_t X, float32_t Y)
Floating-point bilinear interpolation.
- Parameters:
S – [inout] points to an instance of the interpolation structure.
X – [in] interpolation coordinate.
Y – [in] interpolation coordinate.
- Returns:
out interpolated value.
- __STATIC_FORCEINLINE q31_t csi_bilinear_interp_q31 (csi_bilinear_interp_instance_q31 *S, q31_t X, q31_t Y)
Q31 bilinear interpolation.
- Parameters:
S – [inout] points to an instance of the interpolation structure.
X – [in] interpolation coordinate in 12.20 format.
Y – [in] interpolation coordinate in 12.20 format.
- Returns:
out interpolated value.
- __STATIC_FORCEINLINE q15_t csi_bilinear_interp_q15 (csi_bilinear_interp_instance_q15 *S, q31_t X, q31_t Y)
Q15 bilinear interpolation.
- Parameters:
S – [inout] points to an instance of the interpolation structure.
X – [in] interpolation coordinate in 12.20 format.
Y – [in] interpolation coordinate in 12.20 format.
- Returns:
out interpolated value.
- __STATIC_FORCEINLINE q7_t csi_bilinear_interp_q7 (csi_bilinear_interp_instance_q7 *S, q31_t X, q31_t Y)
Q7 bilinear interpolation.
- Parameters:
S – [inout] points to an instance of the interpolation structure.
X – [in] interpolation coordinate in 12.20 format.
Y – [in] interpolation coordinate in 12.20 format.
- Returns:
out interpolated value.
Enums
Functions
-
void csky_dsp2_convolve_HWC_q7_basic(const q7_t *Im_in, const uint16_t dim_im_in, const uint16_t ch_im_in, const q7_t *wt, const uint16_t ch_im_out, const uint16_t dim_kernel, const uint16_t padding, const uint16_t stride, const q7_t *bias, const uint16_t bias_shift, const uint16_t out_shift, q7_t *Im_out, const uint16_t dim_im_out, q15_t *bufferA)
Basic Q7 convolution function.
- Parameters:
Im_in – [in] pointer to input tensor
dim_im_in – [in] input tensor dimention
ch_im_in – [in] number of input tensor channels
wt – [in] pointer to kernel weights
ch_im_out – [in] number of filters, i.e., output tensor channels
dim_kernel – [in] filter kernel size
padding – [in] padding sizes
stride – [in] convolution stride
bias – [in] pointer to bias
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
Im_out – [inout] pointer to output tensor
dim_im_out – [in] output tensor dimension
bufferA – [inout] pointer to buffer space for input
- Returns:
none.
-
void csky_dsp2_convolve_HWC_q15_basic(const q15_t *Im_in, const uint16_t dim_im_in, const uint16_t ch_im_in, const q15_t *wt, const uint16_t ch_im_out, const uint16_t dim_kernel, const uint16_t padding, const uint16_t stride, const q15_t *bias, const uint16_t bias_shift, const uint16_t out_shift, q15_t *Im_out, const uint16_t dim_im_out, q15_t *bufferA)
Basic Q15 convolution function.
- Parameters:
Im_in – [in] pointer to input tensor
dim_im_in – [in] input tensor dimention
ch_im_in – [in] number of input tensor channels
wt – [in] pointer to kernel weights
ch_im_out – [in] number of filters, i.e., output tensor channels
dim_kernel – [in] filter kernel size
padding – [in] padding sizes
stride – [in] convolution stride
bias – [in] pointer to bias
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
Im_out – [inout] pointer to output tensor
dim_im_out – [in] output tensor dimension
bufferA – [inout] pointer to buffer space for input
- Returns:
none.
-
void csky_dsp2_convolve_HWC_q7_fast(const q7_t *Im_in, const uint16_t dim_im_in, const uint16_t ch_im_in, const q7_t *wt, const uint16_t ch_im_out, const uint16_t dim_kernel, const uint16_t padding, const uint16_t stride, const q7_t *bias, const uint16_t bias_shift, const uint16_t out_shift, q7_t *Im_out, const uint16_t dim_im_out, q15_t *bufferA)
Fast Q7 convolution function.
This function is the version with full list of optimization tricks, but with some contraints: ch_im_in is multiple of 4 ch_im_out is multiple of 2
- Parameters:
Im_in – [in] pointer to input tensor
dim_im_in – [in] input tensor dimention
ch_im_in – [in] number of input tensor channels
wt – [in] pointer to kernel weights
ch_im_out – [in] number of filters, i.e., output tensor channels
dim_kernel – [in] filter kernel size
padding – [in] padding sizes
stride – [in] convolution stride
bias – [in] pointer to bias
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
Im_out – [inout] pointer to output tensor
dim_im_out – [in] output tensor dimension
bufferA – [inout] pointer to buffer space for input
- Returns:
none.
-
void csky_dsp2_convolve_HWC_q7_fast_nonsquare(const q7_t *Im_in, const uint16_t dim_im_in_x, const uint16_t dim_im_in_y, const uint16_t ch_im_in, const q7_t *wt, const uint16_t ch_im_out, const uint16_t dim_kernel_x, const uint16_t dim_kernel_y, const uint16_t padding_x, const uint16_t padding_y, const uint16_t stride_x, const uint16_t stride_y, const q7_t *bias, const uint16_t bias_shift, const uint16_t out_shift, q7_t *Im_out, const uint16_t dim_im_out_x, const uint16_t dim_im_out_y, q15_t *bufferA)
Fast Q7 convolution function (non-sqaure shape)
This function is the version with full list of optimization tricks, but with some contraints: ch_im_in is multiple of 4 ch_im_out is multiple of 2
- Parameters:
Im_in – [in] pointer to input tensor
dim_im_in_x – [in] input tensor dimention x
dim_im_in_y – [in] input tensor dimention y
ch_im_in – [in] number of input tensor channels
wt – [in] pointer to kernel weights
ch_im_out – [in] number of filters, i.e., output tensor channels
dim_kernel_x – [in] filter kernel size x
dim_kernel_y – [in] filter kernel size y
padding_x – [in] padding size x
padding_y – [in] padding size y
stride_x – [in] convolution stride x
stride_y – [in] convolution stride y
bias – [in] pointer to bias
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
Im_out – [inout] pointer to output tensor
dim_im_out_x – [in] output tensor dimension x
dim_im_out_y – [in] output tensor dimension y
bufferA – [inout] pointer to buffer space for input
- Returns:
none.
-
void csky_dsp2_convolve_1x1_HWC_q7_fast(const q7_t *Im_in, const uint16_t dim_im_in_x, const uint16_t dim_im_in_y, const uint16_t ch_im_in, const q7_t *wt, const uint16_t ch_im_out, const q7_t *bias, const uint16_t bias_shift, const uint16_t out_shift, q7_t *Im_out, const uint16_t dim_im_out_x, const uint16_t dim_im_out_y, q15_t *bufferA)
Fast Q7 version of 1x1 convolution (non-sqaure shape)
This function implement convolution with 1x1 kernel size (i.e., dim_kernel_x=1 and dim_kernel_y=1). It can be used for second half of MobileNets after depthwise separable convolution.
This function is the version with full list of optimization tricks, but with some contraints: ch_im_in is multiple of 4 ch_im_out is multiple of 2
- Parameters:
Im_in – [in] pointer to input tensor
dim_im_in_x – [in] input tensor dimention x
dim_im_in_y – [in] input tensor dimention y
ch_im_in – [in] number of input tensor channels
wt – [in] pointer to kernel weights
ch_im_out – [in] number of filters, i.e., output tensor channels
dim_kernel_x – [in] filter kernel size x
dim_kernel_y – [in] filter kernel size y
padding_x – [in] padding size x
padding_y – [in] padding size y
stride_x – [in] convolution stride x
stride_y – [in] convolution stride y
bias – [in] pointer to bias
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
Im_out – [inout] pointer to output tensor
dim_im_out_x – [in] output tensor dimension x
dim_im_out_y – [in] output tensor dimension y
bufferA – [inout] pointer to buffer space for input
- Returns:
none.
-
void csky_dsp2_convolve_HWC_q7_RGB(const q7_t *Im_in, const uint16_t dim_im_in, const q7_t *wt, const uint16_t ch_im_out, const uint16_t dim_kernel, const uint16_t padding, const uint16_t stride, const q7_t *bias, const uint16_t bias_shift, const uint16_t out_shift, q7_t *Im_out, const uint16_t dim_im_out, q15_t *bufferA)
Q7 version of convolution for RGB image.
This kernel is written exclusively for convolution with ch_im_in equals 3. This applies on the first layer of CNNs which has input image with RGB format.
- Parameters:
Im_in – [in] pointer to input tensor
dim_im_in – [in] input tensor dimention
ch_im_in – [in] number of input tensor channels
wt – [in] pointer to kernel weights
ch_im_out – [in] number of filters, i.e., output tensor channels
dim_kernel – [in] filter kernel size
padding – [in] padding sizes
stride – [in] convolution stride
bias – [in] pointer to bias
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
Im_out – [inout] pointer to output tensor
dim_im_out – [in] output tensor dimension
bufferA – [inout] pointer to buffer space for input
- Returns:
none.
-
void csky_dsp2_convolve_HWC_q15_fast(const q15_t *Im_in, const uint16_t dim_im_in, const uint16_t ch_im_in, const q15_t *wt, const uint16_t ch_im_out, const uint16_t dim_kernel, const uint16_t padding, const uint16_t stride, const q15_t *bias, const uint16_t bias_shift, const uint16_t out_shift, q15_t *Im_out, const uint16_t dim_im_out, q15_t *bufferA)
Fast Q15 convolution function.
This function is the version with full list of optimization tricks, but with some contraints: ch_im_in is multiple of 2 ch_im_out is multiple of 2
- Parameters:
Im_in – [in] pointer to input tensor
dim_im_in – [in] input tensor dimention
ch_im_in – [in] number of input tensor channels
wt – [in] pointer to kernel weights
ch_im_out – [in] number of filters, i.e., output tensor channels
dim_kernel – [in] filter kernel size
padding – [in] padding sizes
stride – [in] convolution stride
bias – [in] pointer to bias
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
Im_out – [inout] pointer to output tensor
dim_im_out – [in] output tensor dimension
bufferA – [inout] pointer to buffer space for input
- Returns:
none.
-
void csky_dsp2_depthwise_separable_conv_HWC_q7(const q7_t *Im_in, const uint16_t dim_im_in, const uint16_t ch_im_in, const q7_t *wt, const uint16_t ch_im_out, const uint16_t dim_kernel, const uint16_t padding, const uint16_t stride, const q7_t *bias, const uint16_t bias_shift, const uint16_t out_shift, q7_t *Im_out, const uint16_t dim_im_out, q15_t *bufferA)
Q7 depthwise separable convolution function.
This function is the version with full list of optimization tricks, but with some contraints: ch_im_in is multiple of 2 ch_im_out is multiple of 2
- Parameters:
Im_in – [in] pointer to input tensor
dim_im_in – [in] input tensor dimention
ch_im_in – [in] number of input tensor channels
wt – [in] pointer to kernel weights
ch_im_out – [in] number of filters, i.e., output tensor channels
dim_kernel – [in] filter kernel size
padding – [in] padding sizes
stride – [in] convolution stride
bias – [in] pointer to bias
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
Im_out – [inout] pointer to output tensor
dim_im_out – [in] output tensor dimension
bufferA – [inout] pointer to buffer space for input
- Returns:
none.
-
void csky_dsp2_depthwise_separable_conv_HWC_q7_nonsquare(const q7_t *Im_in, const uint16_t dim_im_in_x, const uint16_t dim_im_in_y, const uint16_t ch_im_in, const q7_t *wt, const uint16_t ch_im_out, const uint16_t dim_kernel_x, const uint16_t dim_kernel_y, const uint16_t padding_x, const uint16_t padding_y, const uint16_t stride_x, const uint16_t stride_y, const q7_t *bias, const uint16_t bias_shift, const uint16_t out_shift, q7_t *Im_out, const uint16_t dim_im_out_x, const uint16_t dim_im_out_y, q15_t *bufferA)
Q7 depthwise separable convolution function (non-square shape)
This function is the version with full list of optimization tricks, but with some contraints: ch_im_in is multiple of 2 ch_im_out is multiple of 2
- Parameters:
Im_in – [in] pointer to input tensor
dim_im_in_x – [in] input tensor dimention x
dim_im_in_y – [in] input tensor dimention y
ch_im_in – [in] number of input tensor channels
wt – [in] pointer to kernel weights
ch_im_out – [in] number of filters, i.e., output tensor channels
dim_kernel_x – [in] filter kernel size x
dim_kernel_y – [in] filter kernel size y
padding_x – [in] padding sizes x
padding_y – [in] padding sizes y
stride_x – [in] convolution stride x
stride_y – [in] convolution stride y
bias – [in] pointer to bias
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
Im_out – [inout] pointer to output tensor
dim_im_out_x – [in] output tensor dimension x
dim_im_out_y – [in] output tensor dimension y
bufferA – [inout] pointer to buffer space for input
- Returns:
none.
-
void csky_dsp2_fully_connected_q7(const q7_t *pV, const q7_t *pM, const uint16_t dim_vec, const uint16_t num_of_rows, const uint16_t bias_shift, const uint16_t out_shift, const q7_t *bias, q7_t *pOut)
Q7 basic fully-connected layer function.
- Parameters:
pV – [in] pointer to input vector
pM – [in] pointer to matrix weights
dim_vec – [in] length of the vector
num_of_rows – [in] number of rows in weight matrix
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
bias – [in] pointer to bias
pOut – [inout] pointer to output vector
- Returns:
none.
-
void csky_dsp2_fully_connected_q7_opt(const q7_t *pV, const q7_t *pM, const uint16_t dim_vec, const uint16_t num_of_rows, const uint16_t bias_shift, const uint16_t out_shift, const q7_t *bias, q7_t *pOut, q15_t *vec_buffer)
Q7 opt fully-connected layer function.
- Parameters:
pV – [in] pointer to input vector
pM – [in] pointer to matrix weights
dim_vec – [in] length of the vector
num_of_rows – [in] number of rows in weight matrix
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
bias – [in] pointer to bias
pOut – [inout] pointer to output vector
vec_buffer – [inout] pointer to buffer space for input
- Returns:
none.
-
void csky_dsp2_fully_connected_q15(const q15_t *pV, const q15_t *pM, const uint16_t dim_vec, const uint16_t num_of_rows, const uint16_t bias_shift, const uint16_t out_shift, const q15_t *bias, q15_t *pOut)
Q15 basic fully-connected layer function.
- Parameters:
pV – [in] pointer to input vector
pM – [in] pointer to matrix weights
dim_vec – [in] length of the vector
num_of_rows – [in] number of rows in weight matrix
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
bias – [in] pointer to bias
pOut – [inout] pointer to output vector
- Returns:
none.
-
void csky_dsp2_fully_connected_q15_opt(const q15_t *pV, const q15_t *pM, const uint16_t dim_vec, const uint16_t num_of_rows, const uint16_t bias_shift, const uint16_t out_shift, const q15_t *bias, q15_t *pOut)
Q15 opt fully-connected layer function.
- Parameters:
pV – [in] pointer to input vector
pM – [in] pointer to matrix weights
dim_vec – [in] length of the vector
num_of_rows – [in] number of rows in weight matrix
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
bias – [in] pointer to bias
pOut – [inout] pointer to output vector
- Returns:
none.
-
void csky_dsp2_fully_connected_mat_q7_vec_q15(const q15_t *pV, const q7_t *pM, const uint16_t dim_vec, const uint16_t num_of_rows, const uint16_t bias_shift, const uint16_t out_shift, const q7_t *bias, q15_t *pOut)
Mixed Q15-Q7 fully-connected layer function.
- Parameters:
pV – [in] pointer to input vector
pM – [in] pointer to matrix weights
dim_vec – [in] length of the vector
num_of_rows – [in] number of rows in weight matrix
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
bias – [in] pointer to bias
pOut – [inout] pointer to output vector
- Returns:
none.
-
void csky_dsp2_fully_connected_mat_q7_vec_q15_opt(const q15_t *pV, const q7_t *pM, const uint16_t dim_vec, const uint16_t num_of_rows, const uint16_t bias_shift, const uint16_t out_shift, const q7_t *bias, q15_t *pOut)
Mixed Q15-Q7 opt fully-connected layer function.
- Parameters:
pV – [in] pointer to input vector
pM – [in] pointer to matrix weights
dim_vec – [in] length of the vector
num_of_rows – [in] number of rows in weight matrix
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
bias – [in] pointer to bias
pOut – [inout] pointer to output vector
- Returns:
none.
-
q7_t *csky_dsp2_nn_mat_mult_kernel_q7_q15(const q7_t *pA, const q15_t *pInBuffer, const uint16_t ch_im_out, const uint16_t numCol_A, const uint16_t bias_shift, const uint16_t out_shift, const q7_t *bias, q7_t *pOut)
Matrix-Multiplication Kernels for Convolution.
These functions are used within convolution layer functions for matrix multiplication.
The implementation is similar to CSI-DSP csky_dsp2_mat_mult functions with one Q7 and one Q15 operands. The Q15 operand is the im2col output which is always with 2 columns.
Matrix-multiplication function for convolution
- Parameters:
pA – [in] pointer to operand A
pInBuffer – [in] pointer to operand B, always conssists of 2 vectors
ch_im_out – [in] numRow of A
numCol_A – [in] numCol of A
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
bias – [in] the bias
pOut – [inout] pointer to output
- Returns:
The function returns the incremented output pointer
-
q7_t *csky_dsp2_nn_mat_mult_kernel_q7_q15_reordered(const q7_t *pA, const q15_t *pInBuffer, const uint16_t ch_im_out, const uint16_t numCol_A, const uint16_t bias_shift, const uint16_t out_shift, const q7_t *bias, q7_t *pOut)
Matrix-multiplication function for convolution with reordered columns.
- Parameters:
pA – [in] pointer to operand A
pInBuffer – [in] pointer to operand B, always conssists of 2 vectors
ch_im_out – [in] numRow of A
numCol_A – [in] numCol of A
bias_shift – [in] amount of left-shift for bias
out_shift – [in] amount of right-shift for output
bias – [in] the bias
pOut – [inout] pointer to output
- Returns:
The function returns the incremented output pointer
-
void csky_dsp2_relu_q7(q7_t *data, uint16_t size)
Q7 RELU function.
- Parameters:
data – [inout] pointer to input
size – [in] number of elements
- Returns:
none.
-
void csky_dsp2_relu_q15(q15_t *data, uint16_t size)
Q15 RELU function.
- Parameters:
data – [inout] pointer to input
size – [in] number of elements
- Returns:
none.
-
void csky_dsp2_nn_activations_direct_q7(q7_t *data, uint16_t size, uint16_t int_width, csky_dsp2_nn_activation_type type)
Q7 neural network activation function using direct table look-up.
- Parameters:
data – [inout] pointer to input
size – [in] number of elements
int_width – [in] bit-width of the integer part, assume to be smaller than 3
type – [in] type of activation functions
- Returns:
none.
-
void csky_dsp2_nn_activations_direct_q15(q15_t *data, uint16_t size, uint16_t int_width, csky_dsp2_nn_activation_type type)
Q15 neural network activation function using direct table look-up.
- Parameters:
data – [inout] pointer to input
size – [in] number of elements
int_width – [in] bit-width of the integer part, assume to be smaller than 3
type – [in] type of activation functions
- Returns:
none.
-
void csky_dsp2_maxpool_q7_HWC(q7_t *Im_in, const uint16_t dim_im_in, const uint16_t ch_im_in, const uint16_t dim_kernel, const uint16_t padding, const uint16_t stride, const uint16_t dim_im_out, q7_t *bufferA, q7_t *Im_out)
Q7 max pooling function.
- Parameters:
Im_in – [in] pointer to input tensor
dim_im_in – [in] input tensor dimention
ch_im_in – [in] number of input tensor channels
dim_kernel – [in] filter kernel size
padding – [in] padding sizes
stride – [in] convolution stride
dim_im_out – [in] output tensor dimension
bufferA – [inout] pointer to buffer space for input
Im_out – [inout] pointer to output tensor
- Returns:
none.
-
void csky_dsp2_avepool_q7_HWC(q7_t *Im_in, const uint16_t dim_im_in, const uint16_t ch_im_in, const uint16_t dim_kernel, const uint16_t padding, const uint16_t stride, const uint16_t dim_im_out, q7_t *bufferA, q7_t *Im_out)
Q7 average pooling function.
- Parameters:
Im_in – [in] pointer to input tensor
dim_im_in – [in] input tensor dimention
ch_im_in – [in] number of input tensor channels
dim_kernel – [in] filter kernel size
padding – [in] padding sizes
stride – [in] convolution stride
dim_im_out – [in] output tensor dimension
bufferA – [inout] pointer to buffer space for input
Im_out – [inout] pointer to output tensor
- Returns:
none.
-
void csky_dsp2_softmax_q7(const q7_t *vec_in, const uint16_t dim_vec, q7_t *p_out)
Q7 softmax function.
- Parameters:
vec_in – [in] pointer to input vector
dim_vec – [in] input vector dimention
p_out – [out] pointer to output vector
- Returns:
none.
-
void csky_dsp2_softmax_q15(const q15_t *vec_in, const uint16_t dim_vec, q15_t *p_out)
Q15 softmax function.
- Parameters:
vec_in – [in] pointer to input vector
dim_vec – [in] input vector dimention
p_out – [out] pointer to output vector
- Returns:
none.