08-10-2013 09:44 AM
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.
Solved! Go to Solution.
08-12-2013
08:10 AM
- last edited on
04-15-2025
04:15 PM
by
Content Cleaner
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
08-12-2013 12:21 PM
Paul - did you miss that the poster asked specifically for a VI that runs on FPGA? The toolkit you mentioned does not.
08-12-2013 01:06 PM
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".
08-13-2013 11:53 AM
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
08-13-2013 06:24 PM
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.