LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring frequency and phase of a square wave using Extract Single Tone Information vi

Solved!
Go to solution

Dear all,

 

I am trying to measure the frequency and phase of a square wave from a DAQ card using Extract Single Tone Information vi. So far the frequency could be measured correctly but there is some problems with the phase measurement.

 

I have attached a sample program here. I generate the square wave using Square Wave PtByPt vi. The default sample size is 1000. When I set frequency = 7.43, phase = 80, the frequency could be measured correctly but the phase is completely out. Is there anything wrong with my program? 

 

Thank you very much for your help.

 

Best regards

0 Kudos
Message 1 of 3
(3,713 Views)
Solution
Accepted by topic author looloo

A square wave is not a single tone 😉

If you have a square wave use the edges to do measurements. 

 

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 2 of 3
(3,704 Views)

Thank you Henrik. it is possible to do it that way.

 

Another problem is that I need to measure the phase difference between a square wave and a sine wave from a DAQ card. They are expected to have the same frequency. For sine wave, I guess it could be done by the Extract Single Tone vi but for the square wave, do I need to do the manual calculation and compute the phase difference? Is there any other ways to accomplish that?

 

Thanks for the help

0 Kudos
Message 3 of 3
(3,686 Views)