CSI-DSP  Version 1.0.0
CSI DSP Software Library
Functions
Complex Matrix Multiplication

Functions

void csky_dsp_lib_mat_cx_mult_q15 (cq15_t *A, cq15_t *B, uint32 N, uint32 M, uint32 L, cq15_t *C)
 Q15 complex Matrix multiplication. More...
 
void csky_dsp_lib_mat_cx_mul_q31 (cq31_t *A, cq31_t *B, uint32 N, uint32 M, uint32 L, cq31_t *C)
 Q31 complex Matrix multiplication. More...
 

Description

Complex Mtatrix Multiplication is only defined if the number of columns of the first matrix equals the number if rowds of the second. In this function, the format of matrix a is N*M, and the format of matrix b is M*L, so, the output format is N*L. And the data in all the three matrices is stored in an interleaved fashion(real, imag, real, imag,...), which is support for q15 and q31 format.

Function Documentation

void csky_dsp_lib_mat_cx_mul_q31 ( cq31_t A,
cq31_t B,
uint32  N,
uint32  M,
uint32  L,
cq31_t C 
)
Parameters
[in]*Apoints to the input buffer a
[in]*Bpoints to the input buffer b
[in]Nthe number of rows of matrix a and c
[in]Mthe number of colums of matrix a and the number of rows of matrix b
[in]Lthe number of colums of matrix b and c
[out]*Cpoints to the output buffer
Returns
none

Scaling and Overflow Behavior:

64 bit arithmetic is used throughout this function. when two Q31 numbers are multiplied together, the resulting Q62 bit number is added to the Q63 accumulator. So, only one guard bit. Finally, the result will be shifted to right in 31 bits and saturated. The output value is in the range of [0x800000000, 0x7FFFFFFF].
Note
As mentioned before, there is only one guard bit in this function. So, care to used it to avoid overflow.
void csky_dsp_lib_mat_cx_mult_q15 ( cq15_t A,
cq15_t B,
uint32  N,
uint32  M,
uint32  L,
cq15_t C 
)
Parameters
[in]*Apoints to the input buffer a
[in]*Bpoints to the input buffer b
[in]Nthe number of rows of matrix a and c
[in]Mthe number of colums of matrix a and the number of rows of matrix b
[in]Lthe number of colums of matrix b and c
[out]*Cpoints to the output buffer
Returns
none

Scaling and Overflow Behavior:

64 bit arithmetic is used throughout this function. when two Q15 numbers are multiplied together, the resulting Q30 bit number is added to the Q63 accumulator. The approach provieds 33 guard bits and there is no risk of overflow. Finally, the result will be truncated the low 15 bits and then saturated to Q15 format. so the output value is in the range of [0x8000, 0x7FFF].