From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculating a phase difference?

A question:

I have a interferogram that translates along the X-axis of the face of a
PDA. This results in a sine wave as an output. I am interested in measuring
the X-axis movement of the sine by calculating the phase difference between
aquired sine waves.
I have been using an FFT rotuine and then splitting the FFT into it polar
components. If I understand the FFT correctly, the theta portion of the
polar FFT relates back to the phase of a wave. By doing this twice on two
different sine waves, and then subtracting the polar coordinates, a phase
difference should be reported.
We are having problems with signal noise, and I am wondering if there is
something fundamentally wrong with the program, or a more elegant way to

compute a phase difference.

Ideas?

Thanks for your help.
0 Kudos
Message 1 of 4
(6,143 Views)
Hello John,

Here are two VIs (written in LV 4) that calculate phase difference. From your description, it sounds like the signals come from different iterations of your loop. If this is the case, then I recommend you write the Ith iteration to a shift register, and compare that to the current I+1th iteration.

In the attached VIs, delete the signal generation VIs, and replace them with your arrays of data.

Joel Andersen
Applications Engineer
www.ni.com/ask
0 Kudos
Message 2 of 4
(6,143 Views)

Hello,

I realise the thread I'm replying to is several years old but hopefully someone can help me anyway. I downloaded the file in the previous post as I'm trying to find the phase difference between two sine waves. I attempted to modify the "Phase difference.vi" file to take in two continous sine waves from a DAQ card. I am a new user to Labview and I'm having trouble modifying the file to work with continous sine waves facquired from the DAQ and still producing a phase difference measurement...is anyone able to offer any advice?

Regards,

Mark

0 Kudos
Message 3 of 4
(5,421 Views)
Hey Mark,
Try out the "dual channel spectral measurement" express VI. It may do what you're looking to accomplish. It can be found under Signal Processing>>Waveform measurement. Let us know if this helps out.
 
 
Chris C
0 Kudos
Message 4 of 4
(5,389 Views)