DSPRelated.com
Forums

Phase resolution in PLL at audio frequencies

Started by PalapaGuy July 13, 2009
PalapaGuy wrote:
>> PalapaGuy wrote: >> >> I wrote: >> >> ... >> >>>> It appears that you don't need to measure the phase, but rather keep >>>> jitter within limits. Noise-induced jitter of of .1 radian implies a > SNR >>>> of about 20 dB. Surely, you can do better than that with a few Hz >>> bandwidth! >> ... >> >>> Yes that's what I was trying and failing to say. The phase jitter now > is >>> about 0.1 radian after the 10 Hz BPF. I could either narrow the > filter >>> which would take some effort to squeeze out a few more dB of S/N, or > use a >>> PLL with much narrower BW than the filter could give me, since I have > 10 >>> sec or more available for acquisition time. >>> >>> So bottom line: I'm being realistic shooting for 0.1 degrees jitter >>> limit? >> In one sense, a PLL is a very narrow band filter, so yes. On the other >> hand, the more the input signal's phase jitter, the lower the PLL's >> bandwidth needs to be to reach a given spec, and that makes for longer >> acquisition and settling times. >> >> Why not take a different tack altogether? Count zero crossings for ten >> seconds, and determine the average frequency by dividing by ten? That's >> all the information that the signal can yield, so no method can do >> better. A tighter filter will help the end points, so there's maybe a >> factor of two there if you need it. >> >> Jerry >> -- >> Engineering is the art of making what you want from things you can get. > > :o) > > I was planning to do something similar. First, get each zero-crossing > measurement as close as possible using the PLL as a jitter filter, then > measure over a several-second interval and average the results. Although > the phase drifts over the interval (but frequency is relatively constant), > for my purposes all I need is the average phase over the interval.
All you need to count is the number of zero crossings in ten seconds The actual times of the in-between ones don't matter. (Do the math on a simple bunch of numbers and you'll see.) You can improve resolution slightly by starting and ending the count on zero crossings and noting the elapsed time (ten second+delta) if the jitter is low to begin with. The zero crossings of a PLL aren't what you want to measure. They have no use at all until lock is achieved, and the time for that is wasted. Count your jittery signal. Ten seconds worth of 15 KHz 150,000 +/-1 zero crossings. The jitter of the first and last gets lost in that +/-1. You will know the frequency to almost +/- 0.1 Hz, as good as a 10-second measurement can get. You can do a little better by measuring the period for 150,000 counts, as I wrote above. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
PalapaGuy wrote:
>> >> PalapaGuy wrote: >> >>> Hi all. I don't have much background in PLL implementation and would >>> appreciate if someone can refer me to basic info. >>> >>> I need to measure the phase of an unmodulated 15 kHz tone down to 0.1 >>> degree if possible. The tone has decent S/N of about 30-40 dB. For >>> acquisition purposes I know its frequency closely within +/- 1 Hz, and > I >>> can take up to 10-15 seconds to acquire lock. Could do this in either > the >>> analog or digital domain. Is 0.1 deg phase resolution a reasonable > goal? >> The goal can or can not be met depending on how do you define the SNR. >> However the 0.1 deg phase resolution in the audio system is outside of >> the reason. This corresponds to the time delay about 20ns; the phase >> drifts are dozens of times higher then that. >> >> Vladimir Vassilevsky >> DSP and Mixed Signal Design Consultant >> http://www.abvolt.com >> > Yes I understand there will be phase drift (although frequency drift will > be negligible for PLL lock purposes). The phase drift actually is what I > am trying to measure, and I'm trying to achieve 0.1 degree measurement > accuracy of that phase. > > I can't define S/N accurately because it is subject to variation. But > loosely speaking I have about 30-40 dB S/N due to jitter and thermal noise > combined in the filter's noise BW. > > My feeling from the very helpful responses above is that I DO have a shot > at measuring phase to the accuracy I need. Can't hurt to try. Thanks > everyone.
You write about taking 10 seconds to acquire lock and then measuring the PLL. Vladimir is quite right that a single-period measurement accurate to 20ns is out of the question. Count the number of zero crossings in the whole allotted time and the allowed overall uncertainty is multiplied by the number of cycles counted. A PLL would be an impediment. You need only a simple frequency counter (and a VERY accurate time base). In 15 seconds, you will be able to time about 225,000 cycles. If you miss a whole one from end effects, that's still about than 4 ppm. What do you expect the timing accuracy to be? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
>PalapaGuy wrote: >>> >>> PalapaGuy wrote: >>> >>>> Hi all. I don't have much background in PLL implementation and
would
>>>> appreciate if someone can refer me to basic info. >>>> >>>> I need to measure the phase of an unmodulated 15 kHz tone down to
0.1
>>>> degree if possible. The tone has decent S/N of about 30-40 dB. For >>>> acquisition purposes I know its frequency closely within +/- 1 Hz,
and
>> I >>>> can take up to 10-15 seconds to acquire lock. Could do this in
either
>> the >>>> analog or digital domain. Is 0.1 deg phase resolution a reasonable >> goal? >>> The goal can or can not be met depending on how do you define the
SNR.
>>> However the 0.1 deg phase resolution in the audio system is outside
of
>>> the reason. This corresponds to the time delay about 20ns; the phase >>> drifts are dozens of times higher then that. >>> >>> Vladimir Vassilevsky >>> DSP and Mixed Signal Design Consultant >>> http://www.abvolt.com >>> >> Yes I understand there will be phase drift (although frequency drift
will
>> be negligible for PLL lock purposes). The phase drift actually is what
I
>> am trying to measure, and I'm trying to achieve 0.1 degree measurement >> accuracy of that phase. >> >> I can't define S/N accurately because it is subject to variation. But >> loosely speaking I have about 30-40 dB S/N due to jitter and thermal
noise
>> combined in the filter's noise BW. >> >> My feeling from the very helpful responses above is that I DO have a
shot
>> at measuring phase to the accuracy I need. Can't hurt to try. Thanks >> everyone. > >You write about taking 10 seconds to acquire lock and then measuring the
>PLL. Vladimir is quite right that a single-period measurement accurate >to 20ns is out of the question. Count the number of zero crossings in >the whole allotted time and the allowed overall uncertainty is >multiplied by the number of cycles counted. A PLL would be an >impediment. You need only a simple frequency counter (and a VERY >accurate time base). > >In 15 seconds, you will be able to time about 225,000 cycles. If you >miss a whole one from end effects, that's still about than 4 ppm. What >do you expect the timing accuracy to be? > >Jerry >-- >Engineering is the art of making what you want from things you can get. >�����������������������������������������������������������������������
I apologize for doing such a bad job of explaining myself. My plan is to first lock the PLL in order to clean up the phase jitter on the signal. Then, measure individual zero crossing times on the clean PLL output while it's locked, and average those times to obtain the average zero crossing time during that measurement interval of say 10 seconds. My goal is to determine the average zero crossing time during the interval as accurately as possible, not to attempt to measure the time of a single crossing event, nor the frequency of the tone. My time base is not important because I'm making the average phase measurement not on an absolute basis but relative to the same measurement in the same time interval of another signal (with a common time base). The two signals are at very slightly different frequencies. Hence time of measurement of difference in zero crossing times would be important if measuring a single zero crossing, but less important if averaging zero crossing times over a relatively long interval. In essence I'm trying to measure the relative "phase" or timing of two signals at very slightly different frequencies in order to determine their time relationship. I've never heard of this being done, the measurement result probably has no physical meaning, but I'm stuck with the job. :o) Hope this makes sense.
PalapaGuy wrote:
>> PalapaGuy wrote: >>>> PalapaGuy wrote: >>>> >>>>> Hi all. I don't have much background in PLL implementation and > would >>>>> appreciate if someone can refer me to basic info. >>>>> >>>>> I need to measure the phase of an unmodulated 15 kHz tone down to > 0.1 >>>>> degree if possible. The tone has decent S/N of about 30-40 dB. For >>>>> acquisition purposes I know its frequency closely within +/- 1 Hz, > and >>> I >>>>> can take up to 10-15 seconds to acquire lock. Could do this in > either >>> the >>>>> analog or digital domain. Is 0.1 deg phase resolution a reasonable >>> goal? >>>> The goal can or can not be met depending on how do you define the > SNR. >>>> However the 0.1 deg phase resolution in the audio system is outside > of >>>> the reason. This corresponds to the time delay about 20ns; the phase >>>> drifts are dozens of times higher then that. >>>> >>>> Vladimir Vassilevsky >>>> DSP and Mixed Signal Design Consultant >>>> http://www.abvolt.com >>>> >>> Yes I understand there will be phase drift (although frequency drift > will >>> be negligible for PLL lock purposes). The phase drift actually is what > I >>> am trying to measure, and I'm trying to achieve 0.1 degree measurement >>> accuracy of that phase. >>> >>> I can't define S/N accurately because it is subject to variation. But >>> loosely speaking I have about 30-40 dB S/N due to jitter and thermal > noise >>> combined in the filter's noise BW. >>> >>> My feeling from the very helpful responses above is that I DO have a > shot >>> at measuring phase to the accuracy I need. Can't hurt to try. Thanks >>> everyone. >> You write about taking 10 seconds to acquire lock and then measuring the > >> PLL. Vladimir is quite right that a single-period measurement accurate >> to 20ns is out of the question. Count the number of zero crossings in >> the whole allotted time and the allowed overall uncertainty is >> multiplied by the number of cycles counted. A PLL would be an >> impediment. You need only a simple frequency counter (and a VERY >> accurate time base). >> >> In 15 seconds, you will be able to time about 225,000 cycles. If you >> miss a whole one from end effects, that's still about than 4 ppm. What >> do you expect the timing accuracy to be? >> >> Jerry >> -- >> Engineering is the art of making what you want from things you can get. > > I apologize for doing such a bad job of explaining myself. > > My plan is to first lock the PLL in order to clean up the phase jitter on > the signal.
Why bother?
> Then, measure individual zero crossing times on the clean PLL > output while it's locked, and average those times to obtain the average > zero crossing time during that measurement interval of say 10 seconds.
The average of those times is the time between the first and last divided by the number of crossings. If you do the calculation analytically, you will fins that the internal crossing times cancel. The end time of one interval is the beginning of the next.
> My goal is to determine the average zero crossing time during the interval > as accurately as possible, not to attempt to measure the time of a single > crossing event, nor the frequency of the tone.
To determine an accurate average, count the largest possible number of crossings and divide the time by that number. There is no way to improve on that.
> My time base is not important because I'm making the average phase > measurement not on an absolute basis but relative to the same measurement > in the same time interval of another signal (with a common time base). The > two signals are at very slightly different frequencies. Hence time of > measurement of difference in zero crossing times would be important if > measuring a single zero crossing, but less important if averaging zero > crossing times over a relatively long interval.
Right. Measure the time between the first and 200,000th zero crossing and divide by 200,000. PLL is a waste of time.
> In essence I'm trying to measure the relative "phase" or timing of two > signals at very slightly different frequencies in order to determine their > time relationship. I've never heard of this being done, the measurement > result probably has no physical meaning, but I'm stuck with the job. :o) > > Hope this makes sense.
Not to me. Maybe some of the gurus will chime in. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
On Mon, 13 Jul 2009 21:53:00 -0400, Jerry Avins <jya@ieee.org> wrote:

