Logo
MSP DSP Library
Real Matrix

Data Structures

struct  msp_matrix_add_q15_params
 Parameter structure for the matrix add function. More...
 
struct  msp_matrix_add_iq31_params
 Parameter structure for the matrix add function. More...
 
struct  msp_matrix_sub_q15_params
 Parameter structure for the matrix subtract function. More...
 
struct  msp_matrix_sub_iq31_params
 Parameter structure for the matrix subtract function. More...
 
struct  msp_matrix_trans_q15_params
 Parameter structure for the matrix transpose function. More...
 
struct  msp_matrix_trans_iq31_params
 Parameter structure for the matrix transpose function. More...
 
struct  msp_matrix_mpy_q15_params
 Parameter structure for the real matrix multiply function. More...
 
struct  msp_matrix_mpy_iq31_params
 Parameter structure for the real matrix multiply function. More...
 
struct  msp_matrix_neg_q15_params
 Parameter structure for the real matrix negate function. More...
 
struct  msp_matrix_neg_iq31_params
 Parameter structure for the real matrix negate function. More...
 
struct  msp_matrix_abs_q15_params
 Parameter structure for the real matrix absolute value function. More...
 
struct  msp_matrix_abs_iq31_params
 Parameter structure for the real matrix absolute value function. More...
 
struct  msp_matrix_offset_q15_params
 Parameter structure for the real matrix offset function. More...
 
struct  msp_matrix_offset_iq31_params
 Parameter structure for the real matrix offset function. More...
 
struct  msp_matrix_scale_q15_params
 Parameter structure for the real matrix scale function. More...
 
struct  msp_matrix_scale_iq31_params
 Parameter structure for the real matrix scale function. More...
 
struct  msp_matrix_shift_q15_params
 Parameter structure for the real matrix shift function. More...
 
struct  msp_matrix_shift_iq31_params
 Parameter structure for the real matrix shift function. More...
 

Functions

msp_status msp_matrix_add_q15 (const msp_matrix_add_q15_params *params, const _q15 *srcA, const _q15 *srcB, _q15 *dst)
 Addition of two real source matrices. More...
 
msp_status msp_matrix_add_iq31 (const msp_matrix_add_iq31_params *params, const _iq31 *srcA, const _iq31 *srcB, _iq31 *dst)
 Addition of two real source matrices. More...
 
msp_status msp_matrix_sub_q15 (const msp_matrix_sub_q15_params *params, const _q15 *srcA, const _q15 *srcB, _q15 *dst)
 Subtraction of two real source matrices. More...
 
msp_status msp_matrix_sub_iq31 (const msp_matrix_sub_iq31_params *params, const _iq31 *srcA, const _iq31 *srcB, _iq31 *dst)
 Subtraction of two real source matrices. More...
 
msp_status msp_matrix_mpy_q15 (const msp_matrix_mpy_q15_params *params, const _q15 *srcA, const _q15 *srcB, _q15 *dst)
 Multiplication of two real source matrices. More...
 
msp_status msp_matrix_mpy_iq31 (const msp_matrix_mpy_iq31_params *params, const _iq31 *srcA, const _iq31 *srcB, _iq31 *dst)
 Multiplication of two real source matrices. More...
 
msp_status msp_matrix_trans_q15 (const msp_matrix_trans_q15_params *params, const _q15 *src, _q15 *dst)
 Transposition of a source matrix. More...
 
msp_status msp_matrix_trans_iq31 (const msp_matrix_trans_iq31_params *params, const _iq31 *src, _iq31 *dst)
 Transposition of a source matrix. More...
 
msp_status msp_matrix_neg_q15 (const msp_matrix_neg_q15_params *params, const _q15 *src, _q15 *dst)
 Negation of a source matrix. More...
 
msp_status msp_matrix_neg_iq31 (const msp_matrix_neg_iq31_params *params, const _iq31 *src, _iq31 *dst)
 Negation of a source matrix. More...
 
msp_status msp_matrix_abs_q15 (const msp_matrix_abs_q15_params *params, const _q15 *src, _q15 *dst)
 Absolute value of a real source matrix. More...
 
msp_status msp_matrix_abs_iq31 (const msp_matrix_abs_iq31_params *params, const _iq31 *src, _iq31 *dst)
 Absolute value of a real source matrix. More...
 
msp_status msp_matrix_offset_q15 (const msp_matrix_offset_q15_params *params, const _q15 *src, _q15 *dst)
 Constant offset of a real source matrix. More...
 
msp_status msp_matrix_offset_iq31 (const msp_matrix_offset_iq31_params *params, const _iq31 *src, _iq31 *dst)
 Constant offset of a real source matrix. More...
 
msp_status msp_matrix_scale_q15 (const msp_matrix_scale_q15_params *params, const _q15 *src, _q15 *dst)
 Scale a real source matrix. More...
 
msp_status msp_matrix_scale_iq31 (const msp_matrix_scale_iq31_params *params, const _iq31 *src, _iq31 *dst)
 Scale a real source matrix. More...
 
msp_status msp_matrix_shift_q15 (const msp_matrix_shift_q15_params *params, const _q15 *src, _q15 *dst)
 Bitwise shift of a real source matrix. More...
 
msp_status msp_matrix_shift_iq31 (const msp_matrix_shift_iq31_params *params, const _iq31 *src, _iq31 *dst)
 Bitwise shift of a real source matrix. More...
 

Detailed Description

Functions for performing matrix operations on real data.

Function Documentation

msp_status msp_matrix_abs_iq31 ( const msp_matrix_abs_iq31_params params,
const _iq31 src,
_iq31 dst 
)

Absolute value of a real source matrix.

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

Absolute value of a real source matrix.

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

