scopes to measure phase shift

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
We want to measure the phase shift of a pair of sine waves in the
roughly audio sort of range. Our Rigol scopes measure phase shift
automatically, and we're going to do some tests to verify accuracy.

I wonder how oscilloscopes do the math. Anybody know? Any experience
with this?


--  

John Larkin         Highland Technology, Inc

lunatic fringe electronics  


Re: scopes to measure phase shift
On 2018-10-25 07:50, John Larkin wrote:
Quoted text here. Click to load it

Probably by simple subtraction of their real and imaginary parts. Pretty  
much what we humans used to do in the Lissajous mode.

I used Lissajous at a client some years ago and quickly had several  
engineers staring at the scope. "What *IS* this?" ... "Lissajous  
figures, I want to see if the phase relationship has flutter on it and  
how much" ... "Lissa_what?"

--  
Regards, Joerg

http://www.analogconsultants.com/

Re: scopes to measure phase shift
wrote:

Quoted text here. Click to load it

Complex FFT?

Here's an article that mentions correlation, which makes sense.
Cross-correlate and look for the peak or maybe the zero crossing?

https://www.edn.com/Pdf/ViewPdf?contentItemId44%41014

Like most EDN content, it's kind of goofy about units and details.


--  

John Larkin         Highland Technology, Inc
picosecond timing   precision measurement  

We've slightly trimmed the long signature. Click to see the full one.
Re: scopes to measure phase shift
torsdag den 25. oktober 2018 kl. 21.53.19 UTC+2 skrev John Larkin:
Quoted text here. Click to load it

https://www.dsprelated.com/showthread/comp.dsp/52240-1.php


Re: scopes to measure phase shift
On 2018-10-25 13:07, Lasse Langwadt Christensen wrote:
Quoted text here. Click to load it

Zero crossing is not reliable on a noisy signal, correlation is. In the  
background you can see that they are displaying the Lissajous result,  
the oval trace (magenta?). My color vision isn't all that great. Sez  
SWMBO, who picks my clothes for more formal events because I'd mess that up.

It's essentially feeding one signal into the Y axis, the other into the  
X-axis. No time base. Lissajous, a blast from the past :-)

Quoted text here. Click to load it

There are many ways to do it and maybe they use correlation. Processing  
power is almsot "free" these days.

--  
Regards, Joerg

http://www.analogconsultants.com/

Re: scopes to measure phase shift
wrote:

Quoted text here. Click to load it

My color vision is excellent. It's just my taste in colors that's
awful.


--  

John Larkin         Highland Technology, Inc
picosecond timing   precision measurement  

We've slightly trimmed the long signature. Click to see the full one.
Re: scopes to measure phase shift

Quoted text here. Click to load it

You took the words right out of my mouth... I'm the same way.

I remember a description of a character in a story... he had a habit
of "wearing a tie that would frighten a newspaperman."  I can only
infer that reporters tend to have a fashion sense about as bad as
mine.


Re: scopes to measure phase shift
On Thu, 25 Oct 2018 13:07:46 -0700 (PDT), Lasse Langwadt Christensen

Quoted text here. Click to load it


Good stuff there. If we don't like or don't understand the Rigol
measurement, we can suck out the waveforms and do the math ourselves.

We'll be using sine waves and really want the phase shift of the
fundamentals, namely ignore any harmonics or DC offsets.

Correlating the sines, or correlating each waveform against a perfect
sine of the same frequency, might be good. Compare the zero crossings
of the correlation.

At our low frequency, we could have long records of massively
oversampled sines and a lot of windowing on the ends.

A windowed complex FFT wouldn't be out of the question either.

I want a fraction of a degree in the roughly audio range.


--  

John Larkin         Highland Technology, Inc
picosecond timing   precision measurement  

We've slightly trimmed the long signature. Click to see the full one.
Re: scopes to measure phase shift
On Thursday, October 25, 2018 at 4:24:43 PM UTC-4, John Larkin wrote:
Quoted text here. Click to load it

