Logo
MSP DSP Library
Complex Vectors

Data Structures

struct  msp_cmplx_add_q15_params
 Parameter structure for the Q15 complex vector add functions. More...
 
struct  msp_cmplx_add_iq31_params
 Parameter structure for the IQ31 complex vector add functions. More...
 
struct  msp_cmplx_sub_q15_params
 Parameter structure for the Q15 complex vector subtract functions. More...
 
struct  msp_cmplx_sub_iq31_params
 Parameter structure for the IQ31 complex vector subtract functions. More...
 
struct  msp_cmplx_mpy_q15_params
 Parameter structure for the Q15 complex vector multiply functions. More...
 
struct  msp_cmplx_mpy_iq31_params
 Parameter structure for the IQ31 complex vector multiply functions. More...
 
struct  msp_cmplx_mpy_real_q15_params
 Parameter structure for the Q15 complex vector multiply by real functions. More...
 
struct  msp_cmplx_mpy_real_iq31_params
 Parameter structure for the IQ31 complex vector multiply by real functions. More...
 
struct  msp_cmplx_mac_q15_params
 Parameter structure for the Q15 complex vector multiply and accumulate function. More...
 
struct  msp_cmplx_mac_iq31_params
 Parameter structure for the IQ31 complex vector multiply and accumulate function. More...
 
struct  msp_cmplx_conj_q15_params
 Parameter structure for the Q15 complex vector conjugate function. More...
 
struct  msp_cmplx_conj_iq31_params
 Parameter structure for the IQ31 complex vector conjugate function. More...
 
struct  msp_cmplx_scale_q15_params
 Parameter structure for the Q15 complex vector scale by real function. More...
 
struct  msp_cmplx_scale_iq31_params
 Parameter structure for the IQ31 complex vector scale by real function. More...
 
struct  msp_cmplx_shift_q15_params
 Parameter structure for the Q15 complex vector shift function. More...
 
struct  msp_cmplx_shift_iq31_params
 Parameter structure for the IQ31 complex vector shift function. More...
 

Functions

msp_status msp_cmplx_add_q15 (const msp_cmplx_add_q15_params *params, const _q15 *srcA, const _q15 *srcB, _q15 *dst)
 Addition of two complex source vectors. More...
 
msp_status msp_cmplx_add_iq31 (const msp_cmplx_add_iq31_params *params, const _iq31 *srcA, const _iq31 *srcB, _iq31 *dst)
 Addition of two complex source vectors. More...
 
msp_status msp_cmplx_sub_q15 (const msp_cmplx_sub_q15_params *params, const _q15 *srcA, const _q15 *srcB, _q15 *dst)
 Subtraction of two complex source vectors. More...
 
msp_status msp_cmplx_sub_iq31 (const msp_cmplx_sub_iq31_params *params, const _iq31 *srcA, const _iq31 *srcB, _iq31 *dst)
 Subtraction of two complex source vectors. More...
 
msp_status msp_cmplx_mpy_q15 (const msp_cmplx_mpy_q15_params *params, const _q15 *srcA, const _q15 *srcB, _q15 *dst)
 Multiplication of two complex source vectors. More...
 
msp_status msp_cmplx_mpy_iq31 (const msp_cmplx_mpy_iq31_params *params, const _iq31 *srcA, const _iq31 *srcB, _iq31 *dst)
 Multiplication of complex source vectors. More...
 
msp_status msp_cmplx_mpy_real_q15 (const msp_cmplx_mpy_real_q15_params *params, const _q15 *srcCmplx, const _q15 *srcReal, _q15 *dst)
 Multiplication of complex source vector by real source vector. More...
 
msp_status msp_cmplx_mpy_real_iq31 (const msp_cmplx_mpy_real_iq31_params *params, const _iq31 *srcCmplx, const _iq31 *srcReal, _iq31 *dst)
 Multiplication of complex source vector by real source vector. More...
 
msp_status msp_cmplx_mac_q15 (const msp_cmplx_mac_q15_params *params, const _q15 *srcA, const _q15 *srcB, _iq31 *result)
 Multiply and accumulate of complex source vectors. More...
 
