Description
Algorithm
c1
Number of columns in matrix x. Also number of rows in
matrix y.
y[2*c1*c2]
Input matrix containing c1*c2 complex floating-point
numbers having c1 rows and c2 columns of complex
numbers.
c2
Number of columns in matrix y.
r[2*r1*c2]
Output matrix of c1*c2 complex floating-point numbers
having c1 rows and c2 columns of complex numbers.
Complex numbers are stored consecutively with real values
are stored in even word positions and imaginary values in
odd positions.
This function computes the expression "r = x * y" for the matrices x and y. The
columnar dimension of x must match the row dimension of y. The resulting ma-
trix has the same number of rows as x and the same number of columns as
y. Each element of Matrices are assumed to be complex numbers with real val-
ues are stored in even word positions and imaginary values in odd positions.
This is the C equivalent of the assembly code. Note that the assembly code
is hand optimized and restrictions may apply.
void DSPF_sp_mat_mul_cplx(const float* x, int r1, int c1,
const float* y, int c2, float* restrict r)
{
float real, imag;
int i, j, k;
for(i = 0; i < r1; i++)
{
for(j = 0; j < c2; j++)
{
real=0;
imag=0;
for(k = 0; k < c1; k++)
{
real += (x[i*2*c1 + 2*k]*y[k*2*c2 + 2*j]
-x[i*2*c1 + 2*k + 1] * y[k*2*c2 + 2*j + 1]);
imag+=(x[i*2*c1 + 2*k] * y[k*2*c2 + 2*j + 1]
+ x[i*2*c1 + 2*k + 1] * y[k*2*c2 + 2*j]);
}
DSPF_sp_mat_mul_cplx
DSPLIB Reference
4-67
Need help?
Do you have a question about the TMS320C67 DSP Series and is the answer not in the manual?
Questions and answers