LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error in phase measurement

Hello,

I´m trying to measure the output signal phase of an integrator using the vi attached. A phase measurement error persists when I simulate this process. Frist, I´ve put a sine wave on the input of an integrator and the phase is measured as -88,2 deg (ok, very close to -90 deg, but different!). Second, I´ve put a sine wave with phase +90 deg on the input and the output phase measure is +1,8 deg (i.e, same difference error in last case). Why is this happening?!

Thanxs...

0 Kudos
Message 1 of 5
(3,149 Views)
Hey!

So is your question why is there an offset?  If you decrease the frequency to 1 Hz then you can see more accurate results for the phase measurement.  Since there is only one wave the phase measurement there is only one measurement made, making it much more accurate.  As you increase the number of cycles (frequency) then the accuracy of measurement will start to decrease.  Does this answer your question?

Andy F.
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 2 of 5
(3,134 Views)
Andy,

I can proven your results simulating the vi at 1Hz. But, I can´t understand because it´s happening. Everytime I increase the frequency the phase measured error  increases, while at least, the error stays constant. Do you know the nature of this error?!

Thanxs...

Rafael R. Londero
0 Kudos
Message 3 of 5
(3,127 Views)
Rafael,

I sat down and did some research and calculus and I believe that I have an answer fo you.  This error happens because of the inaccuracies that are inherient to numerical integration.  The first part of this is that the Express VI that you are using for Integration is actually using of left hand sum.  This basically takes rectangles and uses this to calculate the area.  When doing this calculation no boundary conditions are needed and the accuracy increases as the number of points rises.  This would indicate that as the frequency increases, the number of points and sampling rate stay the same, this would mean that the slope increases.  As the slope increases the rectangle approx. becomes worse and worse.  This introduces error into the equation which propigates to the phase shift.



To improve this error I would recommend not using Express VIs.  You can have the same implementation using regular VIs and functions, which I have attached above.  This method gives you two advantages. 
  1. This allows you to increase the number of samples and sampling rate.  This will increase the accuracy of the model since by giving you more points (decreasing dt). 
  2. The Integration VI allows you to input boundary conditions.  This will increase the accuracy of the integration.
These two things (mostly #1) will give you a much reduced error in your phase.  Please let me know if you have any other questions about this issue. 

Thanks again and have a great day!
Andy F.

Message Edited by Andy F. on 05-05-2006 03:39 PM

-----------------------------------------------------------------
National Instruments
Message 4 of 5
(3,115 Views)
Andy,

Right...I´ve checked your results, and I like very much!!! In your note #1 I´ve checked that when increasing the sampling rate the accuracy of phase measured improves (maintening the same frequency), but increasing the number of samples the accuracy stays constant.  Simulate your  VI, for example,  with sampling rate 1000 and 2000 number of samples at 1 Hz of sine wave and go rising the number of samples, you will see that phase measured stays same, but the time (axis X) increases...

Very thanxs...

Rafael R. Londero
0 Kudos
Message 5 of 5
(3,100 Views)