03-23-2011 09:39 AM
So I have acquired to analog signals from a function generator by splitting the output. So they are more or less the exact same signal. I am trying to test my program with this setup. I am using an M-series DAQ card that has a maximum acquitision rate of 250k or 125k per channel (for two channels). My goal is to find the phase difference of the signal, so for this trial it should be more or less zero. I have accounted for interchannel delay correctly (I think) but I am still having problems. When acquiring the phase difference I will get a steady zero, but then periodically it goes to 360 degrees. So I would like to know if anyone can explain what in my program is causing this. I have attached a picture of the front panel when the 0->360 phase anomoly occurs and also my architecture in general. I'm pretty new to Labview so any help would be appreciated
03-24-2011 08:56 AM
You are running into phase wrapping. In your particular case, 0 and 360 are essentially the same. What is probably happening is your phase is going slightly negative, but is being mapped into positive phase space. So instead of getting -0.01, you are getting 359.99. As a simple fix, if you know your phase should always be in the range -50 to 50 (for example), you can subtract 360 from values over 50 and add 360 to values under -50.
Phase unwrapping can get fairly complex, but should be fairly easy in your case.
As for your program, it is a fairly decent simple piece of code. You can remove the flat sequence (right click on the frame of the sequence and choose remove). It is doing nothing for you. LabVIEW dataflow already determines the sequence of those items contained within it.
If you need better performance, you can move your analysis to a different loop and use a producer/consumer architecture, but this is probably not necessary for the one-shot acquisition and analysis you are doing.