DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Phase Shift Between two SIne Waves

Hello,

 

I am trying to determine the phase shift between two sine waves of varying frequency.

 

Using the FFT function I am able to calculate the phase of each sine wave.

 

However I am uncertain how to calculate the phase shift between these two plots.

 

 

One of these plots is a generated sine wave with an increasing frequency between 0.2 and 5 Hz the other is a reaction to the command wave so it is a little erratic but does follow the commanded sine wave but with a lower amplitude.

 

Any ideas? 

 

 

 

I am using DIAdem 2012

Tim
0 Kudos
Message 1 of 5
(7,036 Views)

smoothdurban,

 

Since you have the phase information for both waves, you can just take the difference between the two for the phase shift. I believe the FFT function's phase output is a plot of phase vs frequency. So, with the difference, you can look at the phase shift at specific frequencies.

Humphrey H.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(7,016 Views)

Hey Tim,

 

R&D responded with this excellent script for calculating the phase shift of two similar waveforms.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 3 of 5
(6,956 Views)

Hey Brad

 

Looks good.

 

My only comment is I wish the comments were in english.

 

Tim
0 Kudos
Message 4 of 5
(6,835 Views)

Hi Tim,

 

Here's a version with English comments and a VIEW layout.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 5 of 5
(6,829 Views)