Hi,
I've been working on a C6672 DSP, and I've recently come across a problem regarding a DSPLIB (3.4.0.0) library function, namely "DSPF_sp_qrd", which takes a real single-precision floating-point matrix as input and decomposes it into an orthogonal matrix, Q, and an upper-triangular matrix, R. Although it yields acceptable results most of the time, I'm experiencing rather poor accuracy for certain matrices. Take the following matrix, for instance:
A =
[ 2.1945 -0.0050 -0.0000 0.0000 ]
[ -0.0050 1.0758 -0.0007 0.0000 ]
[ -0.0000 -0.0004 1.2757 -0.0002 ]
[ 0.0000 0.0000 -0.0001 -0.1320 ]
(These might not reflect the exact numbers I have due to being rounded to 4 decimal places, but you should get the idea.)
When I decompose this matrix, I get the following Q and R:
Q =
[ 1.0000 -0.0023 -0.0000 -0.0000 ]
[ -0.0023 -1.0180 -0.0003 -0.0000 ]
[ -0.0000 0.0003 -0.0778 -0.0001 ]
[ 0.0000 -0.0000 0.0010 -0.9772 ]
R =
[ 2.1945 -0.0075 -0.0000 0.0000 ]
[ 0.0000 -1.0951 0.0012 -0.0000 ]
[ 0.0000 0.0000 -0.0993 -0.0001 ]
[ 0.0000 0.0000 0.0000 0.1290 ]
I noticed that the results are incorrect because when I multiply Q and R, the result is nowhere near the original matrix. Also, Q is clearly not an orthogonal matrix; the third column gives it away. I also tested this on the C equivalent function "DSPF_sp_qrd_cn" (using GCC on my PC instead of C6672), but it gave the same results as well.
Could I be missing something? Or might the function have a restriction to its inputs that is not documented in the API reference?
Thanks in advance.