'base 10 log (with square root)'
I would now have to ask how are you taking the square root. I haven't
put much thought to this, but I would think that a square root is as
hard to do as a base 10 log
______________________________ Reply Separator _________________________________
Subject: base 10 log
Author: pic microcontroller discussion list <MITVMA.MIT.EDU> PICLIST
pic microco at INTERNET-GATEWAY
Date: 5/29/96 4:00 PM
eryone's help. I found a pretty easy way to find the log10.
I'll just going to scale the numbers to between 0 and 1/2 (the spec has
changed since my first post). Then use 3.33*(sqrt(sqrt(x))-3 That should
be just enough accuracy, considering that I am only dealing with four
Studio Sound Design
> I would now have to ask how are you taking the square root. I haven't
> put much thought to this, but I would think that a square root is as
> hard to do as a base 10 log
In calculus I learn something called Newton's method where I can just make
an educated guess (say 0.5) and follow his method until the answer converges
at the square root, say after 5 iterations. I guess I should just get a
good DSP book one of these days so I don't have to remember all this
mathematical messy stuff.
Studio Sound Design
|Stuart Allman <MITVMA.MIT.EDU> wrote: PICLIST
> In calculus I learn something called Newton's method where I can
> just make an educated guess (say 0.5) and follow his method until
> the answer converges at the square root, say after 5 iterations.
The Newton-Raphson Method is horribly inefficient... Its one benefit
is that it's simple enough that you can use it to perform square-root
calculations in your head. A (really bad) implementation is in one
of Microchip's math appnotes.
By the way, 5 iterations isn't enough for a 16-bit number; if you
treat the number as an integer in the range [0-65535] and use a
starting approximation of 2 (as Microchip's appnote does), you need
11 iterations. I once calculated the best -- that is, the
quickest-converging -- starting approximation; for 16-bit numbers, I
think it was 181.
I have in front of me a 16-bit square-root routine that takes only
126 cycles to execute on a PIC16C5x. It's pretty amazing; when I
received it, I offered its author a job. Unfortunately, he lives in
Germany, so he wasn't interested...
Anyway, he hasn't given me permission to publish it, so I can't post
the routine here. However, the knowledge that such a solution exists
should be enough to prod someone into trying to duplicate it.
Andrew Warren - ix.netcom.comfastfwd
Fast Forward Engineering, Vista, California
More... (looser matching)
- Last day of these posts
- In 1996
, 1997 only
- New search...