Logo
MSP DSP Library
Real Vectors

Data Structures

struct  msp_add_q15_params
 Parameter structure for the Q15 vector add functions. More...
 
struct  msp_add_iq31_params
 Parameter structure for the IQ31 vector add functions. More...
 
struct  msp_sub_q15_params
 Parameter structure for the Q15 vector subtract functions. More...
 
struct  msp_sub_iq31_params
 Parameter structure for the IQ31 vector subtract functions. More...
 
struct  msp_mpy_q15_params
 Parameter structure for the Q15 vector multiply functions. More...
 
struct  msp_mpy_iq31_params
 Parameter structure for the IQ31 vector multiply functions. More...
 
struct  msp_mac_q15_params
 Parameter structure for the Q15 vector multiply and accumulate function. More...
 
struct  msp_mac_iq31_params
 Parameter structure for the IQ31 vector multiply and accumulate function. More...
 
struct  msp_neg_q15_params
 Parameter structure for the Q15 vector negate function. More...
 
struct  msp_neg_iq31_params
 Parameter structure for the IQ31 vector negate function. More...
 
struct  msp_abs_q15_params
 Parameter structure for the Q15 vector absolute value function. More...
 
struct  msp_abs_iq31_params
 Parameter structure for the IQ31 vector absolute value function. More...
 
struct  msp_offset_q15_params
 Parameter structure for the Q15 vector offset function. More...
 
struct  msp_offset_iq31_params
 Parameter structure for the vector offset function. More...
 
struct  msp_scale_q15_params
 Parameter structure for the Q15 vector scale function. More...
 
struct  msp_scale_iq31_params
 Parameter structure for the IQ31 vector scale function. More...
 
struct  msp_shift_q15_params
 Parameter structure for the Q15 vector shift function. More...
 
struct  msp_shift_iq31_params
 Parameter structure for the IQ31 vector shift function. More...
 
struct  msp_max_q15_params
 Parameter structure for the Q15 signed vector maximum function. More...
 
struct  msp_max_iq31_params
 Parameter structure for the IQ31 signed vector maximum function. More...
 
struct  msp_max_uq15_params
 Parameter structure for the Q15 unsigned vector maximum function. More...
 
struct  msp_max_uq31_params
 Parameter structure for the IQ31 unsigned vector maximum function. More...
 
struct  msp_min_q15_params
 Parameter structure for the Q15 signed vector minimum function. More...
 
struct  msp_min_iq31_params
 Parameter structure for the IQ31 signed vector minimum function. More...
 
struct  msp_min_uq15_params
 Parameter structure for the Q15 unsigned vector minimum function. More...
 
struct  msp_min_uq31_params
 Parameter structure for the IQ31 unsigned vector minimum function. More...
 

Functions

msp_status msp_add_q15 (const msp_add_q15_params *params, const _q15 *srcA, const _q15 *srcB, _q15 *dst)
 Addition of two real source vectors. More...
 
msp_status msp_add_iq31 (const msp_add_iq31_params *params, const _iq31 *srcA, const _iq31 *srcB, _iq31 *dst)
 Addition of two real source vectors. More...
 
msp_status msp_sub_q15 (const msp_sub_q15_params *params, const _q15 *srcA, const _q15 *srcB, _q15 *dst)
 Subtraction of two real source vectors. More...
 
msp_status msp_sub_iq31 (const msp_sub_iq31_params *params, const _iq31 *srcA, const _iq31 *srcB, _iq31 *dst)
 Subtraction of two real source vectors. More...
 
msp_status msp_mpy_q15 (const msp_mpy_q15_params *params, const _q15 *srcA, const _q15 *srcB, _q15 *dst)
 Multiplication of two real source vectors. More...
 
msp_status msp_mpy_iq31 (const msp_mpy_iq31_params *params, const _iq31 *srcA, const _iq31 *srcB, _iq31 *dst)
 Multiplication of two real source vectors. More...
 
msp_status msp_mac_q15 (const msp_mac_q15_params *params, const _q15 *srcA, const _q15 *srcB, _iq31 *result)
 Multiply and accumulate of real source vectors. More...
 
