06-01-2011 12:53 PM
Hello,
I was wondering if there is any VI that I can use to get the phase shift between a pulse and a sin wave (they have same frequency).
The Ideal case is that the pulse should go to 1 when sin wave is positive and goes to 0 when the sin wave is negative. I want to set this test to measure the phase shift between pulse going to one and sin wave going positive.
We just bought labview full version with Signal processing package, and I was wondering if there is anything that would be useful for me.
Thanks in advance,
Baran.
06-01-2011 01:24 PM
This question has come up before. Did you try a search? For example: http://forums.ni.com/t5/LabVIEW/Caculate-phase-difference-between-two-sine-waves/td-p/787043
06-01-2011 01:29 PM
Thanks.
06-01-2011 04:05 PM
I am getting signals from DAQ 6009 and the results this example gives me is way off. I expect to have phase shift in order of couple of degrees, but it gives me 30 - 40 deg, and it keeps changing.
What I had made myself is to read the sin wave when the pulse goes up and divide it by the max of sin and get acos to find the phase, but that changes too from 3 to 5 degrees, and I am not sure if that's because of the accuracy/noise of my DAQ or something else.
06-01-2011 04:22 PM
Can you save the data you got from the 6009 so that we can see it? For instance, you could run the VI, get the graph, then stop the VI. Then right-click on the graph and select Data Operations -> Make Current Value Default. Save the VI and upload it. Or, you could just save the data to file and upload that. If you do the latter be sure to include a screen shot (PNG, NO BITMAPS) so we can verify what the waveforms look like.
06-01-2011 05:08 PM
I attached a VI file with the graph.
For this one the two methods in the example gave me -21 and 19 degrees.
Thanks.
06-02-2011 06:09 PM
Hi Baran,
Try this on for size and see if it works for you.
Have a great day,
Chris V
06-03-2011 07:52 AM
@Chris V wrote:
Hi Baran,
Try this on for size and see if it works for you.
Chris, that's what shown in the example I linked to.
@Baran wrote:
I attached a VI file with the graph.
For this one the two methods in the example gave me -21 and 19 degrees
I'm not quite sure I understand what you are saying. If I replace the graph that's on the front panel of the example I linked to with your graph, one method gives me -15.3 and the other gives me -17.3.
06-03-2011 10:26 AM
Even 15 and 17 is a little high! I don't understand why you got different results!! I get my signals from DAQ with N samples. Could that make any problem?
06-03-2011 11:33 AM
How many samples per cycle are you acquiring? Are both the sine and square channels acquired in the same DAQ read?
Lynn