Addition of two real source matrices.

Details
Element-wise IQ31 addition of two real matrices 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 matrix add parameter structure.
srcAPointer to the first source data matrix.
srcBPointer to the second source data matrix.
dstPointer to the destination data matrix.
Returns
Status of the operation.
msp_status msp_matrix_add_q15 ( const msp_matrix_add_q15_params params,
const _q15 srcA,
const _q15 srcB,
_q15 dst 
)

Addition of two real source matrices.

Details
Element-wise Q15 addition of two real matrices 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 matrix add parameter structure.
srcAPointer to the first source data matrix.
srcBPointer to the second source data matrix.
dstPointer to the destination data matrix.
Returns
Status of the operation.
Examples:
matrix_ex1_add_q15.c.
msp_status msp_matrix_mpy_iq31 ( const msp_matrix_mpy_iq31_params params,
const _iq31 srcA,
const _iq31 srcB,
_iq31 dst 
)

Multiplication of two real source matrices.

Details
Element-wise IQ31 multiplication of two real source matrices 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 matrix multiply parameter structure.
srcAPointer to the first source data matrix.
srcBPointer to the second source data matrix.
dstPointer to the destination data matrix.
Returns
Status of the operation.
msp_status msp_matrix_mpy_q15 ( const msp_matrix_mpy_q15_params params,
const _q15 srcA,
const _q15 srcB,
_q15 dst 
)

Multiplication of two real source matrices.

Details
Element-wise Q15 multiplication of two real source matrices 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 matrix multiply parameter structure.
srcAPointer to the first source data matrix.
srcBPointer to the second source data matrix.
dstPointer to the destination data matrix.
Returns
Status of the operation.
Examples:
matrix_ex3_mpy_q15.c.
msp_status msp_matrix_neg_iq31 ( const msp_matrix_neg_iq31_params params,
const _iq31 src,
_iq31 dst 
)

Negation of a source matrix.

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

Negation of a source matrix.

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

Constant offset of a real source matrix.

Details
Element-wise IQ31 addition with saturation of a single source matrix 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 matrix offset structure.
srcPointer to the source data matrix.
dstPointer to the destination data matrix.
Returns
Status of the operation.
msp_status msp_matrix_offset_q15 ( const msp_matrix_offset_q15_params params,
const _q15 src,
_q15 dst 
)

Constant offset of a real source matrix.

Details
Element-wise Q15 addition with saturation of a single source matrix 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 matrix offset structure.
srcPointer to the source data matrix.
dstPointer to the destination data matrix.
Returns
Status of the operation.
msp_status msp_matrix_scale_iq31 ( const msp_matrix_scale_iq31_params params,
const _iq31 src,
_iq31 dst 
)

Scale a real source matrix.

Details
Element-wise scaling of a real matrix. 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 matrix scale structure.
srcPointer to the source data matrix.
dstPointer to the destination data matrix.
Returns
Status of the operation.
msp_status msp_matrix_scale_q15 ( const msp_matrix_scale_q15_params params,
const _q15 src,
_q15 dst 
)

Scale a real source matrix.

Details
Element-wise scaling of a real matrix. 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 matrix scale structure.
srcPointer to the source data matrix.
dstPointer to the destination data matrix.
Returns
Status of the operation.
msp_status msp_matrix_shift_iq31 ( const msp_matrix_shift_iq31_params params,
const _iq31 src,
_iq31 dst 
)

Bitwise shift of a real source matrix.

Details
Element-wise bitwise shift of a real matrix 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 matrix shift structure.
srcPointer to the source data matrix.
dstPointer to the destination data matrix.
Returns
Status of the operation.
msp_status msp_matrix_shift_q15 ( const msp_matrix_shift_q15_params params,
const _q15 src,
_q15 dst 
)

Bitwise shift of a real source matrix.

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

Subtraction of two real source matrices.

Details
Element-wise IQ31 subtraction of two real matrices 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 matrix subtraction parameter structure.
srcAPointer to the first source data matrix.
srcBPointer to the second source data matrix.
dstPointer to the destination data matrix.
Returns
Status of the operation.
msp_status msp_matrix_sub_q15 ( const msp_matrix_sub_q15_params params,
const _q15 srcA,
const _q15 srcB,
_q15 dst 
)

Subtraction of two real source matrices.

Details
Element-wise Q15 subtraction of two real matrices 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 matrix subtraction parameter structure.
srcAPointer to the first source data matrix.
srcBPointer to the second source data matrix.
dstPointer to the destination data matrix.
Returns
Status of the operation.
msp_status msp_matrix_trans_iq31 ( const msp_matrix_trans_iq31_params params,
const _iq31 src,
_iq31 dst 
)

Transposition of a source matrix.

Details
Transposition of the source matrix. The resulting matrix will have same number of rows as the source does columns and the same number of columns as the source has rows. This function does not support in-place operations.
Pseudo code
dst = src'
LEA Support
This function is not currently supported by LEA.
Parameters
paramsPointer to the matrix transpose parameter structure.
srcPointer to the source data matrix.
dstPointer to the destination data matrix.
Returns
Status of the operation.
msp_status msp_matrix_trans_q15 ( const msp_matrix_trans_q15_params params,
const _q15 src,
_q15 dst 
)

Transposition of a source matrix.

Details
Transposition of the source matrix. The resulting matrix will have same number of rows as the source does columns and the same number of columns as the source has rows. This function does not support in-place operations.
Pseudo code
dst = src'
LEA Support
This function is not currently supported by LEA.
Parameters
paramsPointer to the matrix transpose parameter structure.
srcPointer to the source data matrix.
dstPointer to the destination data matrix.
Returns
Status of the operation.
Examples:
matrix_ex2_trans_q15.c.