Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PLL and phase difference measurement

Status
Not open for further replies.

vaka85

Advanced Member level 4
Joined
May 9, 2008
Messages
100
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,112
Hello,

I have to measure the phase difference between two sine waves, frequency about 1 MHz.
Since they have low SNR values, it's very hard to see them in the scope, and so save them.

So I was thinking if it's possibile to use a PLL to fix the phase of one of the two signals, and measure the phase shift from it.
Even if it's noisy in the scope, if I save it, then I can processate it in the pc, because I'm sure that the phase is fixed.
I have never used a PLL, and honestly I don't know for sure if it's useful in my case, because on the web everyone use PLL to detect frequency differences, and not phase differences..

What do you think?

Thank you
 

Possibly you can use a mathematical approach. You have two signals at the same angular frequency "w", let's say

s1=A*sin(wt)+noise1
s2=B*sin(wt+phi)+noise2.

Their difference, applying some simple trigonometric, is

s1-s2=sin(wt)*[A-B*cos(phi)]-B*cos(wt)*sin(phi)+Noise

then the amplitude of the difference is:

C = sqrt{[A-B*cos(phi)]^2 + sin(phi)^2+NoiseAmplitude^2} = sqrt[A^2+B^2-2*A*B*cos(phi)+NoiseAmplitude^2]

A, B and C can be measured by FFT (measuring the peak at the wanted frequency) that can be performed by the oscilloscope itself, or by means of tools such as Matlab or Scilab on the acquired samples. In this way the noise is excluded by the calculation, then solving with respect to phi:

phi = 0.5*arccos{[A^2+B^2-C^2]/(2*A*B)}
 
Last edited:

yes, you're right, but my main problem is that the scope isn't very advanced, and when the input signal snr is low, then it works bad. Its FFT function isn't reliable, and so I have to use Matlab.
SNR low -> trigger doesn't work -> I save a signal that has phase noise + "all the other noise".

But I have to save a "good" signal from the scope.
Since the phase difference between the 2 signals is (in time) of a few nanosec, a little variation means that the phase of the sampled signal isn't the realistic one.
So I thinked to "fix" the phase of the signal, in that way the only variation is due to environment noise, and not phase noise.. So I can save the sampled signal and work on it on matlab..
But I don't know if PLL is the correct solution.

I hope I was clear..

It seems that a lock in amplifier should be fine for my purposes, but it's a very expensive instrument..
 

If you put the two outputs to a mixer you will get a DC and a 2X output.
Filter for the DC, and do a calibration of DC voltage vs phase error using
some fixed delay -> static phase -> DC voltage points.
 

I'm not sure to have correctly understood what you want to measure. The two signals have a fixed phase difference or it is varying with time ?
If the phase difference is fixed you can apply the mathematical method just acquiring the two signals at the same time, using two channel of the oscilloscope regardless to the triggering (use single-sweep to acquire, then save).
Then the processing (FFT and channel difference) can be done in Matlab. Of course the time base have to be large enought to allow the capture of some period (f.i 10 us/div).
Since you want to measure small phase shift (1 degrees or less) you have to calibrate the oscilloscope itself inputting the same signal to both channels and applying the mathematical procedure. What about you SNR (roughly) ? What about the oscilloscope ?
I think PLL method could be quite complex and prone to errors.
 

the phase difference between the two signals is fixed.

If the phase difference is fixed you can apply the mathematical method just acquiring the two signals at the same time, using two channel of the oscilloscope regardless to the triggering (use single-sweep to acquire, then save).

but if I don't trigger the signal, how can I be sure that the phase measured is correct?
Since the signals are very noisy, their original phase difference is fixed, but at the scope doesn't! Every channel has phase noise, so what I save is a signal in which you have real phase+phase noise...

Since you want to measure small phase shift (1 degrees or less) you have to calibrate the oscilloscope itself inputting the same signal to both channels
Sorry, I don't understand this..

What about you SNR (roughly) ? What about the oscilloscope ?
I don't remember exactly (I haven't got the data now), maybe the signal is over the noise of about 20 dBm. Noise floor is about -30 dBm...
The oscilloscope is a simple one, from tektronix: TDS1012B..


Thanks
 

You will use the oscilloscope only to digitize the signals and make they availabble to further elaboration (in Matlab). The proposed math doesn't directly take into account the phase difference, that is calculated from the relative amplitude of the single signals and of their difference. This means the two vectors representing the signals must be acquired at the same time but doesn't matter where they start. The oscilloscope trigger just assure that CH1 (or CH2) will start on a defind point, but it is not required for the propsed method.
A problem could be due to the the fact that the two channels of the oscilloscope are not ideal, then they don't behave exactly the same in terms of amplitude and phase. So a calibration is probably needed to reach the wanted accuracy. To do this you can generate a signal from a signal generator at the almost the same amplitude and frequency of the two you want to measure. Split it into two ways by means of a resistive splitter and send the two branch of the splitter to each of the two channel of the oscilloscope using two coaxial cables of the same length. Then apply the procedure. If all is ideal you should see the same amplitude A and B (please see the math in my previous post) you will measure a phase difference equal to 0. Probably, instead, you will get A very close, but not equal to B and a little but not zero phase difference.
Remove then the cable from the signal generator and aplly the real signal. Apply the math and use the small value measured during calibration as correction factor for amplitude and phase.
 
  • Like
Reactions: vaka85

    vaka85

    Points: 2
    Helpful Answer Positive Rating
Ok, thank you for the exaustive explanation.
However I've already tried to use signals without considering the trigger. But the measured phases (with matlab) are completely random.. That's why I thinked about a PLL..

One question about PLL: it's very hard to find a PLL NOT digital... ne560 seems to be fine for me, but it's very old and almost impossible to find. Do you know any newer model of analog PLL that works around 1 MHz?

Thanks
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top