msp_status msp_cmplx_mac_iq31 (const msp_cmplx_mac_iq31_params *params, const _iq31 *srcA, const _iq31 *srcB, _iq31 *result)
 Multiply and accumulate of complex source vectors. More...
 
msp_status msp_cmplx_conj_q15 (const msp_cmplx_conj_q15_params *params, const _q15 *src, _q15 *dst)
 Conjugation of a source vector. More...
 
msp_status msp_cmplx_conj_iq31 (const msp_cmplx_conj_iq31_params *params, const _iq31 *src, _iq31 *dst)
 Conjugation of a source vector. More...
 
msp_status msp_cmplx_scale_q15 (const msp_cmplx_scale_q15_params *params, const _q15 *src, _q15 *dst)
 Scale a complex source vector. More...
 
msp_status msp_cmplx_scale_iq31 (const msp_cmplx_scale_iq31_params *params, const _iq31 *src, _iq31 *dst)
 Scale a complex source vector. More...
 
msp_status msp_cmplx_shift_q15 (const msp_cmplx_shift_q15_params *params, const _q15 *src, _q15 *dst)
 Bitwise shift of a complex source vector. More...
 
msp_status msp_cmplx_shift_iq31 (const msp_cmplx_shift_iq31_params *params, const _iq31 *src, _iq31 *dst)
 Bitwise shift of a complex source vector. More...
 

Detailed Description

Functions for performing vector operations on complex data.

Function Documentation

msp_status msp_cmplx_add_iq31 ( const msp_cmplx_add_iq31_params params,
const _iq31 srcA,
const _iq31 srcB,
_iq31 dst 
)

Addition of two complex source vectors.

Details
Element-wise IQ31 addition of two complex vectors with saturation. This function supports in-place operations.
Pseudo code
dst = complex(srcA) + complex(srcB)
LEA Support
This function is supported by LEA and requires data to be placed into shared LEA memory with 4-byte alignment.
Parameters
paramsPointer to the complex vector add parameter structure.
srcAPointer to the first complex source data vector.
srcBPointer to the second complex source data vector.
dstPointer to the complex destination data vector.
Returns
Status of the operation.
msp_status msp_cmplx_add_q15 ( const msp_cmplx_add_q15_params params,
const _q15 srcA,
const _q15 srcB,
_q15 dst 
)

Addition of two complex source vectors.

Details
Element-wise Q15 addition of two complex vectors with saturation. This function supports in-place operations.
Pseudo code
dst = complex(srcA) + complex(srcB)
LEA Support
This function is supported by LEA and requires data to be placed into shared LEA memory with 4-byte alignment.
Parameters
paramsPointer to the complex vector add parameter structure.
srcAPointer to the first complex source data vector.
srcBPointer to the second complex source data vector.
dstPointer to the complex destination data vector.
Returns
Status of the operation.
Examples:
vector_ex2_complex_add_q15.c.
msp_status msp_cmplx_conj_iq31 ( const msp_cmplx_conj_iq31_params params,
const _iq31 src,
_iq31 dst 
)

Conjugation of a source vector.

Details
Conjugation of each element in a complex vector. This function supports in-place operations.
Pseudo code
dst = conj(src)
LEA Support
This function is supported by LEA and requires data to be placed into shared LEA memory with 4-byte alignment.
Parameters
paramsPointer to the complex vector conjugate parameter structure.
srcPointer to the complex source data vector.
dstPointer to the complex destination data vector.
Returns
Status of the operation.
msp_status msp_cmplx_conj_q15 ( const msp_cmplx_conj_q15_params params,
const _q15 src,
_q15 dst 
)

Conjugation of a source vector.

Details
Conjugation of each element in a complex vector. This function supports in-place operations.
Pseudo code
dst = conj(src)
LEA Support
This function is not currently supported by LEA.
Parameters
paramsPointer to the complex vector conjugate parameter structure.
srcPointer to the complex source data vector.
dstPointer to the complex destination data vector.
Returns
Status of the operation.
msp_status msp_cmplx_mac_iq31 ( const msp_cmplx_mac_iq31_params params,
const _iq31 srcA,
const _iq31 srcB,
_iq31 result 
)

Multiply and accumulate of complex source vectors.