msp_status msp_mac_iq31 (const msp_mac_iq31_params *params, const _iq31 *srcA, const _iq31 *srcB, _iq31 *result)
 Multiply and accumulate of real source vectors. More...
 
msp_status msp_neg_q15 (const msp_neg_q15_params *params, const _q15 *src, _q15 *dst)
 Negation of a source vector. More...
 
msp_status msp_neg_iq31 (const msp_neg_iq31_params *params, const _iq31 *src, _iq31 *dst)
 Negation of a source vector. More...
 
msp_status msp_abs_q15 (const msp_abs_q15_params *params, const _q15 *src, _q15 *dst)
 Absolute value of a real source vector. More...
 
msp_status msp_abs_iq31 (const msp_abs_iq31_params *params, const _iq31 *src, _iq31 *dst)
 Absolute value of a real source vector. More...
 
msp_status msp_offset_q15 (const msp_offset_q15_params *params, const _q15 *src, _q15 *dst)
 Constant offset of a real source vector. More...
 
msp_status msp_offset_iq31 (const msp_offset_iq31_params *params, const _iq31 *src, _iq31 *dst)
 Constant offset of a real source vector. More...
 
msp_status msp_scale_q15 (const msp_scale_q15_params *params, const _q15 *src, _q15 *dst)
 Scale a real source vector. More...
 
msp_status msp_scale_iq31 (const msp_scale_iq31_params *params, const _iq31 *src, _iq31 *dst)
 Scale a real source vector. More...
 
msp_status msp_shift_q15 (const msp_shift_q15_params *params, const _q15 *src, _q15 *dst)
 Bitwise shift of a real source vector. More...
 
msp_status msp_shift_iq31 (const msp_shift_iq31_params *params, const _iq31 *src, _iq31 *dst)
 Bitwise shift of a real source vector. More...
 
msp_status msp_max_q15 (const msp_max_q15_params *params, const _q15 *src, _q15 *max, uint16_t *index)
 Signed maximum of a source vector. More...
 
msp_status msp_max_iq31 (const msp_max_iq31_params *params, const _iq31 *src, _iq31 *max, uint16_t *index)
 Signed maximum of a source vector. More...
 
msp_status msp_max_uq15 (const msp_max_uq15_params *params, const _uq15 *src, _uq15 *max, uint16_t *index)
 Unsigned maximum of a source vector. More...
 
msp_status msp_max_uq31 (const msp_max_uq31_params *params, const _uq31 *src, _uq31 *max, uint16_t *index)
 Unsigned maximum of a source vector. More...
 
msp_status msp_min_q15 (const msp_min_q15_params *params, const _q15 *src, _q15 *min, uint16_t *index)
 Signed minimum of a source vector. More...
 
msp_status msp_min_iq31 (const msp_min_iq31_params *params, const _iq31 *src, _iq31 *min, uint16_t *index)
 Signed minimum of a source vector. More...
 
msp_status msp_min_uq15 (const msp_min_uq15_params *params, const _uq15 *src, _uq15 *min, uint16_t *index)
 Unsigned minimum of a source vector. More...
 
msp_status msp_min_uq31 (const msp_min_uq31_params *params, const _uq31 *src, _uq31 *min, uint16_t *index)
 Unsigned minimum of a source vector. More...
 

Detailed Description

Functions for performing vector operations on real data.

Function Documentation

msp_status msp_abs_iq31 ( const msp_abs_iq31_params params,
const _iq31 src,
_iq31 dst 
)

Absolute value of a real source vector.

Details
Element-wise absolute value of a single source vector.
Pseudo code
dst = |src|
LEA Support
This function is not currently supported by LEA.
Parameters
paramsPointer to the vector absolute value parameter structure.
srcPointer to the source data vector.
dstPointer to the destination data vector.
Returns
Status of the operation.
msp_status msp_abs_q15 ( const msp_abs_q15_params params,
const _q15 src,
_q15 dst 
)

Absolute value of a real source vector.

