# Measure phase angle

1. Jan 26, 2014

### EE4life

How can I measure the phase angle between two signals of the same frequency without an oscilloscope?

2. Jan 26, 2014

### sophiecentaur

Try this circuit.
There are many alternatives if you google "Phase detector circuit"
The general principle for doing this in analogue is to square the two inputs and use an RS flip flop. Integrate this output (RC) and it will stay up or down, more or less, according to the time between the incoming edge to the R and the incoming edge to the S input. It's a pulse width measurement, effectively. When the inputs are in in anti phase, the output of the integrator will be half way between the upper and lower limit.
The range between upper and lower limits will depend on the integrator time constant and the test signal frequency and you could calibrate this by hand, to suit the operating frequency.

There are digital realisations of this, for instance, using a gated high frequency clock, to provide the time difference between the two rising edges and a count of the clock over a full cycle to give the full period. The ratio of these two will give the phase as a fraction of a complete cycle. If your operating frequency is not high then you could use a cheap processor to do this. It would be easy to give yourself a digital readout, doing it this way.

The solution you choose, depends upon your level of expertise and what you actually require as an output - there's no limit to how accurate and complex you can get. It wouldn't be hard to get more accurate than reading off an oscilloscope screen, though.

3. Jan 26, 2014

### EE4life

Since the signals will have frequencies less than 1 Mhz, I think the digital solution is the easiest for me. However, I was kind of hoping that there would be a off the shelf phase detector for this frequency range (1kHz-1MHz), converting phase to dc voltage signal.

I am currently using a agilent MSO oscilloscope for this measurement. Certainly easy, but expensive. Thank for your comments

4. Jan 26, 2014

### meBigGuy

Last edited by a moderator: May 6, 2017
5. Jan 27, 2014

### sophiecentaur

I'm not sure that's much more than a ring modulator, which is handy for some things (as part of a Phase Mod demodulator in a receiver) but it's hardly a measuring device. It needs a fair amount of support circuitry for it and some serious calibration before it will give a voltage value that's directly related to phase.

@EE4life: if you are after measuring equipment then it's a rather different world. I immediately thought of the Hewlet Packard Vector Voltmeter, which would do the job fine. I think the lowest frequency might fit your requirements (1MHZ to 1GHz, iirc). They are a bit ancient but available on eBay for a few hundred \$ - I had a trip down memory lane, to the 80s when there were two in my lab and used every day.

It's a big jump from a ring modulator to a box that gives you a 'number' for a result and I couldn't find anything in between. You may be lucky with a deeper search using the term Vector voltage measurement etc but it may be necessary to build something yourself.

A 4 quadrant analogue multiplier would be another possible way through. Cheap as chips to buy and there will be many available circuit designs, I'm sure. But circuit building isn't everyone's cup of tea - when you just want a result . . . . .

Last edited by a moderator: May 6, 2017
6. Jan 27, 2014

### Baluncore

Digitise the two signals with a PC sound card or cheap USB dual channel oscilloscope.
Then compute the FFTs of the two channels to get the phases.

If the signal has a complex waveform then there are many ways to process or correlate using FFTs that can determine the precise phase difference.

7. Jan 27, 2014

### EE4life

The off the shelf parts have a low limit of 1MHz.

I am not really a circuit building guy at all. I would rather an arduino do the signal processing for me. Generally, what would the code look like? The signals are sinusoidal. However, an even the new arduino's have a theoretical sampling frequency of 1MHz, which is too small for my application, and who knows about the resolution. A fast DAQ would do it, by at that price, I might as well use a usb oscilloscope

I think I will loop the reading of two analog inputs and note the difference in time between the zero crossings? I would then send an analog output proportional to the time difference. I know the frequency (from func gen) so I can then calculate the phase angle.

8. Jan 27, 2014

### sophiecentaur

That's a good idea. If the signals were clean, you could get away with under sampling and altering the nyquist filter on the adc inputs.

9. Jan 27, 2014

### Baluncore

IIRC the HP Vector Voltmeter used an RF local oscillator to synchronously convert the two channels down to 1 kHz. It then locked it's reference LO using the 1 kHz reference signal and made the phase comparison at 1 kHz.

10. Jan 27, 2014

### sophiecentaur

I seem to remember being hit by the minimum frequency limit on occasions but our interest was largely at IF frequencies of 10.7Mhz or much higher UHF frequencies. As I remember, it was cleverer than just a LO and was based on sampling. It didn't require a wide sweeping LO - just a lot of HP cleverness as to how it locked its sample pulse train (Frequency Comb) in order to get a sensible LF signal to analyse. It was very clever at locking in under all sorts of different circumstances.

The only problem I can see with the FT approach would be if you needed a constant readout of the phase. But it's a great solution as all the hard stuff is soluble with software.

11. Jan 27, 2014

### EE4life

Hmm, so I guess there is not cheap and/or easy solution. I guess I will need to sample the signals quickly and determine the phase digitally. I wish there were a plug and play phase angle to DC converter on the market.

12. Jan 28, 2014

### sophiecentaur

If you filter it right, you can under sample and still get the right answer. This is a bit 'advanced' but is the basis of some sampling scopes. If you are embarrassed for sampling rate then you could look into that possibility. (It is quite 'legit')

13. Jan 30, 2014

### uart

Come on, with a name like EE4Life surely you shouldn't be averse to learning a bit of analog design. ;)

You haven't told us a lot of detail about the nature of the waveforms you're dealing with, noise levels, frequency stability etc. If however your waveforms are reasonably amenable to "squaring up" (not meaning mathematically squaring, but rather converting to square waves via comparator or schmitt trigger) then a simple XOR the two resulting waveforms will give you (when filtered to extract DC) the absolute value of the phase displacement. You can then use a simple D-flipflop (one wave to the D input and the other to the Clk input) to determine the sign of this phase.

Last edited: Jan 30, 2014