Go to Post Don't short change your drivers. They really need drive time. - Joe Johnson [more]
Home
Go Back   Chief Delphi > Technical > National Instruments LabVIEW and Data Acquisition
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-01-2012, 21:04
Betty Boop Betty Boop is offline
Registered User
no team
 
Join Date: Jan 2012
Location: Philippines
Posts: 14
Betty Boop is an unknown quantity at this point
(FPGA) high throughput inverse tangent 2 input

Hello! I would just like to ask what is the effect of having a 'negative x' on the high throughput inverse tangent (2 input)? It's because when I have 'negative y' (and 'positive x'), the answer is correct. However, whenever I have 'negative x' (regardless of the sign of y), the answer would always be wrong. Thank you for your time!
Reply With Quote
  #2   Spotlight this post!  
Unread 21-01-2012, 21:15
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: (FPGA) high throughput inverse tangent 2 input

Quote:
Originally Posted by Betty Boop View Post
Hello! I would just like to ask what is the effect of having a 'negative x' on the high throughput inverse tangent (2 input)? It's because when I have 'negative y' (and 'positive x'), the answer is correct. However, whenever I have 'negative x' (regardless of the sign of y), the answer would always be wrong.
Please give a specific (numerical) example of 2 inputs which gave a wrong output. Give the three numbers X, Y, output.

Reply With Quote
  #3   Spotlight this post!  
Unread 21-01-2012, 21:25
Betty Boop Betty Boop is offline
Registered User
no team
 
Join Date: Jan 2012
Location: Philippines
Posts: 14
Betty Boop is an unknown quantity at this point
Re: (FPGA) high throughput inverse tangent 2 input

*The output is not yet multiplied to pi so that it is expressed in pi radians.

input: y = 1, x = 2
output: 0.1482 (correct)

input: y = -1, x = 2
output: -0.1482 (correct)

input: y = 1, x = -2
output: 0.8542 (even the sign is wrong)

input: y = -1, x=-2
output: -0.8518 (sign is again wrong and from my observation, it doesn't take into account the sign of x)
Reply With Quote
  #4   Spotlight this post!  
Unread 21-01-2012, 21:43
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: (FPGA) high throughput inverse tangent 2 input

Quote:
Originally Posted by Betty Boop View Post
*The output is not yet multiplied to pi so that it is expressed in pi radians.

input: y = 1, x = 2
output: 0.1482 (correct)

input: y = -1, x = 2
output: -0.1482 (correct)

input: y = 1, x = -2
output: 0.8542 (even the sign is wrong)

input: y = -1, x=-2
output: -0.8518 (sign is again wrong and from my observation, it doesn't take into account the sign of x)
Those outputs are all correct. See attachment.

Starting from the +X axis and going counterclockwise, atan2 goes from 0 to +pi

Starting from the +X axis and going clockwise, atan2 goes from 0 to -pi.


Attached Thumbnails
Click image for larger version

Name:	atan2.png
Views:	20
Size:	24.6 KB
ID:	11500  

Last edited by Ether : 21-01-2012 at 21:48.
Reply With Quote
  #5   Spotlight this post!  
Unread 21-01-2012, 21:46
Betty Boop Betty Boop is offline
Registered User
no team
 
Join Date: Jan 2012
Location: Philippines
Posts: 14
Betty Boop is an unknown quantity at this point
Re: (FPGA) high throughput inverse tangent 2 input

ohh! sorry, sir, but can you please explain the last two cases I've tried manual calculation using calculator
Reply With Quote
  #6   Spotlight this post!  
Unread 21-01-2012, 21:51
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: (FPGA) high throughput inverse tangent 2 input

Quote:
Originally Posted by Betty Boop View Post
ohh! sorry, sir, but can you please explain the last two cases I've tried manual calculation using calculator
I edited my original response to add some detail. Please re-read it.

Then read this article:
http://en.wikipedia.org/wiki/Atan2

Then ask me a specific question and I'll gladly help.

Reply With Quote
  #7   Spotlight this post!  
Unread 21-01-2012, 22:38
Betty Boop Betty Boop is offline
Registered User
no team
 
Join Date: Jan 2012
Location: Philippines
Posts: 14
Betty Boop is an unknown quantity at this point
Re: (FPGA) high throughput inverse tangent 2 input

Hi! Now I understand THANK YOU VERY MUCH!

Last edited by Betty Boop : 21-01-2012 at 22:40.
Reply With Quote
  #8   Spotlight this post!  
Unread 22-01-2012, 08:41
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: (FPGA) high throughput inverse tangent 2 input

Quote:
Originally Posted by Betty Boop View Post
Hi! Now I understand THANK YOU VERY MUCH!
You're welcome.

May I ask: What is your interest in atan2? Are you taking a math class, or are you using it for FRC?

Reply With Quote
  #9   Spotlight this post!  
Unread 22-01-2012, 09:46
Betty Boop Betty Boop is offline
Registered User
no team
 
Join Date: Jan 2012
Location: Philippines
Posts: 14
Betty Boop is an unknown quantity at this point
Re: (FPGA) high throughput inverse tangent 2 input

No, Sir. I'm using it in determining the phase of a signal given its I and Q data.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 16:11.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi