Measurement of phase between two signals is often required when using oscilloscope. Some scopes have built-in function for that, some do not. One could accomplish task with cursors, but this is time consuming and not ultimately accurate. Alternative is to use math formula. For example in PicoScope community following formula is circulated:
Formula is based on integration and is principally functional, but due to various technical nuances often does not work or displays completely wrong value, as demonstrated on screenshot above (orange trace, DC average over oldPhase(A;B) measurement). Main culprit is time it takes for integrated trace to "settle".
Substantially improved result can be obtained with formula operating on entirely different principle of trignometrical discretization. Condition is that signals have equal duty cycles at zero crossing. Duty itself may differ from 50%. Consequently works with pulses of equal length. Pulses must overlap. Within these limitations waveform of any shape and amplitude is first converted to square wave of "standardized" amplitude (inside formula). Then phase diff is obtained via simple arithmetics for two square waves (indigo trace, DC average over newPhase(A;B) measurement).
Results obtained with different methods on input of ChA: 10kHz, 0dBm triangle. ChB: 10kHz, -10dBm square:
As seen new formula demonstrates accuracy unobtainable even by cursor measurement. Note that when phase diff is over 180° it starts to diminsh again with both formulas and reaches 0° by 360°.
Tests were conducted on PicoScope 6 - PC Oscilloscope software version: 220.127.116.1117, PicoScope 2408B hardware. Signal generator was Siglent SDG2122X.New development:
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.