LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Phase Delay

hello board,

I am using USB 6212 for measurements,which effectively has a phase delay of 12.5us. Now I have checked the phase response for an analog voltage fed diretcly into two input channels, and what I am seeing is nearly zero phase differences (< 0.1mrad). I did not make any change to convert rate etc.

 

1) Now if the phase delay is 12.5 us, then wont the phase angle difference between the two channels increase with increasing signal frequency?

For example, at a signal of 1 kHz, the phase delay would be (12.5us *2*3.14*1000) = 0.078 rad.

I am not seeing these large delays. 

 

Sampling rate is 2 kHz, and tone information for both input signals are extracted using single tone subVI.

 

(this is ideally what i want, the inter-channel delays do no manifest in me results, but theoretically the delay is 12.5us...)

0 Kudos
Message 1 of 20
(3,504 Views)

Just to add that all phase calculation are done after acquisition has been completed on the running program and not done on saved files (post processing).

 

0 Kudos
Message 2 of 20
(3,490 Views)

With a sampling rate of 2 kHz you cannot accurately measure a 1 kHz signal.  The Nyquist criterion is a strict inequality: fsampling > 2*fsignal. With exact equality consider the case where you sample exactly twice per cycle at the zero crossings: All the sample values will be zero!

 

If your sampling rate meets the Nyquist criterion but is close to the limit (for example fs = 2.05 kHz), you only get 2 samples per cycle in most sysles with 3 samples per cycle rarely. It will take a long time to get enough data to even begin to estimate the phase accurately.

 

Can you post your VI with some tyipcal data saved as default?  Are you feeding the same signal to both channels?

 

Lynn

0 Kudos
Message 3 of 20
(3,467 Views)

HI Lynnn

Thanks. You are right, my bad. Sampling rate is 5 kHz. I am home now, will try and post codes later.

Same signal is fed to both channels.

I have even tested with different Rc networks and I do get a very good phase response right down to 0.3 mrad. 

It will be great if someone could verify this with their own card.

The only reason I can think of is that since I am using extract single tone on the running VI and not on saved data, somehow the timestamp is making the difference.

What could be other reason...

0 Kudos
Message 4 of 20
(3,451 Views)

I suspect there is a time shift between samples but both sets of samples are adequate to reconstruct the original signal. Because the reconstruction is accurate you do not see a phase shift.  I will try later to see if I can put something together with the equipment I have available.

 

Lynn

0 Kudos
Message 5 of 20
(3,447 Views)

Thank you Lynn.

I have learnt a lot from discussions with you.

Will look forward to your reply.

 

Just a note. I was a little wrong in saying two cycles.

The 1kHz signal is just one the the signals in the total spectrum I am looking at. Infact I am scanning from 0.1 Hz to 1 kHz. The two cycles I mentioned is for the minimum frequency, i.e. 0.1 Hz I am collecting. The total length of the sample I am collecting can be given by [(2/signal frequency) + (2 seconds)]. This means at 0.1 Hz I acquire 2 complete waveforms, while as the frequency increases, more and more cycles are acquired. Example at 1 kHz, this will correspond to acquisition of ~2000 cycles.

 

I guess you are on the dot to say that with these the signals are being accurately reconstructed.

Please let me know how you go Lynn.

 

Cheers,

0 Kudos
Message 6 of 20
(3,434 Views)

First: try to capture more cycles, with higher samplerate for the tone detection (it works FFT based and is quite good with more than 10 periodes. there is a presentation about how good it is somewhere at NI.com).

Alternative is a linear MSE fit to Asin(wt)+Bcos(wt)+C search for SAM Sinus approximation method (it's not there as a vi, but not to hard to program)

 

A good test is to swap the input channels.

With only one signal source to both signals you can check the channel delay ... a 20kHz sine sampled @1M gave me an uncertaincy below 1nS (using tone detection.vi) , cross checked via Monte Carlo..(OK using a 5922 😉 )

 

 

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 7 of 20
(3,408 Views)

Sorry for the delay.  I had to do some work on my real projects.

 

I no longer have access to a suitable DAQ device so I put together this demo.  It shows the effect of delayed sampling.  The same sine wave is sampled at equally spaced points with an (arbitrary) pi/5 radian offset.  Notice that the plots overlap within the limits of the display while the numerical data shows the different sample times and values.

 

Lynn

 

 

0 Kudos
Message 8 of 20
(3,396 Views)

Lynn thanks a lot,

I will be going to work over the weekend, so will put up my codes.

Your example is very important.

The best reason I can think of my observations is that the timestamps (especially t0) of the waveform I am sending to "extract single tone" is preserved and is used by the subVI for calculation of phase.

Ofcourse these information will be lost when I save as a text file, hence post processing on text files will show the delay.

But as data is passed immediately after acquisition to extract tones, waveform integrity in terms of t0 is maintained.

Will be good if someone from NI could verify this. - that extract single tones utilizes t0 information for exraction of phase values.

 

Henricks thanks for the info. I will search for the info now.

0 Kudos
Message 9 of 20
(3,389 Views)

You can open the block diagram of the Extract Single Tone.vi to see that it does not use t0.  It uses FFT techniques to measure the phase.

 

I have not thought through the mathematics of phase determined this way, but off the top of my head I suspect that by analyzing the two signals separately it does not use the same time reference for determining phase.  Which is somewhat like your idea, except that it does not depend on t0.

 

Exactly what are you trying to measure?

 

Lynn

Message 10 of 20
(3,383 Views)