Details
Element-wise absolute value of a single source vector.
Pseudo code
dst = |src|
LEA Support
This function is not currently supported by LEA.
Parameters
paramsPointer to the vector absolute value parameter structure.
srcPointer to the source data vector.
dstPointer to the destination data vector.
Returns
Status of the operation.
msp_status msp_add_iq31 ( const msp_add_iq31_params params,
const _iq31 srcA,
const _iq31 srcB,
_iq31 dst 
)

Addition of two real source vectors.

Details
Element-wise IQ31 addition of two real vectors with saturation. This function supports in-place operations.
Pseudo code
dst = srcA + 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 vector add parameter structure.
srcAPointer to the first source data vector.
srcBPointer to the second source data vector.
dstPointer to the destination data vector.
Returns
Status of the operation.
msp_status msp_add_q15 ( const msp_add_q15_params params,
const _q15 srcA,
const _q15 srcB,
_q15 dst 
)

Addition of two real source vectors.

Details
Element-wise Q15 addition of two real vectors with saturation. This function supports in-place operations.
Pseudo code
dst = srcA + 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 vector add parameter structure.
srcAPointer to the first source data vector.
srcBPointer to the second source data vector.
dstPointer to the destination data vector.
Returns
Status of the operation.
Examples:
filter_ex1_fir_q15.c, filter_ex2_fir_iq31.c, filter_ex3_biquad_cascade_df1_q15.c, filter_ex4_biquad_cascade_df2_q15.c, filter_ex5_biquad_cascade_df2_ext_q15.c, transform_ex1_fft_fixed_q15.c, and transform_ex3_fft_iq31.c.
msp_status msp_mac_iq31 ( const msp_mac_iq31_params params,
const _iq31 srcA,
const _iq31 srcB,
_iq31 result 
)

Multiply and accumulate of real source vectors.

