1
$\begingroup$

I want to invert a $6 \times 6$ complex matrix on the ARM Cortex M4F processor. I have the C code to invert a real matrix using the CMSIS library. Has anyone written a similar C code for complex matrices? Can the CMSIS library be used to do complex matrix multiplications?

$\endgroup$
1

2 Answers 2

2
$\begingroup$

If you have a library for real-valued inversion you can expand your matrix (A) from 6x6 complex to be a 12x12 real-valued matrix (B) using

B=[ Real(A)   -Imag(A); 
    Imag(A)    Real(A)]

Once you have the inverse you can convert back to complex accordingly.

$\endgroup$
3
  • $\begingroup$ This worked. Thanks a lot! $\endgroup$ Commented Aug 31, 2022 at 2:41
  • $\begingroup$ Is there a way this can be optimized? I have to calculate the inverse of the entire 12x12 matrix. Instead is there a method wherein we can calculate the inverse of half of the matrix instead? $\endgroup$ Commented Sep 8, 2022 at 8:42
  • 1
    $\begingroup$ Unfortunately, there are not short-cuts for this. The complexity of inverting a 6x6 complex-valued matrix is the same as the complexity of a 12x12 real-valued matrix. $\endgroup$
    – Harris
    Commented Sep 18, 2022 at 12:02
1
$\begingroup$

I’m not sure it’s as specific as you need it, but Dave Stewart wrote the Meschach library that includes zm_inverse() which takes the inverse of a complex matrix.

All of it is written in C and the source code is freely available.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.