rect to polar
Author Message
rect to polar

hi,

I already looked at the sites recommended in the FAQ of this newsgroup
but couldn't find any valuable hint. I have to convert two 12 bit
integers from rect to polar. I found already a good method for the
magnitude calculation, but i have no idea for calculating (or
estimating) the angle. Has anybody a hint for a good method, or even a
vhdl code example?

Thank you

heinz

Sent via Deja.com http://www.*-*-*.com/

Sun, 19 May 2002 03:00:00 GMT
rect to polar

Look into the CORDIC algorithm.  It will convert rectangular
to polar coordinates and give you both the magnitude
and the angle.  If you do a web search for CORDIC, you
should find some good information.

Frank

fcarst at worldnet.att.net

Quote:

>hi,
>I already looked at the sites recommended in the FAQ of this newsgroup
>but couldn't find any valuable hint. I have to convert two 12 bit
>integers from rect to polar. I found already a good method for the
>magnitude calculation, but i have no idea for calculating (or
>estimating) the angle. Has anybody a hint for a good method, or even a
>vhdl code example?
>Thank you
>heinz
>Sent via Deja.com http://www.deja.com/

Sun, 19 May 2002 03:00:00 GMT
rect to polar
It's actually pretty difficult to get your hands on free source code for
CORDIC. The following file contains an implementation in AHDL.

http://www.freecore.com/nosupport/sc.zip

If you know that language, you should be able to follow it and convert to

Ray Andraka also has information on his site at
http://users.ids.net/~randraka/.

Cheers,
Jamie

Quote:

> Look into the CORDIC algorithm.  It will convert rectangular
> to polar coordinates and give you both the magnitude
> and the angle.  If you do a web search for CORDIC, you
> should find some good information.

> >hi,

> >I already looked at the sites recommended in the FAQ of this newsgroup
> >but couldn't find any valuable hint. I have to convert two 12 bit
> >integers from rect to polar. I found already a good method for the
> >magnitude calculation, but i have no idea for calculating (or
> >estimating) the angle. Has anybody a hint for a good method, or even a
> >vhdl code example?

Sun, 19 May 2002 03:00:00 GMT
rect to polar
Here are the links that I have for the CORDIC algorithm:

Good description
http://www.math.utep.edu/Faculty/helmut/cordic/wcordic.html

Another description
http://www.ezcomm.com/~cyliax/Articles/RobNav/sidebar.html

C code
http://devil.ece.utexas.edu/code.html

Good luck!
Stephen

Sun, 19 May 2002 03:00:00 GMT
rect to polar

Quote:

> hi,

> I already looked at the sites recommended in the FAQ of this newsgroup
> but couldn't find any valuable hint. I have to convert two 12 bit
> integers from rect to polar. I found already a good method for the
> magnitude calculation, but i have no idea for calculating (or
> estimating) the angle. Has anybody a hint for a good method, or even a
> vhdl code example?

> Thank you

> heinz

> Sent via Deja.com http://www.deja.com/

for 12 bits numbers you can get away with a table based approach for the
atan function. The trick is using the symmetry properties calculating atan
on for 0 to pi/4.
This simplifies the division y/x to cases where y/x < 1 allowing you to
throw away digits above the radix mark. If you for instance use a 1024 by
10 bit table (fits a FPGA RAM block), you need only 10 bits of division
resolution and use the y,x sign bits and y<x criteria to recombine into a
13 bit angular resolution for 0 to 2pi.

Good luck!

Mon, 20 May 2002 03:00:00 GMT
rect to polar

Quote:

> hi,

> I already looked at the sites recommended in the FAQ of this newsgroup
> but couldn't find any valuable hint. I have to convert two 12 bit
> integers from rect to polar. I found already a good method for the
> magnitude calculation, but i have no idea for calculating (or
> estimating) the angle. Has anybody a hint for a good method, or even a
> vhdl code example?

> Thank you

> heinz

> Sent via Deja.com http://www.deja.com/

Hi Heinz!

The CORDIC algorithm should be a good choise for you. We successfully
use a CORDIC at four different
places in a digital receiver that we are designing. The main benefits
compared to a table-based
algorithm is that it's scaleble both in width and deep. In our CORDIC
I've put generics for those two parameters as well as some others, such
as operation mode and architecture type. That makes it easy to re-use
and optimize it for different situations.

Unfortunalely, I can't give you the code because it's propriety
information. But the paper
http://users.ids.net/~randraka/files/crdcsrvy.pdf from Andraka
Consulting group is a very good

If you want a hint on how to code it in VHDL, take a look in the
ieee.math_pkg package where a non-synthesizable CORDIC is implemented.
The principals should be the same as with a synthesizable
version, just change the REAL arithmetic to SIGNED.

Regards,

// Mats

Mon, 20 May 2002 03:00:00 GMT
rect to polar
Hello Mats,

I guess what you need is the implementation of the arctan function in VHDL.
As you probably know the angle calculation is simple the arctan(dy/dx),
where dy = y2-y1 and dx = x2-x1. I guess, if the division can be implemented
considering the hardware cost, you can have a lookup table of the arctan
function depending on different dy/dx values (a dy/dx -> arctan mapping). If
you do generate the table for the first quadrant (or even octant) with a
certain resolution (eg .5 of a degree) then, depending on the orientation of
the line you can calculate it for the other quadrants (or octants - slightly
more complex) without to much extra hardware cost.

Another way would be to implement the arctan function in hardware (see books
of aplied mathematics) but I think this would be less cost effective
(although of higher accuracy).

There may be other ways of doing this but I am not aware of any such.

Best Regards,

Alex.

Quote:

> > hi,

> > I already looked at the sites recommended in the FAQ of this newsgroup
> > but couldn't find any valuable hint. I have to convert two 12 bit
> > integers from rect to polar. I found already a good method for the
> > magnitude calculation, but i have no idea for calculating (or
> > estimating) the angle. Has anybody a hint for a good method, or even a
> > vhdl code example?

> > Thank you

> > heinz

> > Sent via Deja.com http://www.deja.com/

> Hi Heinz!

> The CORDIC algorithm should be a good choise for you. We successfully
> use a CORDIC at four different
> places in a digital receiver that we are designing. The main benefits
> compared to a table-based
> algorithm is that it's scaleble both in width and deep. In our CORDIC
> I've put generics for those two parameters as well as some others, such
> as operation mode and architecture type. That makes it easy to re-use
> and optimize it for different situations.

> Unfortunalely, I can't give you the code because it's propriety
> information. But the paper
> http://users.ids.net/~randraka/files/crdcsrvy.pdf from Andraka
> Consulting group is a very good

> If you want a hint on how to code it in VHDL, take a look in the
> ieee.math_pkg package where a non-synthesizable CORDIC is implemented.
> The principals should be the same as with a synthesizable
> version, just change the REAL arithmetic to SIGNED.

> Regards,

> // Mats

Mon, 20 May 2002 03:00:00 GMT
rect to polar
Oh no it isnt' ... take a look at www.frontierd.com and go to the download
area.
You have C, VHDL and Verilog there....

Dirk

Quote:

> It's actually pretty difficult to get your hands on free source code for
> CORDIC. The following file contains an implementation in AHDL.

> http://www.freecore.com/nosupport/sc.zip

> If you know that language, you should be able to follow it and convert to

> Ray Andraka also has information on his site at
> http://users.ids.net/~randraka/.

> Cheers,
> Jamie

> > Look into the CORDIC algorithm.  It will convert rectangular
> > to polar coordinates and give you both the magnitude
> > and the angle.  If you do a web search for CORDIC, you
> > should find some good information.

> > >hi,

> > >I already looked at the sites recommended in the FAQ of this newsgroup
> > >but couldn't find any valuable hint. I have to convert two 12 bit
> > >integers from rect to polar. I found already a good method for the
> > >magnitude calculation, but i have no idea for calculating (or
> > >estimating) the angle. Has anybody a hint for a good method, or even a
> > >vhdl code example?

Thu, 23 May 2002 03:00:00 GMT

 Page 1 of 1 [ 8 post ]

Relevant Pages
 11. polar plot