Details
Element-wise IQ31 multiplication of two complex source vectors with accumulated result (dot product).
Pseudo code
result = sum(complex(srcA) .* complex(srcB))
LEA Support
This function is not currently supported by LEA.
Parameters
paramsPointer to the complex vector multiply and accumulate parameter structure.
srcAPointer to the first complex source data vector.
srcBPointer to the second complex source data vector.
resultPointer to the 32-bit result data.
Returns
Status of the operation.
msp_status msp_cmplx_mac_q15 ( const msp_cmplx_mac_q15_params params,
const _q15 srcA,
const _q15 srcB,
_iq31 result 
)

Multiply and accumulate of complex source vectors.

Details
Element-wise Q15 multiplication of two complex source vectors with accumulated result (dot product).
Pseudo code
result = sum(complex(srcA) .* complex(srcB))
LEA Support
This function is supported by LEA and requires data to be placed into shared LEA memory with 4-byte alignment.
Parameters
paramsPointer to the complex vector multiply and accumulate parameter structure.
srcAPointer to the first complex source data vector.
srcBPointer to the second complex source data vector.
resultPointer to the 32-bit result data.
Returns
Status of the operation.
msp_status msp_cmplx_mpy_iq31 ( const msp_cmplx_mpy_iq31_params params,
const _iq31 srcA,
const _iq31 srcB,
_iq31 dst 
)

Multiplication of complex source vectors.

Details
Element-wise IQ31 multiply of two complex vectors without saturation. This function supports in-place operations.
Pseudo code
dst = complex(srcA) .* complex(srcB)
LEA Support
This function is not currently supported by LEA.
Parameters
paramsPointer to the complex vector multiply parameter structure.
srcAPointer to the first complex source data vector.
srcBPointer to the second complex source data vector.
dstPointer to the complex destination data vector.
Returns
Status of the operation.
msp_status msp_cmplx_mpy_q15 ( const msp_cmplx_mpy_q15_params params,
const _q15 srcA,
const _q15 srcB,
_q15 dst 
)

Multiplication of two complex source vectors.

Details
Element-wise Q15 multiply of two complex vectors without saturation. This function supports in-place operations.
Pseudo code
dst = complex(srcA) .* complex(srcB)
LEA Support
This function is supported by LEA and requires data to be placed into shared LEA memory with 4-byte alignment.
Parameters
paramsPointer to the complex vector multiply parameter structure.
srcAPointer to the first complex source data vector.
srcBPointer to the second complex source data vector.
dstPointer to the complex destination data vector.
Returns
Status of the operation.
msp_status msp_cmplx_mpy_real_iq31 ( const msp_cmplx_mpy_real_iq31_params params,
const _iq31 srcCmplx,
const _iq31 srcReal,
_iq31 dst 
)

Multiplication of complex source vector by real source vector.

Details
Element-wise IQ31 multiply of a complex vector by real vector without saturation. The length of complex and real vectors should be equal, that is the complex source vector contains twice the allocated bytes for data storage. This function supports in-place operations.
Pseudo code
dst = real(srcA) .* real(srcB) + imag(srcB)
LEA Support
This function is supported by LEA and requires data to be placed into shared LEA memory with 4-byte alignment.
Parameters
paramsPointer to the complex vector multiply parameter structure.
srcCmplxPointer to the complex source data vector.
srcRealPointer to the real source data vector.
dstPointer to the complex destination data vector.
Returns
Status of the operation.
msp_status msp_cmplx_mpy_real_q15 ( const msp_cmplx_mpy_real_q15_params params,
const _q15 srcCmplx,
const _q15 srcReal,
_q15 dst 
)

Multiplication of complex source vector by real source vector.

Details
Element-wise Q15 multiply of a complex vector by real vector without saturation. The length of complex and real vectors should be equal, that is the complex source vector contains twice the allocated bytes for data storage. This function supports in-place operations.
Pseudo code
dst = real(srcA) .* real(srcB) + imag(srcB)
LEA Support
This function is not currently supported by LEA.
Parameters
paramsPointer to the complex vector multiply parameter structure.
srcCmplxPointer to the complex source data vector.
srcRealPointer to the real source data vector.
dstPointer to the complex destination data vector.
Returns
Status of the operation.
Examples:
transform_ex2_cmplx_fft_auto_q15.c.
msp_status msp_cmplx_scale_iq31 ( const msp_cmplx_scale_iq31_params params,
const _iq31 src,
_iq31 dst 
)

