Technical discussions related to Audio Signal Processing (digital effects, acoustics, noise reduction, musical signal processing, etc).
HI , YOu can just follow the Newton Raphson implementation . Just use a small look up and you will be able to do it in 3 iterations. The equation is x(n+1) = x(n)(3-a*x(n)^2)*0.5 where x(n) is your initial value and a is your value that you want to determine the inverse sqrt. Implement it in flaoting point and convert it fixed pint by scaling it suitably and take care of overflows/saturation in the fixed multiplication. it should give u an error of +/- 1/2 or 1 LSB error . that should be fine. Bob
There is another Newton-Raphson method that does not require the inverse. I don't remember the details but I have used it. It works with fixed point implementations. I think there is a comp.dsp trick on this at dspguru . As I recall, the trick as published, has a little mistake (maybe a wrong sign?). Its been many years since I looked at this since almost all of our work is SHARC where the Newton-Raphson method is supported by a special instruction and is very easy to implement. I would explore this approach, but remember, everything I just told you comes from memory. Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com At 01:11 PM 9/27/2005, b_paulraj@b_pa... wrote: >HI , > YOu can just follow the Newton Raphson implementation . Just use a small > look up and you will be able to do it in 3 iterations. >The equation is x(n+1) = x(n)(3-a*x(n)^2)*0.5 >where x(n) is your initial value and a is your value that you want to >determine the inverse sqrt. >Implement it in flaoting point and convert it fixed pint by scaling it >suitably and take care of overflows/saturation in the fixed multiplication. >it should give u an error of +/- 1/2 or 1 LSB error . >that should be fine. >Bob > > > > >
Thanx Clark. The method is (1/sqrt(x))*x = sqrt(x). But is there a suitable method for determining the seed for NR method in 1/sqrt(x) to have 2/3 iterationsfor 16 bit fixed point numbers. I have used look up tables. regards Bob --- Al Clark <aclark@acla...> wrote: > There is another Newton-Raphson method that does not > require the inverse. I > don't remember the details but I have used it. It > works with fixed point > implementations. I think there is a comp.dsp trick > on this at dspguru . As > I recall, the trick as published, has a little > mistake (maybe a wrong > sign?). Its been many years since I looked at this > since almost all of our > work is SHARC where the Newton-Raphson method is > supported by a special > instruction and is very easy to implement. > > I would explore this approach, but remember, > everything I just told you > comes from memory. > > > Al Clark > Danville Signal Processing, Inc. > -------------------------------------------------------------------- > Purveyors of Fine DSP Hardware and other Cool Stuff > Available at http://www.danvillesignal.com > > > > > > > > > > > At 01:11 PM 9/27/2005, b_paulraj@b_pa... wrote: > >HI , > > YOu can just follow the Newton Raphson > implementation . Just use a small > > look up and you will be able to do it in 3 > iterations. > >The equation is x(n+1) = x(n)(3-a*x(n)^2)*0.5 > >where x(n) is your initial value and a is your > value that you want to > >determine the inverse sqrt. > >Implement it in flaoting point and convert it fixed > pint by scaling it > >suitably and take care of overflows/saturation in > the fixed multiplication. > >it should give u an error of +/- 1/2 or 1 LSB error > . > >that should be fine. > >Bob > > > > > > > > > > > > > > >