LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

phase difference between two sine waves

Hi,

 

Can someone please suggest a quick way to find the phase difference between two sine waves in terms of deltaT as shown in the figure below. FYI, Sine waves have same frequency and amplitude.

 

Thanks

 

sine05.gif

 

0 Kudos
Message 1 of 17
(9,862 Views)

How is the deltaT supposed to tell you the phase difference based on the figure you've shown? It would seem to me that you need to get it the same way for both waveforms. I.e., get the inlet or outlet for both cases.

 

As far as LabVIEW VIs are concerned, you may be able to simply use the Extract Single Tone Information for both waveforms and then subtract the measured phases. 

Message Edited by smercurio_fc on 05-26-2009 05:15 PM
Message 2 of 17
(9,853 Views)
Find the VI to find the phase diff.
Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
Message 3 of 17
(9,843 Views)

Baji wrote:
Find the VI to find the phase diff.

 

A cool solution. It took some time for me to find out what it do. But it is a phase sensitive detector. The same type is used in digital lock-in amplifiers. The hilbert transform of sin(t) is -cos(t). So by multiplying by -1 you get cos(t). In lock-in amplifiers a lowpass filter is used after the multiplication. but I guess the DC/AC estimator works nice your signal is free of noise. Lock-in amplifiers are often used to detect small signal drowned in noise.

rpula

If you want to document how this work just Google lock-in amplifier or phase sensitive detector. You will find tons of useful information



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 4 of 17
(9,830 Views)

Thanks for the suggestions.

 

May be I should ask, how to find the time delay (DeltaT) between the two sine waves. The word Phase difference is misleading.

 

I have two sine waves as shown below (same amplitude and frequency), with a slight shift in the time. How do I just calculate the DeltaT? May be I should calculate the time at which a particular pulse crosses zero for both waves.

 

Is there any VI to calculate the time at zero crossing? Anyway, I am trying to find this. If someone has suggestions, please pass it over.

 

Thanks

 

sine05.gif 

0 Kudos
Message 5 of 17
(9,788 Views)

Well, there's lots of zero crossings, by definition. Any one in particular? Your new description, unfortunately, makes less sense. According to the figure, deltaT is the time between the peak and the zero crossing, regardless of "where" the wave is. This, of course, would be a function of the frequency of the wave. Yet you keep talking about some relation between the two waveforms, and I see none. 

0 Kudos
Message 6 of 17
(9,781 Views)

Both the sine waves have same frequency. So, I think if there is a time shift in the signals, it should remain constant.

What I mean by deltaT is the time shift between the two signals.

I am looking at the trigger vi. It seems to be giving something I needed.

 

Thanks

0 Kudos
Message 7 of 17
(9,775 Views)
The phase difference is indeed related to delta t. If signal A is compeered to signal B. And the result is that the phase difference is -90. So will that that tell you all you need. The minus sign tell me that signal B is delayed in respect to signal A, and the signal is delayed (90/360)*(1/f) seconds in the time domain.


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 8 of 17
(9,774 Views)

Are the sine waves being sampled with a DAQ card?  If so and it does not simultaneously sample, you need to account for the inter-channel delay.

0 Kudos
Message 9 of 17
(9,722 Views)

Yes, I use DAQCard 6036E to sample the sine waves. How do I account for the interchannel delay? Any clues will be helpful.

Fequency of sine waves is 180 Hz

Sampling rate I use is 10k hz

0 Kudos
Message 10 of 17
(9,717 Views)