Re: Simple/Fast Algorithm for binary logarithm in C (on ARM7)





Tilmann Reh wrote:

in a current ARM7 project I need to do some calculations which include a
logarithm. All other math is done with integers (i.e. fixed point
arithmetic), and I would like to calculate the log fast and with little
code - so I don't prefer using FP conversion and the standard math
libraries.

Can anyone point to fixed-point logarithmic routines I could use (resp.
tailor to my needs)?


It all depends on how accurate the log function should be. If you are fine with 10% accuracy, just count the insignificant bits and then do a simplest linear approximation.


Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

http://www.abvolt.com
.