From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Complex matrix inversion on FPGA

Solved!
Go to solution

Hi,

 

I am implementing a simple code on PXIe-7966R. I need a function that calculates the inversion of a complex matrix (fixed-point). I was wondering if there is an existing library that provides the function or I have to implementing it myself.

 

Please can someone enlighten me a little bit?

 

Thanks.

0 Kudos
Message 1 of 6
(4,119 Views)

Hi funki,

 

Thanks for posting.

There are a number of Matrix manipulation functions that come installed with the base version of LabVIEW, however Matrix math functions are not included in this. There is a toolkit that you can purchase that provides Matrix and Linear Algebra functions for use with LabVIEW called the "NI LabVIEW Multicore Analysis and Sparse Matrix Toolkit" which can be found here.

This includes the Inverse Matrix VI.

 

Best regards,

 

Paul

0 Kudos
Message 2 of 6
(4,081 Views)

Paul - did you miss that the poster asked specifically for a VI that runs on FPGA? The toolkit you mentioned does not.

Message 3 of 6
(4,066 Views)
Solution
Accepted by funki

I do not know of any existing librares for executing complex matrix inversions.

 

There a couple of ways I have used for developing own implenetations. Both methods involve decomposing the matrix A through rotation matricies.

1) QR decomposition through Givens rotations where A = QR. This method decomposes the original matrix into a unitary matrix Q and an upper triangular matrix R. The inverse of Q is simply its Hermetian transpose since it is unitary. The inverse of R can be solved for by back substitution. Multiplying the inverses of Q and R gives the inverse of A.

 

2) Use the signular value decompositon of A to get two unitary matricies U and V along with a diagonal matrix S of the signular components. Again, inverting the unitary matricies is just the Hermetian transpose. The inverse of the diagonal nmatrix involves just taking the reciprocal of the diagonal elements. The SVD can be performed using an algorithm known as the cyclic Jacobi method. This method is slightly more complicated than the QR decomposition since it requires an additional rotation matrix, but it avoids solving through back substition.

 

Both of these processes are iterative and converge to the exact solution as the number if iterations increases. Although the math can seem a little overwhelming at first, there is plenty of literature on these topics including different FPGA implementations. Just google "QR decomposition FPGA" or "Jacobi method FPGA".

Message 4 of 6
(4,060 Views)

Hi nathand,

 

Thanks for pointing this out - I completely breezed over the fact that the question was specifically about FPGA.

Of course, you are right, that toolkit is not supported on FPGA.

 

Paul

0 Kudos
Message 5 of 6
(4,043 Views)

Hi John,

 

In fact, I am implementing QR decomposition using Gram–Schmidt algorithm too and it sounds feasible to do matrix inversion with Q and R matrices. Thanks for the solution.

 

Thank Paul and Nathand for replying as well.

0 Kudos
Message 6 of 6
(4,023 Views)