2

** Edited **

I tried changing the mentioned Jacobi algorithm to fixed point using libfixmath but I am not getting right results. What did I miss??

edited Jacobi code

makefile


C newbie here. I somehow got my self in the deep and i cant find my way out. If you could help that would be awesome!

The situation: I am trying to implement an ICA algorithm in C. I did so using floating point arithmetic (double, float). Now I want this code to transform it to fixed point so I can import it on an ARM microcontroller of 32 bits (thats why i cant use double, float etc).

I have found four libraries that I think can help me:

  1. http:// sourceforge.net/projects/avrfix/files/
  2. http:// www.dsprelated.com/showcode/40.php
  3. http:// sourceforge.net/p/fixedptc/code/ci/default/tree/
  4. libfixmath

I didnt use 1. 2. or 3. I am currently trying libfixmath because allmost all calculations are done with matrices.

My problem is when trying to find the eigenvalues and eigenvectors of a covariance matrix (positive symmetic 3x3 matrix). I searched around for libs or functions that do eigendecomposition or SVD etc. but i didnt find anything.

How to you do that sort of calculation in fixed point?? Are there any functions/libs that i didnt find out? Do I have to alter the eigen function that I have in floating-point (line by line converting to fixed point - i.e fix16_from_dbl() )?

My current eigen function (not mine of course i think it is from Numerical Recipes)

jacobi.h

Other relevant question: Here's StackOverflow fixed SVD

****Is my first question if there is anything to correct in my question please say so....dont eat me alive! :)

** Edited **

libfixmath does Cholesky1, wiki2 and QR decomposition.

I tried to play with maths and produce the eigenvectors or eigenvalue of a matrix with this data (data from the above functions) but I failed.

If anyone knows how to do that then problem solved.

*Should I post it to math stack website?

1 http:// rosettacode.org/wiki/Cholesky_decomposition

2 http:// en.wikipedia.org/wiki/Cholesky_decomposition#The_Cholesky.E2.80.93Banachiewicz_and_Cholesky.E2.80.93Crout_algorithms

Community
  • 1
  • 1
Franx
  • 87
  • 1
  • 10

1 Answers1

1

How about the GNU Scientific Library? It has a number of functions related to eigenvalue decomposition

You could use something like IQMath in order to convert from floating-point to fixed-point. There are also a number of answers for a similar question here

Community
  • 1
  • 1
logc
  • 3,813
  • 1
  • 18
  • 29
  • Maybe i didnt see something right but does GSL have functions for fixed point math/operations? As I saw from your proposed **gsl_eigen.h** everything is declared as double. Isn't double a floating point type? – Franx Feb 16 '15 at 13:48
  • You are right. Let me expand a bit on other alternatives that might help you. – logc Feb 16 '15 at 13:57
  • IQMath is truly a useful tool. But in this point is giving me nothing more in this simple program of mine (i think) than the other libraries that I mentioned. – Franx Feb 23 '15 at 17:12