Scale a complex source vector.

Details
Element-wise scaling of both imaginary and real values of a complex vector. Source data is multiplied by a IQ31 constant and then shifted left. This function supports in-place operation.
Pseudo code
dst = src * 2^SHIFT * SCALE
LEA Support
This function is not currently supported by LEA.
Parameters
paramsPointer to the complex vector scale structure.
srcPointer to the complex source data vector.
dstPointer to the complex destination data vector.
Returns
Status of the operation.
msp_status msp_cmplx_scale_q15 ( const msp_cmplx_scale_q15_params params,
const _q15 src,
_q15 dst 
)

Scale a complex source vector.

Details
Element-wise scaling of both imaginary and real values of a complex vector. Source data is multiplied by a IQ31 constant and then shifted left. This function supports in-place operation.
Pseudo code
dst = src * 2^SHIFT * SCALE
LEA Support
This function is not currently supported by LEA.
Parameters
paramsPointer to the complex vector scale structure.
srcPointer to the complex source data vector.
dstPointer to the complex destination data vector.
Returns
Status of the operation.
msp_status msp_cmplx_shift_iq31 ( const msp_cmplx_shift_iq31_params params,
const _iq31 src,
_iq31 dst 
)

Bitwise shift of a complex source vector.

Details
Element-wise bitwise shift of both imaginary and real elements of a complex vector to the left or right by a signed int. This function does not saturate and supports in-place operation.
Pseudo code
dst = src * 2^SHIFT
LEA Support
This function is supported by LEA and requires data to be placed into shared LEA memory with 4-byte alignment.
Parameters
paramsPointer to the complex vector shift parameter structure.
srcPointer to the complex source data vector.
dstPointer to the complex destination data vector.
Returns
Status of the operation.
msp_status msp_cmplx_shift_q15 ( const msp_cmplx_shift_q15_params params,
const _q15 src,
_q15 dst 
)

Bitwise shift of a complex source vector.

Details
Element-wise bitwise shift of both imaginary and real elements of a complex vector to the left or right by a signed integer value. This function does not saturate and supports in-place operation.
Pseudo code
dst = src * 2^SHIFT
LEA Support
This function is supported by LEA and requires data to be placed into shared LEA memory with 4-byte alignment.
Parameters
paramsPointer to the complex vector shift parameter structure.
srcPointer to the complex source data vector.
dstPointer to the complex destination data vector.
Returns
Status of the operation.
msp_status msp_cmplx_sub_iq31 ( const msp_cmplx_sub_iq31_params params,
const _iq31 srcA,
const _iq31 srcB,
_iq31 dst 
)

Subtraction of two complex source vectors.

Details
Element-wise IQ31 subtraction of two complex vectors with saturation. This function supports in-place operations.
Pseudo code
dst = complex(srcA) - complex(srcB)
LEA Support
This function is supported by LEA and requires data to be placed into shared LEA memory with 4-byte alignment.
Parameters
paramsPointer to the complex vector subtraction parameter structure.
srcAPointer to the first complex source data vector.
srcBPointer to the second complex source data vector.
dstPointer to the complex destination data vector.
Returns
Status of the operation.
msp_status msp_cmplx_sub_q15 ( const msp_cmplx_sub_q15_params params,
const _q15 srcA,
const _q15 srcB,
_q15 dst 
)

Subtraction of two complex source vectors.

Details
Element-wise Q15 subtraction of two complex vectors with saturation. This function supports in-place operations.
Pseudo code
dst = complex(srcA) - complex(srcB)
LEA Support
This function is supported by LEA and requires data to be placed into shared LEA memory with 4-byte alignment.
Parameters
paramsPointer to the complex vector subtraction parameter structure.
srcAPointer to the first complex source data vector.
srcBPointer to the second complex source data vector.
dstPointer to the complex destination data vector.
Returns
Status of the operation.