LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

arctan2 high throughput function output range restricted to (-pi/4, pi/4)

Hello guys

 

Now I am using arctan2 function in FPGA VI, the result is the output range of it is restricted to (-pi/4,pi/4). However, I think the full range of this function should be (-pi.pi). Is there anyway to solve it?

 

Thanks

0 Kudos
Message 1 of 8
(3,372 Views)

My test (not on FPGA) seems to generate values between -pi/2 and pi/2. The help does say it should give values between -pi and pi though...

0 Kudos
Message 2 of 8
(3,349 Views)

Nevermind, I generated the full range of values, just had to give x a negative value to get to the II and III quadrants.

0 Kudos
Message 3 of 8
(3,344 Views)

I know what you mean, but things on fpga side just becomes weird, this arctan2 on FPGA side is based on cordic.

The data I sent to the arctan2 on fpga side is the sampled points of sine wave. I attached the screenshot of my code. The weird thing is if I set the input valid port to be true only if x and y is greater than 0, than the output of the arctan 2 is (0,pi/2).

So it seems this arctan2 can output more than (pi/4). So based on this, if input valid is set to constant true, output should reach the whole domain (-pi,pi). But actually not.

arctan2.PNG

0 Kudos
Message 4 of 8
(3,330 Views)

I'm not sure what data your analog input is feeding into it, but you may not be exercising the full inputs. The function will take into account the sign of the arguments (even if the argument is zero). For example, y = 0; x = 1 -> 0. y = 0; x = -1 -> pi.

0 Kudos
Message 5 of 8
(3,319 Views)

I made a stupid mistake, now I know the reason. 

 

Thanks....

0 Kudos
Message 6 of 8
(3,311 Views)

@zyb1003 wrote:

I made a stupid mistake, now I know the reason. 

 

Thanks....


You'd be surprised at how NOT stupid your mistake could be.  Unless it was something like "I forgot to wire the inputs", it would be worth posting your solution.  The probability is high that someone else could benefit from your experience.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 8
(3,287 Views)

yes. The truth is the output array is groups made of 4 different values, the (-pi/4, pi/4) is the range of the mean of the array.

0 Kudos
Message 8 of 8
(3,280 Views)