DSPRelated.com
Forums

Cordic algorithm for atan in DSP processor

Started by praveen December 8, 2003
On 4 Jan 2004 20:36:54 -0800, praveenkumar1979@rediffmail.com
(praveen) wrote:

>Hello, > >If you write the cordic in C for atan . How much is the usual number of cycle >required????? > >waiting for reply >praveen
Hi, Some time ago I had what I think is the same question. If I understand the CORDIC algorithm properly, it seemed to me that to achieve no greater than 0.1 degree error you had to go through 11 itereations. I wonder if anyone can tell me if that's correct or not. Thanks, [-Rick-]
Depends on the required accuracy.  CORDIC angle accuracy improves by
approximately one bit per iteration.  Each iteration requires 2 shift-adds and a
third add of a constant.

praveen wrote:

> Hello, > > If you write the cordic in C for atan . How much is the usual number of cycle > required????? > > waiting for reply > praveen
-- --Ray Andraka, P.E. President, the Andraka Consulting Group, Inc. 401/884-7930 Fax 401/884-7950 email ray@andraka.com http://www.andraka.com "They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, 1759
Sounds about right.  THe worst case angular error after each iteration is the
rotation angle of that iteration (which happens if the previous iteration landed
exactly on your target angle), so the max error angle is atan(2^-i) after
iteration i.  Iterations start at 0.  The last iteration needed to get an error of
less than 0.1 degrees is therefore log2(tan(0.1)) rounded away from zero => 10,
and counting from 0 you have 11 iterations to complete not counting your angle
reduction.

Rick Lyons wrote:

> On 4 Jan 2004 20:36:54 -0800, praveenkumar1979@rediffmail.com > (praveen) wrote: > > >Hello, > > > >If you write the cordic in C for atan . How much is the usual number of cycle > >required????? > > > >waiting for reply > >praveen > > Hi, > Some time ago I had what I think is > the same question. If I understand the > CORDIC algorithm properly, it seemed to me that > to achieve no greater than 0.1 degree error > you had to go through 11 itereations. > > I wonder if anyone can tell me if that's > correct or not. > > Thanks, > [-Rick-]
-- --Ray Andraka, P.E. President, the Andraka Consulting Group, Inc. 401/884-7930 Fax 401/884-7950 email ray@andraka.com http://www.andraka.com "They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, 1759
On Thu, 08 Jan 2004 14:37:46 -0500, Ray Andraka <ray@andraka.com>
wrote:

>Sounds about right. THe worst case angular error after each iteration is the >rotation angle of that iteration (which happens if the previous iteration landed >exactly on your target angle), so the max error angle is atan(2^-i) after >iteration i. Iterations start at 0. The last iteration needed to get an error of >less than 0.1 degrees is therefore log2(tan(0.1)) rounded away from zero => 10, >and counting from 0 you have 11 iterations to complete not counting your angle >reduction.
Hi Ray, (hope all is well) Am glad to see that I wasn't too far off. Thanks bud, [-Rick-]
Yes, all is well.  I'm in the middle of a move, so things are a bit hectic at the
moment.  The new address, effective Monday is
Andraka Consulting Group, Inc
202 Torrie Lane
North Kingstown, RI 02852

Phones and emails remain the same.

Still haven't got too far on that book though...

Rick Lyons wrote:

> On Thu, 08 Jan 2004 14:37:46 -0500, Ray Andraka <ray@andraka.com> > wrote: > > >Sounds about right. THe worst case angular error after each iteration is the > >rotation angle of that iteration (which happens if the previous iteration landed > >exactly on your target angle), so the max error angle is atan(2^-i) after > >iteration i. Iterations start at 0. The last iteration needed to get an error of > >less than 0.1 degrees is therefore log2(tan(0.1)) rounded away from zero => 10, > >and counting from 0 you have 11 iterations to complete not counting your angle > >reduction. > > Hi Ray, (hope all is well) > Am glad to see that I wasn't too far off. > > Thanks bud, > [-Rick-]
-- --Ray Andraka, P.E. President, the Andraka Consulting Group, Inc. 401/884-7930 Fax 401/884-7950 email ray@andraka.com http://www.andraka.com "They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, 1759
On Fri, 09 Jan 2004 15:48:43 -0500, Ray Andraka <ray@andraka.com>
wrote:

>Yes, all is well. I'm in the middle of a move, so things are a bit hectic at the >moment. The new address, effective Monday is >Andraka Consulting Group, Inc >202 Torrie Lane >North Kingstown, RI 02852 > >Phones and emails remain the same. > >Still haven't got too far on that book though... >
Hi Ray, ha, good luck on the book. Half way through working on the 2nd edition of my book I went into the garage and threw a rope up over the beams and decided to hang myself. But the phone rang and I climbed down off the chair. :-) Writing a technical book is *NOT* for sissies. [-Rick-]
Oh, yeah I forgot to add that we are expecting #5 next month.  They tell us this one's
a boy too.

Rick Lyons wrote:

> On Fri, 09 Jan 2004 15:48:43 -0500, Ray Andraka <ray@andraka.com> > wrote: > > >Yes, all is well. I'm in the middle of a move, so things are a bit hectic at the > >moment. The new address, effective Monday is > >Andraka Consulting Group, Inc > >202 Torrie Lane > >North Kingstown, RI 02852 > > > >Phones and emails remain the same. > > > >Still haven't got too far on that book though... > > > > Hi Ray, > ha, good luck on the book. Half way > through working on the 2nd edition of my book > I went into the garage and threw a rope up over > the beams and decided to hang myself. > But the phone rang and I climbed down off > the chair. :-) > > Writing a technical book is *NOT* for sissies. > > [-Rick-]
-- --Ray Andraka, P.E. President, the Andraka Consulting Group, Inc. 401/884-7930 Fax 401/884-7950 email ray@andraka.com http://www.andraka.com "They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, 1759
On Fri, 09 Jan 2004 21:26:00 -0500, Ray Andraka <ray@andraka.com>
wrote:

>Oh, yeah I forgot to add that we are expecting #5 next month. They tell us this one's >a boy too. >
Five children! How 'bout that! Good for you. Whew, you're gonna be a busy guy. Actually, you've already been a "busy" guy. :-) :-) Hey Ray, maybe you could name your new son after one of your DSP pals here on comp.dsp. Regards & all the best to the wifey and baby, [-Rick-]
Ray Andraka wrote:

> Oh, yeah I forgot to add that we are expecting #5 next month. They tell us this one's > a boy too.
...
> --Ray Andraka, P.E. > President, the Andraka Consulting Group, Inc. > 401/884-7930 Fax 401/884-7950 > email ray@andraka.com > http://www.andraka.com > > "They that give up essential liberty to obtain a little > temporary safety deserve neither liberty nor safety." > -Benjamin Franklin, 1759
Congratulations! You passed us. We stopped at four, when we had a girl. Jerry -- "I view the progress of science as ... the slow erosion of the tendency to dichotomize." Barbara Smuts, U. Mich. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Our 4th is a girl, although I think she wishes she was a boy.  In a way, I feel sorry for
the poor lads that she dates when the time comes.

Jerry Avins wrote:

> Ray Andraka wrote: > > ? Oh, yeah I forgot to add that we are expecting #5 next month. They tell us this one's > ? a boy too. > > ... > > ? --Ray Andraka, P.E. > ? President, the Andraka Consulting Group, Inc. > ? 401/884-7930 Fax 401/884-7950 > ? email ray@andraka.com > ? http://www.andraka.com > ? > ? "They that give up essential liberty to obtain a little > ? temporary safety deserve neither liberty nor safety." > ? -Benjamin Franklin, 1759 > > Congratulations! You passed us. We stopped at four, when we had a girl. > > Jerry > -- > "I view the progress of science as ... the slow erosion of the > tendency to dichotomize." Barbara Smuts, U. Mich. > ?????????????????????????????????????????????????????????????????????
-- --Ray Andraka, P.E. President, the Andraka Consulting Group, Inc. 401/884-7930 Fax 401/884-7950 email ray@andraka.com http://www.andraka.com "They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, 1759