Skip to main content
Kuikui
Associate III
May 31, 2011
Question

Fixed point library

  • May 31, 2011
  • 4 replies
  • 2172 views
Posted on May 31, 2011 at 11:10

Hi all,

In my project, I am using a GPS to measure some distances, and some angles combined with a magnetometer.

Therefore, I have to do a lot of floating point operations. It's dirty, it's slow, and it's taking a lot of memory.

Does anybody has already used any fixed point library ?

Can't find anything ''usefull'' with google, I wonder why ... :\

Thanks for help.

Best regards,

VDM.

    This topic has been closed for replies.

    4 replies

    Andrew Neil
    Super User
    May 31, 2011
    Posted on May 31, 2011 at 13:30

    ''Can't find anything ''usefull'' with google''

     

     

    Have you tried

    http://codesearch.google.com/

    - it's specifically for finding open-source code...

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Kuikui
    KuikuiAuthor
    Associate III
    May 31, 2011
    Posted on May 31, 2011 at 16:51

    I found this :

    http://code.google.com/p/fixpointlib/

    Andrew Neil
    Super User
    May 31, 2011
    Posted on May 31, 2011 at 17:11

    It even has test results for an STM32!

    :)

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Tesla DeLorean
    Guru
    May 31, 2011
    Posted on June 01, 2011 at 00:03

    There also code Ivan Mellen has provided. Including a quite slick square root function.

    http://www.embeddedsignals.com/

    Fixed point (16:16, or whatever) is pretty basic stuff. You do however need to be careful about the precision you want, and keeping the numbers, or intermediates, in range. Even if you use someone else's library, you'd better have a very clear idea of the math, and test it throughly. At least floating point is relatively elastic.

    It's certainly possible to handle some GPS stuff in integer math, especially if you have units like centimeters, and are doing relative measurements. The geoid/squashed ellipsoid representation of latitude/longitude might be a lot of fun though.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..