>PalapaGuy wrote:
<clip>
>> >> I apologize for doing such a bad job of explaining myself. >> >> My plan is to first lock the PLL in order to clean up the phase jitter on >> the signal. > >Why bother? > >> Then, measure individual zero crossing times on the clean PLL >> output while it's locked, and average those times to obtain the average >> zero crossing time during that measurement interval of say 10 seconds. > >The average of those times is the time between the first and last >divided by the number of crossings. If you do the calculation >analytically, you will fins that the internal crossing times cancel. The >end time of one interval is the beginning of the next. > >> My goal is to determine the average zero crossing time during the interval >> as accurately as possible, not to attempt to measure the time of a single >> crossing event, nor the frequency of the tone. > >To determine an accurate average, count the largest possible number of >crossings and divide the time by that number. There is no way to improve >on that. > >> My time base is not important because I'm making the average phase >> measurement not on an absolute basis but relative to the same measurement >> in the same time interval of another signal (with a common time base). The >> two signals are at very slightly different frequencies. Hence time of >> measurement of difference in zero crossing times would be important if >> measuring a single zero crossing, but less important if averaging zero >> crossing times over a relatively long interval. > >Right. Measure the time between the first and 200,000th zero crossing >and divide by 200,000. PLL is a waste of time. > >> In essence I'm trying to measure the relative "phase" or timing of two >> signals at very slightly different frequencies in order to determine their >> time relationship. I've never heard of this being done, the measurement >> result probably has no physical meaning, but I'm stuck with the job. :o) >> >> Hope this makes sense. > >Not to me. Maybe some of the gurus will chime in.
Not a guru, but I see a contradiction in the problem statement: either the phase between the two signals is releatively constant over the 10 second measurement interval and the frequency is essentially the same, or the frequency is very slightly different and the phase is changing within 10 seconds. Perhaps what PalapaGuy meant is that the frequency differs *so* slightly that the phase, although changing, changes very little within 10 seconds? If phase is wanted, why not measure phase directly, for example start a counter on the rising edge of one signal and stop on the rising edge of the other, measuring the full period with another counter? If a large number of these are averaged then I agree that a PLL is of no benefit and detrimental if not already locked at the start of the measurement. Measuring the time of a large number of cycles as Jerry suggested will provide a good measure of a very small frequency difference (assuming that the frequency is different enough that the relative phase changes significantly within the 10 second measurement period), but would provide no phase information, which might be desired if the frequency change is *so* small that there is negligible phase change in 10 seconds (what I would think of as constant frequency with variable phase in spite of the theoretical link between phase and frequency).
>On Mon, 13 Jul 2009 21:53:00 -0400, Jerry Avins <jya@ieee.org> wrote: > >>PalapaGuy wrote: ><clip> >>> >>> I apologize for doing such a bad job of explaining myself. >>> >>> My plan is to first lock the PLL in order to clean up the phase jitter
on
>>> the signal. >> >>Why bother? >> >>> Then, measure individual zero crossing times on the clean PLL >>> output while it's locked, and average those times to obtain the
average
>>> zero crossing time during that measurement interval of say 10 seconds.
>> >>The average of those times is the time between the first and last >>divided by the number of crossings. If you do the calculation >>analytically, you will fins that the internal crossing times cancel. The
>>end time of one interval is the beginning of the next. >> >>> My goal is to determine the average zero crossing time during the
interval
>>> as accurately as possible, not to attempt to measure the time of a
single
>>> crossing event, nor the frequency of the tone. >> >>To determine an accurate average, count the largest possible number of >>crossings and divide the time by that number. There is no way to improve
>>on that. >> >>> My time base is not important because I'm making the average phase >>> measurement not on an absolute basis but relative to the same
measurement
>>> in the same time interval of another signal (with a common time base).
The
>>> two signals are at very slightly different frequencies. Hence time
of
>>> measurement of difference in zero crossing times would be important
if
>>> measuring a single zero crossing, but less important if averaging
zero
>>> crossing times over a relatively long interval. >> >>Right. Measure the time between the first and 200,000th zero crossing >>and divide by 200,000. PLL is a waste of time. >> >>> In essence I'm trying to measure the relative "phase" or timing of
two
>>> signals at very slightly different frequencies in order to determine
their
>>> time relationship. I've never heard of this being done, the
measurement
>>> result probably has no physical meaning, but I'm stuck with the job.
:o)
>>> >>> Hope this makes sense. >> >>Not to me. Maybe some of the gurus will chime in. > >Not a guru, but I see a contradiction in the problem statement: either >the phase between the two signals is releatively constant over the 10 >second measurement interval and the frequency is essentially the same, >or the frequency is very slightly different and the phase is changing >within 10 seconds. Perhaps what PalapaGuy meant is that the frequency >differs *so* slightly that the phase, although changing, changes very >little within 10 seconds? If phase is wanted, why not measure phase >directly, for example start a counter on the rising edge of one signal >and stop on the rising edge of the other, measuring the full period >with another counter? If a large number of these are averaged then I >agree that a PLL is of no benefit and detrimental if not already >locked at the start of the measurement. > >Measuring the time of a large number of cycles as Jerry suggested will >provide a good measure of a very small frequency difference (assuming >that the frequency is different enough that the relative phase changes >significantly within the 10 second measurement period), but would >provide no phase information, which might be desired if the frequency >change is *so* small that there is negligible phase change in 10 >seconds (what I would think of as constant frequency with variable >phase in spite of the theoretical link between phase and frequency).
Yes, counting cycles over a long interval would give frequency but not phase information, and it's phase that I need. The frequencies are highly stable and considered constant. Let me explain this way. Assume for the moment f1=f2. I need to know the relative timing (zero crossing times) of the two waveforms. Simple, just measure each waveform's individual zero crossing times over a 10 sec interval, average, and compare. Making lots of measurements and averaging is more accurate than trying to measure the time of just a single crossing in each waveform. (The PLL might provide cleaner edges and better accuracy of zero crossing measurements, but this is a separate issue.) Now change one frequency by 0.005%. I still need to know the relative timing between the signals, and I don't see why I can't still use the previous procedure. In this case the result of the calculation should still be equally valid to define the relative average time relationship of the two waveforms during the interval even though the relationship is changing cycle by cycle. Am I wrong?
PalapaGuy wrote:
>> On Mon, 13 Jul 2009 21:53:00 -0400, Jerry Avins <jya@ieee.org> wrote: >> >>> PalapaGuy wrote: >> <clip> >>>> I apologize for doing such a bad job of explaining myself. >>>> >>>> My plan is to first lock the PLL in order to clean up the phase jitter > on >>>> the signal. >>> Why bother? >>> >>>> Then, measure individual zero crossing times on the clean PLL >>>> output while it's locked, and average those times to obtain the > average >>>> zero crossing time during that measurement interval of say 10 seconds. > >>> The average of those times is the time between the first and last >>> divided by the number of crossings. If you do the calculation >>> analytically, you will fins that the internal crossing times cancel. The > >>> end time of one interval is the beginning of the next. >>> >>>> My goal is to determine the average zero crossing time during the > interval >>>> as accurately as possible, not to attempt to measure the time of a > single >>>> crossing event, nor the frequency of the tone. >>> To determine an accurate average, count the largest possible number of >>> crossings and divide the time by that number. There is no way to improve > >>> on that. >>> >>>> My time base is not important because I'm making the average phase >>>> measurement not on an absolute basis but relative to the same > measurement >>>> in the same time interval of another signal (with a common time base). > The >>>> two signals are at very slightly different frequencies. Hence time > of >>>> measurement of difference in zero crossing times would be important > if >>>> measuring a single zero crossing, but less important if averaging > zero >>>> crossing times over a relatively long interval. >>> Right. Measure the time between the first and 200,000th zero crossing >>> and divide by 200,000. PLL is a waste of time. >>> >>>> In essence I'm trying to measure the relative "phase" or timing of > two >>>> signals at very slightly different frequencies in order to determine > their >>>> time relationship. I've never heard of this being done, the > measurement >>>> result probably has no physical meaning, but I'm stuck with the job. > :o) >>>> Hope this makes sense. >>> Not to me. Maybe some of the gurus will chime in. >> Not a guru, but I see a contradiction in the problem statement: either >> the phase between the two signals is releatively constant over the 10 >> second measurement interval and the frequency is essentially the same, >> or the frequency is very slightly different and the phase is changing >> within 10 seconds. Perhaps what PalapaGuy meant is that the frequency >> differs *so* slightly that the phase, although changing, changes very >> little within 10 seconds? If phase is wanted, why not measure phase >> directly, for example start a counter on the rising edge of one signal >> and stop on the rising edge of the other, measuring the full period >> with another counter? If a large number of these are averaged then I >> agree that a PLL is of no benefit and detrimental if not already >> locked at the start of the measurement. >> >> Measuring the time of a large number of cycles as Jerry suggested will >> provide a good measure of a very small frequency difference (assuming >> that the frequency is different enough that the relative phase changes >> significantly within the 10 second measurement period), but would >> provide no phase information, which might be desired if the frequency >> change is *so* small that there is negligible phase change in 10 >> seconds (what I would think of as constant frequency with variable >> phase in spite of the theoretical link between phase and frequency). > > > Yes, counting cycles over a long interval would give frequency but not > phase information, and it's phase that I need. The frequencies are highly > stable and considered constant. > > Let me explain this way. Assume for the moment f1=f2. I need to know the > relative timing (zero crossing times) of the two waveforms. Simple, just > measure each waveform's individual zero crossing times over a 10 sec > interval, average, and compare. Making lots of measurements and averaging > is more accurate than trying to measure the time of just a single crossing > in each waveform. (The PLL might provide cleaner edges and better accuracy > of zero crossing measurements, but this is a separate issue.) > > Now change one frequency by 0.005%. I still need to know the relative > timing between the signals, and I don't see why I can't still use the > previous procedure. In this case the result of the calculation should > still be equally valid to define the relative average time relationship of > the two waveforms during the interval even though the relationship is > changing cycle by cycle. > > Am I wrong?
Yes. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
On Jul 14, 9:41&#4294967295;am, "PalapaGuy" <gmwemail-...@yahoo.com> wrote:
> >On Mon, 13 Jul 2009 21:53:00 -0400, Jerry Avins <j...@ieee.org> wrote: > > >>PalapaGuy wrote: > ><clip> > > >>> I apologize for doing such a bad job of explaining myself. > > >>> My plan is to first lock the PLL in order to clean up the phase jitter > on > >>> the signal. &#4294967295; > > >>Why bother? > > >>> Then, measure individual zero crossing times on the clean PLL > >>> output while it's locked, and average those times to obtain the > average > >>> zero crossing time during that measurement interval of say 10 seconds. > > >>The average of those times is the time between the first and last > >>divided by the number of crossings. If you do the calculation > >>analytically, you will fins that the internal crossing times cancel. The > >>end time of one interval is the beginning of the next. > > >>> My goal is to determine the average zero crossing time during the > interval > >>> as accurately as possible, not to attempt to measure the time of a > single > >>> crossing event, nor the frequency of the tone. &#4294967295; > > >>To determine an accurate average, count the largest possible number of > >>crossings and divide the time by that number. There is no way to improve > >>on that. > > >>> My time base is not important because I'm making the average phase > >>> measurement not on an absolute basis but relative to the same > measurement > >>> in the same time interval of another signal (with a common time base). > &#4294967295;The > >>> two signals are at very slightly different frequencies. &#4294967295;Hence time > of > >>> measurement of difference in zero crossing times would be important > if > >>> measuring a single zero crossing, but less important if averaging > zero > >>> crossing times over a relatively long interval. > > >>Right. Measure the time between the first and 200,000th zero crossing > >>and divide by 200,000. PLL is a waste of time. > > >>> In essence I'm trying to measure the relative "phase" or timing of > two > >>> signals at very slightly different frequencies in order to determine > their > >>> time relationship. &#4294967295;I've never heard of this being done, the > measurement > >>> result probably has no physical meaning, but I'm stuck with the job. &#4294967295; > :o) > > >>> Hope this makes sense. > > >>Not to me. Maybe some of the gurus will chime in. > > >Not a guru, but I see a contradiction in the problem statement: either > >the phase between the two signals is releatively constant over the 10 > >second measurement interval and the frequency is essentially the same, > >or the frequency is very slightly different and the phase is changing > >within 10 seconds. &#4294967295;Perhaps what PalapaGuy meant is that the frequency > >differs *so* slightly that the phase, although changing, changes very > >little within 10 seconds? &#4294967295;If phase is wanted, why not measure phase > >directly, for example start a counter on the rising edge of one signal > >and stop on the rising edge of the other, measuring the full period > >with another counter? &#4294967295;If a large number of these are averaged then I > >agree that a PLL is of no benefit and detrimental if not already > >locked at the start of the measurement. &#4294967295; > > >Measuring the time of a large number of cycles as Jerry suggested will > >provide a good measure of a very small frequency difference (assuming > >that the frequency is different enough that the relative phase changes > >significantly within the 10 second measurement period), but would > >provide no phase information, which might be desired if the frequency > >change is *so* small that there is negligible phase change in 10 > >seconds (what I would think of as constant frequency with variable > >phase in spite of the theoretical link between phase and frequency). > > Yes, counting cycles over a long interval would give frequency but not > phase information, and it's phase that I need. &#4294967295;The frequencies are highly > stable and considered constant. > > Let me explain this way. &#4294967295;Assume for the moment f1=f2. &#4294967295;I need to know the > relative timing (zero crossing times) of the two waveforms. &#4294967295;Simple, just > measure each waveform's individual zero crossing times over a 10 sec > interval, average, and compare. &#4294967295;Making lots of measurements and averaging > is more accurate than trying to measure the time of just a single crossing > in each waveform. &#4294967295;(The PLL might provide cleaner edges and better accuracy > of zero crossing measurements, but this is a separate issue.) > > Now change one frequency by 0.005%. &#4294967295;I still need to know the relative > timing between the signals, and I don't see why I can't still use the > previous procedure. &#4294967295;In this case the result of the calculation should > still be equally valid to define the relative average time relationship of > the two waveforms during the interval even though the relationship is > changing cycle by cycle.
If your 2 frequencies differ, then the relative phase will change with time. Therefore the answer is to use a random number generator that can produce any value between -pi and pi, as there is guaranteed to exist a point in time where that answer is perfectly accurate. It will save you all the work of measuring everything except that the frequencies, in fact, are not equal. If that answer is unsuitable, why?