Hmm, if you had both quadratures you could do a lockin type thing.  

George H.  
Quoted text here. Click to load it


Re: scopes to measure phase shift
On Thursday, October 25, 2018 at 1:24:43 PM UTC-7, John Larkin wrote:
Quoted text here. Click to load it

One approach that can work pretty well is a Hilbert transform implemented
with an STFT filter, basically an FFT/IFFT combo with appropriate windowing
and overlapping to handle buffered data.  The Hilbert transform turns the
real data into an analytic signal and atan2() does the rest.  If you need
less noise, you can shift the I/Q signal down to near DC and LPF it before
the phase detection.  

There is an STFT_FILTER class in my random collection of DSP function
(http://www.ke5fx.com/dsplib.zip ) that I use for this sort of thing.  
Or there's probably an easy way to rig up a suitable filter in MATLAB
if you aren't looking to write any low-level code.

The scope is almost certainly just looking at zero crossings and calling
it a day.

-- john, KE5FX

Re: scopes to measure phase shift
On Thu, 25 Oct 2018 15:42:03 -0700 (PDT), "John Miles, KE5FX"

Quoted text here. Click to load it

We'll have volts of clean signal, so s/n should be good. This is to
test our fuel level gauge simulator box, which simulates a 3-wire
coaxial capacitive level sensor, with both capacitive (jet fuel) and
resistive (crud) components.

Quoted text here. Click to load it

Thanks, I'll pass that on to my math types. We'll be doing the math in
Python; we already have a bunch of libraries for the 500 MHz Rigol
scope, so we could add some more code.

We just bought some C0G caps and put them into little BNC
connectorized Pomona boxes and sent them to IET. They will measure
them for us to something better than 0.02%. We'll use those to cal our
test set that tests the level simulators.

IET is the inheritor of the standards and measurement parts of General
Radio.

https://www.ietlabs.com/genrad/index.html

They seem awfully nice.







--  

John Larkin         Highland Technology, Inc
picosecond timing   precision measurement  

We've slightly trimmed the long signature. Click to see the full one.
Re: scopes to measure phase shift
On Thursday, October 25, 2018 at 6:58:58 PM UTC-4, John Larkin wrote:
Quoted text here. Click to load it
Do you worry about things like temp, humidity, some other weird thing  
I'm not thinking of?  
Quoted text here. Click to load it
Oh dear, I love general radio.  My first time in the lab some  
gen rad frequency generator broke.  The manual had everything,
and inside a week (I was doing other things too.) I found the  
signals that weren't right, tweaked the bias on a transistor  
a bit, and never had another problem.    

George H.  
Quoted text here. Click to load it


Re: scopes to measure phase shift
On Thu, 25 Oct 2018 17:01:18 -0700 (PDT), George Herold

Quoted text here. Click to load it

C0Gs, used at low voltages, are very stable. We'll check them once a
year and see how they're doing.

  
Quoted text here. Click to load it

GR somehow never made it into the digital age. They did have an
automated test system, a Teradyne sort of thing, but I don't know what
happened to that.

Their decade resistor and K-V divider boxes were (still are) great.


--  

John Larkin         Highland Technology, Inc

lunatic fringe electronics  


Re: scopes to measure phase shift
On 25/10/2018 21:24, John Larkin wrote:
Quoted text here. Click to load it

You don't need to window if you restrict the frequency to something that  
is exactly commensurate with your timebase.
Quoted text here. Click to load it

Cross correlation of the two waveforms is probably the way to go.

I'd be very surprised if they did it any other way.

For a single spot frequency it may be cost effective to multiply and sum  
each channel with an ideal precomputed sine wave and then use ATAN2 on  
the two resulting summed components to get the right phase quadrant.

--  
Regards,
Martin Brown

Re: scopes to measure phase shift
On 10/26/2018 07:29 AM, Martin Brown wrote:
Quoted text here. Click to load it

All true, except that it's an _oscilloscope_ we're talking about here.

The likelihood of the firmware in a general-purpose scope going to those
lengths is pretty small IMO.  Scopes have to work with ugly waveforms,
duty cycles far from 50%, and so on.  Having a dedicated sine-wave mode
is more the province of a lock-in amplifier.

The sheer range of special cases required to get even vaguely sensible
results from correlations between completely arbitrary waveforms and
user setups would be way more trouble than it's worth. It would also be
almost impossible to test adequately.

It's not a particularly well-defined problem, anyway: in general the
fundamental and harmonics will have different phase shifts, so the
correlation peak won't correspond to the phase difference between the
fundamental components.

For example, the correlation method would produce head-scratching
results when somebody tries to compute the phase error in a PLL whose
reference and VCO signals have different duty cycles, as they commonly
do.  The natural way to quote that is to look at the delay between
edges, choosing whichever edge the scope is triggering on at the time.
That is, you'd look at the delay from rising edge to rising edge or
falling edge to falling edge.

So my vote goes to testing the zero crossings, perhaps with some
interpolation for improved precision, and maybe even least-squares
spline interpolation for improved noise immunity.  At low speeds,
running the digitizer at full speed and doing a boxcar average would
help too, as in "high-res" modes.

Then once you have the delta-t and the period, you can compute the phase
and then average that over N acquisitions.  That would give a pretty
good result, easily good enough for scope accuracy.

Cheers

Phil Hobbs



--  
Dr Philip C D Hobbs
Principal Consultant
We've slightly trimmed the long signature. Click to see the full one.
Re: scopes to measure phase shift
On Saturday, October 27, 2018 at 1:10:24 AM UTC+11, Phil Hobbs wrote:
Quoted text here. Click to load it

<snip>

Quoted text here. Click to load it

John has got sine waves, and he has got a two channel sampling scope.

He just has to least squares fit one sine wave to each channel, with three parameters each - DC offset, frequency and phase.

The parameters are orthogonal, so you can do it in a single - computationally intensive - pass.  

Futzing around with zero-crossings doesn't make sens ein this particular application.

--  
Bill Sloman, Sydney

Re: scopes to measure phase shift
On Thu, 25 Oct 2018 13:24:35 -0700, John Larkin wrote:

Quoted text here. Click to load it

You're massively over-complicating a very simple objective, John. You  
should get yourself one of these little beauties:

https://tinyurl.com/yb97fxhw

100% analogue. Never tells lies.



--  
This message may be freely reproduced without limit or charge only via  
the Usenet protocol. Reproduction in whole or part through other  
We've slightly trimmed the long signature. Click to see the full one.
Re: scopes to measure phase shift
On 10/26/18 7:30 PM, Cursitor Doom wrote:
Quoted text here. Click to load it

Mine does.  It worked fine till I asked it to remember a trace, and then  
it went dark and hasn't responded since.

Is that a basis for a relationship, I ask you?

Cheers

Phil Hobbs

(who used a 468 with great profit circa 1982.)

--  
Dr Philip C D Hobbs
Principal Consultant
We've slightly trimmed the long signature. Click to see the full one.
Re: scopes to measure phase shift
On Fri, 26 Oct 2018 21:34:26 -0400, Phil Hobbs wrote:

Quoted text here. Click to load it

Of course! The best of relationships have their ups and downs. Why  
haven't you fixed it? They're readily accessible repair-wise, not like  
those Chinese things John's always banging on about.
  
Quoted text here. Click to load it

I'll have to look that one up; not familiar with it.




--  
This message may be freely reproduced without limit or charge only via  
the Usenet protocol. Reproduction in whole or part through other  
We've slightly trimmed the long signature. Click to see the full one.
Re: scopes to measure phase shift
On Fri, 26 Oct 2018 23:30:11 -0000 (UTC), Cursitor Doom

Quoted text here. Click to load it

Analog storage scopes were awful. Besides, we automate all our
testing.


--  

John Larkin         Highland Technology, Inc

lunatic fringe electronics  


Site Timeline