Details
Element-wise IQ31 multiplication of two real source vectors with accumulated IQ31 result (dot product).
Pseudo code
result = sum(srcA .* 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 vector multiply and accumulate parameter structure.
srcAPointer to the first source data vector.
srcBPointer to the second source data vector.
resultPointer to the 32-bit result data.
Returns
Status of the operation.
msp_status msp_mac_q15 ( const msp_mac_q15_params params,
const _q15 srcA,
const _q15 srcB,
_iq31 result 
)

Multiply and accumulate of real source vectors.

Details
Element-wise Q15 multiplication of two real source vectors with accumulated IQ31 result (dot product).
Pseudo code
result = sum(srcA .* 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 vector multiply and accumulate parameter structure.
srcAPointer to the first source data vector.
srcBPointer to the second source data vector.
resultPointer to the 32-bit result data.
Returns
Status of the operation.
msp_status msp_max_iq31 ( const msp_max_iq31_params params,
const _iq31 src,
_iq31 max,
uint16_t *  index 
)

Signed maximum of a source vector.

Details
This function returns the 32-bit signed maximum value and corresponding index of a single source vector.
Pseudo code
dst = MAX(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 signed vector maximum parameter structure.
srcPointer to the source data vector.
maxPointer to the maximum result vector of size one.
indexPointer to the index result vector of size one.
Returns
Status of the operation.
msp_status msp_max_q15 ( const msp_max_q15_params params,
const _q15 src,
_q15 max,
uint16_t *  index 
)

Signed maximum of a source vector.

Details
This function returns the 16-bit signed maximum value and corresponding index of a single source vector.
Pseudo code
dst = MAX(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 signed vector maximum parameter structure.
srcPointer to the source data vector.
maxPointer to the maximum result vector of size one.
indexPointer to the index result vector of size one.
Returns
Status of the operation.
Examples:
vector_ex1_max_q15.c.
msp_status msp_max_uq15 ( const msp_max_uq15_params params,
const _uq15 src,
_uq15 max,
uint16_t *  index 
)

Unsigned maximum of a source vector.

Details
This function returns the 16-bit unsigned maximum value and corresponding index of a single source vector.
Pseudo code
dst = MAX(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 unsigned vector maximum parameter structure.
srcPointer to the source data vector.
maxPointer to the maximum result vector of size one.
indexPointer to the index result vector of size one.
Returns
Status of the operation.
msp_status msp_max_uq31 ( const msp_max_uq31_params params,
const _uq31 src,
_uq31 max,
uint16_t *  index 
)

Unsigned maximum of a source vector.

Details
This function returns the 32-bit unsigned maximum value and corresponding index of a single source vector.
Pseudo code
dst = MAX(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 unsigned vector maximum parameter structure.
srcPointer to the source data vector.
maxPointer to the maximum result vector of size one.
indexPointer to the index result vector of size one.
Returns
Status of the operation.
msp_status msp_min_iq31 ( const msp_min_iq31_params params,
const _iq31 src,
_iq31 min,
uint16_t *  index 
)

Signed minimum of a source vector.

Details
This function returns the 32-bit signed minimum value and corresponding index of a single source vector.
Pseudo code
dst = MIN(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 signed vector minimum parameter structure.
srcPointer to the source data vector.
minPointer to the minimum result vector of size one.
indexPointer to the index result vector of size one.
Returns
Status of the operation.
msp_status msp_min_q15 ( const msp_min_q15_params params,
const _q15 src,
_q15 min,
uint16_t *  index 
)

Signed minimum of a source vector.

Details
This function returns the 16-bit signed minimum value and corresponding index of a single source vector.
Pseudo code
dst = MIN(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 signed vector minimum parameter structure.
srcPointer to the source data vector.
minPointer to the minimum result vector of size one.
indexPointer to the index result vector of size one.
Returns
Status of the operation.
msp_status msp_min_uq15 ( const msp_min_uq15_params params,
const _uq15 src,
_uq15 min,
uint16_t *  index 
)

Unsigned minimum of a source vector.

Details
This function returns the 16-bit unsigned minimum value and corresponding index of a single source vector.
Pseudo code
dst = MIN(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 unsigned vector minimum parameter structure.
srcPointer to the source data vector.
minPointer to the minimum result vector of size one.
indexPointer to the index result vector of size one.
Returns
Status of the operation.
msp_status msp_min_uq31 ( const msp_min_uq31_params params,
const _uq31 src,
_uq31 min,
uint16_t *  index 
)

Unsigned minimum of a source vector.

Details
This function returns the 32-bit unsigned minimum value and corresponding index of a single source vector.
Pseudo code
dst = MIN(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 unsigned vector minimum parameter structure.
srcPointer to the source data vector.
minPointer to the minimum result vector of size one.
indexPointer to the index result vector of size one.
Returns
Status of the operation.
msp_status msp_mpy_iq31 ( const msp_mpy_iq31_params params,
const _iq31 srcA,
const _iq31 srcB,
_iq31 dst 
)

Multiplication of two real source vectors.

Details
Element-wise IQ31 multiplication of two real source vectors without saturation. This function supports in-place operation.
Pseudo code
dst = srcA .* 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 vector multiply parameter structure.
srcAPointer to the first source data vector.
srcBPointer to the second source data vector.
dstPointer to the destination data vector.
Returns
Status of the operation.
Examples:
transform_ex3_fft_iq31.c.
msp_status msp_mpy_q15 ( const msp_mpy_q15_params params,
const _q15 srcA,
const _q15 srcB,
_q15 dst 
)

Multiplication of two real source vectors.

Details
Element-wise Q15 multiplication of two real source vectors without saturation. This function supports in-place operation.
Pseudo code
dst = srcA .* 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 vector multiply parameter structure.
srcAPointer to the first source data vector.
srcBPointer to the second source data vector.
dstPointer to the destination data vector.
Returns
Status of the operation.
Examples:
transform_ex1_fft_fixed_q15.c.
msp_status msp_neg_iq31 ( const msp_neg_iq31_params params,
const _iq31 src,
_iq31 dst 
)

Negation of a source vector.

Details
Element-wise IQ31 multiplication by negative one with a real source vector. This function supports in-place operation.
Pseudo code
dst = -1 * 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 vector negate parameter structure.
srcPointer to the source data vector.
dstPointer to the destination data vector.
Returns
Status of the operation.
msp_status msp_neg_q15 ( const msp_neg_q15_params params,
const _q15 src,
_q15 dst 
)

Negation of a source vector.

Details
Element-wise Q15 multiplication by negative one with a real source vector. This function supports in-place operation.
Pseudo code
dst = -1 * 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 vector negate parameter structure.
srcPointer to the source data vector.
dstPointer to the destination data vector.
Returns
Status of the operation.
msp_status msp_offset_iq31 ( const msp_offset_iq31_params params,
const _iq31 src,
_iq31 dst 
)

Constant offset of a real source vector.

Details
Element-wise IQ31 addition with saturation of a single source vector with a IQ31 constant. This function supports in-place operation.
Pseudo code
dst = src + offset
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 vector offset parameter structure.
srcPointer to the source data vector.
dstPointer to the destination data vector.
Returns
Status of the operation.
msp_status msp_offset_q15 ( const msp_offset_q15_params params,
const _q15 src,
_q15 dst 
)

Constant offset of a real source vector.

Details
Element-wise Q15 addition with saturation of a single source vector with a Q15 constant. This function supports in-place operation.
Pseudo code
dst = src + offset
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 vector offset parameter structure.
srcPointer to the source data vector.
dstPointer to the destination data vector.
Returns
Status of the operation.
msp_status msp_scale_iq31 ( const msp_scale_iq31_params params,
const _iq31 src,
_iq31 dst 
)

Scale a real source vector.

Details
Element-wise scaling of a real 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 vector scale structure. The bitwise shift value must be >=0.
srcPointer to the source data vector.
dstPointer to the destination data vector.
Returns
Status of the operation.
msp_status msp_scale_q15 ( const msp_scale_q15_params params,
const _q15 src,
_q15 dst 
)

Scale a real source vector.

Details
Element-wise scaling of a real 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 vector scale structure. The bitwise shift value must be >=0.
srcPointer to the source data vector.
dstPointer to the destination data vector.
Returns
Status of the operation.
msp_status msp_shift_iq31 ( const msp_shift_iq31_params params,
const _iq31 src,
_iq31 dst 
)

Bitwise shift of a real source vector.

Details
Element-wise bitwise shift of a real 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 vector shift parameter structure.
srcPointer to the source data vector.
dstPointer to the destination data vector.
Returns
Status of the operation.
Examples:
transform_ex3_fft_iq31.c.
msp_status msp_shift_q15 ( const msp_shift_q15_params params,
const _q15 src,
_q15 dst 
)

Bitwise shift of a real source vector.

Details
Element-wise bitwise shift of a real 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 vector shift parameter structure.
srcPointer to the source data vector.
dstPointer to the destination data vector.
Returns
Status of the operation.
msp_status msp_sub_iq31 ( const msp_sub_iq31_params params,
const _iq31 srcA,
const _iq31 srcB,
_iq31 dst 
)

Subtraction of two real source vectors.

Details
Element-wise IQ31 subtraction of two real vectors with saturation. This function supports in-place operations.
Pseudo code
dst = srcA - 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 vector add parameter structure.
srcAPointer to the first source data vector.
srcBPointer to the second source data vector.
dstPointer to the destination data vector.
Returns
Status of the operation.
msp_status msp_sub_q15 ( const msp_sub_q15_params params,
const _q15 srcA,
const _q15 srcB,
_q15 dst 
)

Subtraction of two real source vectors.

Details
Element-wise Q15 subtraction of two real vectors with saturation. This function supports in-place operations.
Pseudo code
dst = srcA - 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 vector add parameter structure.
srcAPointer to the first source data vector.
srcBPointer to the second source data vector.
dstPointer to the destination data vector.
Returns
Status of the operation.
Examples:
transform_ex1_fft_fixed_q15.c, transform_ex2_cmplx_fft_auto_q15.c, and transform_ex3_fft_iq31.c.