LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display Phase value from graph

Hi,

I'm pretty new to Labview and I had a question about reading phase from a graph. Attached is the phase vs frequency but it's a bit difficult to pick out what exactly the phase is at a value. Is there a way to specify the frequency and have Labview display a numerical answer at that point? For instance could I input 50 hz into a box and have labview display 30 degrees? Attached is my phase shift plot.

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

One option is to add a cursor. Right click the graph and under 'visible items' select cursor palette. Then right click again, go to properties. Select Cursors. Press Add and then change the 'Free dragging' and 'All plots' to 'Single-plot' and 'Plot 0' (for example).

Then.... have a play! Dragging the cursor around should update the corresponding values from your graph in the cursor palette.

 

Alternatively you could use various index array and/or interpolate 1D array functions to enter in frequencies and get corresponding phases back.

Give it a go and post your vi if you get stuck.

 

Ian

 

 

Message 2 of 8
(3,906 Views)

Hey Ian,

If you don't mind I would like to ask you for help but I don't want to post my VI since my classmates might steal it and then I'd get in trouble for plagarism. Is there some way I could contact you directly?

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

Canyon,

You're welcome to ask for my help, and when time (and internet connection) permit I'm happy to do my best. One of the reasons these forums exist is to help everyone learn from the problems/solutions/experiences of others and to provide an enduring record of these to help other people in the future.

The vast majority of my LabVIEW knowledge was gained here on the forums (and by simply trying stuff myself to see if it worked) so where appropriate I try to put a little effort back into them.

So, to answer your question, I would prefer not to provide a means to contact me directly as I would then be helping just you, not the 'community'.

As for school work etc, if you're worried that classmates might 'steal' what other people are giving away freely then perhaps you should ask for hints and pointers rather than answers. That way you'll learn more as you go, people will be more willing to help and your classmates might also benefit but will come up with slightly different solutions to the ones that you choose to implement.

I hope that doesn't sound negative!
Fire away with questions and get stuck in trying things for yourself... it'll serve you well in the long term if you want to keep using LabVIEW.

Good luck!
Ian

Message 4 of 8
(3,848 Views)

Nope not negative at all and It makes sense and I appreciate your response!

 

Let me post my question then. I've attached ap icture of my output. I was told that the amplitude is good but the phase is unreadable for the frequencies desired. Is there some way to surpress the phase for the "zero" magnitude values so the phase for the peaks is more visible?

Message 5 of 8
(3,836 Views)

Here's another simpler example. 

 

The input wave is  50 and 120 hz cos wave which shows up great on the magnitude but the phase is all wonky. I've applied windowing functions and unwrapping the phase neither of these seem to help out much. 

 

==edit==

An an even simpler example is this 100 hz sine wave. The phase is also unreadable for this one.

Download All
0 Kudos
Message 6 of 8
(3,828 Views)

Hmm... not sure. It might be more of a signal processing question than a LabVIEW one. There are certainly folk on these boards who are pretty knowledgable about that type of thing, if you're lucky they might chip in too.

 

Posting your code would be helpful here, but as already discussed you're not too happy doing that.

 

Things I would try....

See what a logarithmic x-axis does for you - lots of phase/frequency type data is best viewed with log axes.(right click the chart, X Scale, Mapping, Logarithmic)

Check what happens if you zoom in on areas of interest (for help in this, see here). When zoomed in, your phase variation should probably show smooth trends rather than jagged noise. If it looks noisy then...

Double check your calculations - are there rounding errors, is there enough data points etc.

 

Not sure that helps much but they're my best guesses for the time being.

Cheers

Ian

0 Kudos
Message 7 of 8
(3,803 Views)

Hi Canyon,

 

As Ian mentioned above, the Cursor Legend could be the way to go for this. You may want to combine the phase and the magnitude signals onto one plot. You can then use the cursor to trace to the peak of the magnitude graph and then use the cursor legend to determine the phase at this point. Try checking out the example "Using a Single Graph Cursor to Return Values from Multiple Plots" that can be found here: http://decibel.ni.com/content/docs/DOC-15237

 

I hope that helps!

 

-Matt

 

Matt
NI Community Team
National Instruments
0 Kudos
Message 8 of 8
(3,760 Views)