- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi everyone,

I'm building a range finding system and i'm trying to build an I/Q demodulator in order to get the phase of an input signal. I'm using an Cyclone III FPGA on a developement Kit. In order to get the phase, the I- and Q-components have to be divided and I want to use the floating point atan Megafunction (altfp_atan) to calculate the arctan of the Q/I quotient. Which is way more convenient than using a large LUT with interpolation or CORDIC... Unfortunately the output of the atan megafunction is always ZERO no matter what input signal I apply to the atan megafunction block. I've tried already a lot of things, but nothing worked. Still zero at the output at all times. :confused: Does anybody know what i'm doing wrong or has the same problem? Really appreciate your help!Link Copied

7 Replies

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

have you taken a look to see if there is an example of the atan function in the design examples?

http://www.altera.com/literature/ug/floating-point%20megafunctions%20design%20examples.zip- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I use this Floating Point atan Megafunction in Modelsim to simulate.

I am entering float point format(IEEE 754 ) for data port and also have clock but still no signal. The result port still "zzzzzzzzzzzzzzzz" I don't know how to use this function. Have some one use this function can work. If you can . Please tell me. Maybe we can discuss together.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Not directly related to the atan() issue, but you could use the Goetzel generator to generate your sin (& cos) - uses the two previous values and a single multiply + add to get the next term. That would make it easier to change the frequency. Might just be a logic v memory tradeoff.

The atan() function will just be expanding one of the power series, if you have bounds on the input and desired accuracy it might be worth doing it yourself - when you can probably do it all as fixed point.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I found, that the altfp_atan has a bug in Quartus V11.0, that clk_en erroneously defaults to '0'. So if you don't use and enable the clk_en port in the MegaFunction instance, the atan function is disabled.

I agree however with dsl, that it seems more appropriate to write a fixed point implementation, due to the huge resource consumption of the float version.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

FvM Thanks for reply it is working!!!!!!!!:)

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page