To find the phase shift between two signals (Ch A and B) I:
a) Add a cycle time measurement to Ch A (or B).
b) Use cursors to measure the time delay between signal A and B.
c) Calculate the phase shift from the information above.
Is it possible to implement a measurement into PicoScope 6 that calculates the phase shift (in deg) between Ch A and B.
although you have to take the value after the phase settles down as the start conditions are unknown and the first part of the trace will be inaccurate.
One word: Brilliant!
I ran a quick test connecting probe A/B before/after a filter and the phase shift read-outs matched the filter's transfer function very well.
Hello,
I am trying to get used to the math functions in 2208B scope. Can you explain the steps in the phase calculation or point me to a paper? It works well. I would like to understand the steps.
acos(integral(A*B)/(sqrt(integral(A*A))*sqrt(integral(B*B))))/Pi*180
to check A and B where 1 is positive correlation, 0 no correlation, and -1 negative correlation
before scaling to degrees.
If you also remember that integral is calculating the area under a curve, and by doing A*A you are rectifying the signal you should be able to understand the rest.
Martyn wrote:If you also remember that integral is calculating the area under a curve, and by doing A*A you are rectifying the signal you should be able to understand the rest.
...and there also lies trap for young players. With this method not only duty cycles but also areas under curve must be exactly identical otherwise calculus is off. phase(A;B) measurement is integral method taken between cursors where it is more less settled:
Thanks for all who have helped on phase shift measurement.
When I use (acos(integral(A*B)/(sqrt(integral(A*A))*sqrt(integral(B*B))))/Pi*180) I get up to a 30% error.
When I use ((((atan(1/tan(pi*(A/10000)))/pi)+(A/10000))*-((atan(1/tan(pi*(B/10000)))/pi)+(B/10000)))+0.25)/0.002777777 it matches the cursors.
I would still like to understand how the first formula works.
acos(integral(A*B)/(sqrt(integral(A*A))*sqrt(integral(B*B))))/Pi*180
Would you say the formula below is what it is doing?
acos(correlation formula)/Pi*180
It's correlation formula. Will only show phase if the shape is exactly the same (except phase shift). For in-phase signals, it'll measure the similarity between waveforms (if you remove "acos" and scaling). It'll be "1" if the signals are completely the same (ignoring scale) and "0" if they're completely dissimilar. "-1" will mean the same sinal, but inverted. You can use the formula to measure how similar is your waveform to the sine wave (or any other signal you may want to use as an etalon).
Overall to understand the formula you start working "inside out". Something along these lines:
etc. After you get a visual picture what each part does on specific signal you can put it together and understand. Brain likes visual ques. So even running seemingly basics on known signal like A*A can help sometimes.
Thanks very much for explaining this. This is similar to the formula for rms [ sqrt(integral((A)^2)/T) ]
It is easy to see this because the T is the amount of time along the X axis of the display. In the correlation formula how is it able to work without a T? Thanks / Barnett
Correlation formula:
(integral(A*B)/(sqrt(integral(A*A))*sqrt(integral(B*B))))
(integral(A*B)/(A rms*B rms))
this will give a value between -1 and 1 showing how similar the two waves are.
1 would mean the signals are identical.
0 would mean the two are completely dissimilar.
-1 would mean identical signals but opposite polarity.
This is also the power factor cos Θ.
Example:
E & I in a power xfmr to see the phase shift.
V: 115 vac @ 60 Hz
I: 180 ma rms
Phase shift: 44 degrees = 0.768 radians
Must correlate correlable What you are fundamentally doing here is comparing maximum potential output power (watts) to current output. Which is directly tied to phase between voltage and current.
Thanks very much for explaining this. In your code you use T. Where is the T in the equation below?
To calculate an integral you have to have a T don't you.