LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring Phase between reference sine wave and a repeating burst signal

Hi there,

 

I have two PXIe-5110 modules with all four channels measuring a 50 Hz repeating signal which is essentially a square burst of pulses. The image on the left is the 50 Hz burst and on the right is the magnified signal looking at the pulses within the burst. These bursts shift in phase relative to a 50 Hz sine-wave.

 

I am trying to trigger the PFI ports off of the reference 50 Hz sine wave and then measure the relative phase of the burst signal as shown by the green arrow in the left image. I am new to LabView and could use some guidance as to how best to implement this goal.

 

Thanks!

 

 

Firing signal.jpgFiring signal magnified.jpg

I would like to know how i can best measure the phase difference between a 

0 Kudos
Message 1 of 6
(2,602 Views)

Not to be too disagreeable, but do you want to measure phase (which I think of as a relative difference between two periodic signals, measured in radians or degrees) or a time delay

 

Another point -- In your figure, you show a double-headed arrow that points to the "onset" (or place of maximum derivative) of the first signal and the peak (which is a place with derivative = 0) of the second (sinusoidal) signal, sort of comparing Apples and Oranges (both are fruit ...).

 

Are you measuring both signals?  I'm unsure what you mean by "triggering the PFI ports off the reference 50 Hz sine wave".  I also had a great deal of trouble opening your VI (which might be because you failed to attach it ...).

 

Can you clarify if you are interesting in the onset of the Burst, or the midpoint of the Burst, and (similarly) the "positive DC crossing" of the sinusoid or the "peak" of the sinusoid?  [Note that if you are measuring (and hence "estimating") the sinusoid's phase, the point of least accuracy is the estimation of the peak, where the derivative is 0.]

 

Bob Schor

0 Kudos
Message 2 of 6
(2,548 Views)

To clarify, I do want to measure the phase between the two signals. The preferable points I would like to compare are the positive going zero crossing point of the sinusoidal signal to the onset of the burst signal. I do not have any spare channels to measure the sinewave, so i was planning to simply use a PFI port to trigger off the sinewave.

 

Since posting the question, I have already had success with achieving the phase measurement but I would be open to any suggestions to making my solution better.

 

The sinewave is actually being generated by an NI DAC module, so I produced another DAC signal which is a square wave in phase with the sinewave. That square wave is being fed into the oscilloscope PFI port in order to trigger the oscilloscope. Now that i have the burst signal being measured in reference to the sinewave zero-crossing point, I then measure the number of samples between the start of the oscilloscope measurement and the first edge of the burst and then calculate the degrees to get the phase difference. There is also no drift between the two signals as the burst is derived from the sinewave by external electronics.

 

I have attached the VI that does the phase angle calculation.

0 Kudos
Message 3 of 6
(2,523 Views)

Phase is typically/always measured for signals that have the same frequency. Not sure I understand the concept of phase difference here; maybe time delay as @Bob_Schor suggested would be a better term.

 

If I was doing the measurement and had unlimited channels, I would find the phase of the 50Hz sinusoidal relative to time zero, such that sin(w t + theta). I would then get the nth harmonic of the sinusoidal signal so it matches the frequency of my burst, that is, sin(n w t + n theta). I would use this harmonic in a pair of mixers to determine I & Q between my burst and reference; then I would use I & Q to get the phase. If this is unfamiliar to you, look up lock-in amplifier.

 

mcduff

Message 4 of 6
(2,515 Views)

Hi

 

The two signals have exactly the same frequency as the burst signal is derived from the sinewave through external analog electronics. In practice the burst signal varies in phase/time delay relative to the sinewave and this is the property I am interested in quantifying. I will look into the method that you suggested but unfortunately i do not have enough channels to measure the sinewave.

 

Thank you

 

Aleksandar

0 Kudos
Message 5 of 6
(2,492 Views)

Where is that 50Hz signal comminig from?

What timing resolution to need (look for)?

While the timing of the first slope of your burst signal is a function of  the burst slew rate (and samplerate), the phase measurement of the 50 Hz signal is prone to jitter if measured with a threshold ... 

If you create that 50Hz signal  in your PXI chassis you should use internal timing/trigger lines to measure the timedelay and have all cards referenced to the star timing and trigger.(see TClk help and examples)

Capture  20+ periodes of the sine, use tone detection to measure the phase of that signal. investigate the variances on all channels, also after a system restart!

(tone detection ignores the t0 value and refences to the first sample!)

 

 

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 6 of 6
(2,459 Views)