LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

arctan from -pi to pi

I want to calculate tan inverse with my data but the problem is the moment Atan crosses +90° or -90° it goto -90° and +90° respectively i want it to calculate the value the way it is coming without changing the trend of the data (may be from -pi to pi)

 

attached is the picture of how the value suddenly jumps to 90 deg in either directions.

 

because of this the little curve gets cut and move to the upper edge of the graph as in attachment.

0 Kudos
Message 1 of 7
(6,601 Views)

You have run into phase wrapping.  The absolute phase of an arctan cannot be determined from the data, since arctan is repetitive.  Thus, it is always mapped into a specific range of angles.  If your data is relatively smooth (and it looks like yours is), you can "fix" this by detecting when your data makes a discontinuous jump (e.g. point–to–point change over 70°), then correct it back to the original phase based on the direction.  If you have the advanced analysis library with your version of LabVIEW, look for the Unwrap Phase VI, which will do this for you.

0 Kudos
Message 2 of 7
(6,587 Views)

Actually i don't have advance analysis library of LabView i just have Diadem 10.2. Isn't there any way to set the output range of arctan to 0 to -pi as the analysis i am doing will always have the signal which is laging behind the output.

0 Kudos
Message 3 of 7
(6,564 Views)

Hi,

 

Use atan2 function.

I don't know if it can be found in LabView (except Unwrap Phase VI) but you can use a Matlab Script node and use atan2 function from Matlab. This way the quadrant is taken into account so the output will between -2pi +2pi.

 

You can also use a case (using the quadrant) and atan definition.

 

Take a look in the attachment for a atan2 example.

 

Paul

0 Kudos
Message 4 of 7
(6,552 Views)

As I mentioned in my previous post, unwrapping your phase should be fairly simple, since you know what quadrants you need to be in and your data is fairly smooth.

 

You may want to post in the DIAdem forums instead of the LabVIEW forums to get people with the right expertise answering you questions.

0 Kudos
Message 5 of 7
(6,542 Views)

can any one please move this topic to diadem forums?

0 Kudos
Message 6 of 7
(6,504 Views)

You are probably the best one to do this.  Post a new question with exactly what your current issue is and your understanding of it.  You should get a response fairly quickly.  Actually moving this thread could take awhile and would not serve you very well.  There is a lot of noise in this thread.

0 Kudos
Message 7 of 7
(6,490 Views)