DSPRelated.com
Forums

Accurate frequency measurement problem

Started by Unknown February 11, 2016
On Fri, 12 Feb 2016 19:51:07 -0600, Tim Wescott <tim@seemywebsite.com>
wrote:

>On Fri, 12 Feb 2016 23:45:24 +0000, Eric Jacobsen wrote: > >> On Fri, 12 Feb 2016 16:48:42 -0600, Tim Wescott <tim@seemywebsite.com> >> wrote: >> >>>On Thu, 11 Feb 2016 20:35:33 +0000, Eric Jacobsen wrote: >>> >>>> There's really not much way around the time-frequency uncertainty >>>> principle; the more estimation accuracy you need, the longer you need >>>> to observe the signal. >>> >>>I beg to differ, at least on a detail: there's no way around the time- >>>frequency-noise uncertainty. If you have a purely noiseless measurement >>>of a perfect sine wave, then you need only four measurements to get an >>>exact result (three, I'm pretty sure, if the middle measurement is not >>>at phase = 0 or phase = pi). >> >> That requires that the frequency is not changing during the observation. >> >> Time-frequency uncertainty is just that you can't simultaneously get >> ultimate resolution in both domains. So if the frequency is changing, >> at all, you can't get a simultaneous high-resultion measure of when it >> is at a particular frequency, or what the frequency might be at a given >> time. It is intuitive in the difference between the shape of an >> impulse and a constant tone (or a horizontal line), which are, not >> coincidentally, transforms of each other. >> >> If you want the impulse for high time resolution, you can't >> simultaneously have high frequency resolution. >> >> It really is intuitive, and extending the logic it applies to many (or >> maybe even most) frequency estimation problems since the need for the >> estimation is because the frequency may change. >> >> In this case the frequency stability is high, so the time motion is slow >> and the ability to get high frequency resolution is very good. In the >> limit of estimation capabilitites, however, the principle still applies. > >Ah. That's what you meant. Yes, a rapidly varying frequency would screw >things up, particularly if the amplitude varies with frequency (more >missing information in the problem statement!). I think that a DPLL, or >any number of "batch" measurement methods could still get an accurate- >enough measure of the average frequency within a 1-second window, >assuming low enough noise and distortion.
"Rapidly varying" is always relative. The time-frequency uncertainty behavior is also present in PLLs, since for close frequency tracking (or estimation) the loop BW is small, so the time constant is long. Likewise if the loop needs to respond quickly in time, the bandwidth gets wider, the time constant is shorter, and frequency stability drops. And, yeah, there's definitely a big dependence on SNR.
>>>If it were just time-frequency then there wouldn't be enough information >>>in a 1-second chuck to make the determination. >>> >>>> 10ppb is pretty tight. >>> >>>Yea verily. >>> >>>> The DPLL does this by "observing" the signal from the time you turn it >>>> on, so it is continually converging up to the limits of the system >>>> (i.e., stability of the reference, numerical precision, etc.). >>> >>>Well... >>> >>>A DPLL will exponentially weigh the effect of the samples, so it'll >>>effectively "forget" old readings, with the forgetting time being >>>proportional to the inverse of the loop bandwidth. One easy way to >>>screw up the measurements would be to have a too-loose loop bandwidth >>>that lets too much noise through. Another easy way would be to have a >>>too-tight bandwidth that doesn't track changes fast enough. >> >> Yup, hence careful analysis and design is imperative.
I wanted to add a small thought here. A PLL has the capability of remembering for infinite time, which was why I stated the above like I did. For example, a loop with a pole on the unit circle will ring forever if perturbed by something like an impulse or step. Also a DPLL that tracks frequency by leaking the integrator content into the Phase Increment Register of the NCO/DDS makes that frequency update potentially permanent. In any case, from that perspective the system has "memory" of events that could have happened far longer ago than the inverse of the loop bandwidth or many multiples of the time constant. Anyway. not a big deal, just wanted to mention it. Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
On Fri, 12 Feb 2016 12:28:43 +0000 (UTC), spope33@speedymail.org
(Steve Pope) wrote:

>Eric Jacobsen <eric.jacobsen@ieee.org> wrote: > >>On Thu, 11 Feb 2016 22:31:21 +0000 (UTC), spope33@speedymail.org > >>><a.turowski@ymail.com> wrote: > >>>>Mako, >>>>I fail to see how PLL would help me in solving the problem. > >>>That's right, a PLL does not help solve this problem. You do >>>not need to track this sinusoid; you do not need to generate >>>a clock with a defined relationships to the sinusoid. You do >>>not need/want a PLL. > >>Actually, a properly designed PLL provides everything he needs and >>more, so I don't see how it does not help solve the problem. >>Depending on details it might not be the most efficient solution (I >>don't think we know enough to know whether it is or isn't), but from >>what's been given I think your statement is incorrect. > >Well, my instinct is to not use a feedback-based algorithm in a >situation that can be fully addressed with a feed-forward >algorithm. > >In this particular problem, a PLL will always have a small amount >of frequency wander that needs to be damped or otherwise minimized >(again, because of the feedback inherenet in a PLL) and I do >not see why the designer would want to buy into this sort of >artifact when they don't have to. > >Maybe I am missing something however. > >Steve
Just as a FWIW FYI, many laboratory high-stability frequency standards have PLLs in them or use a PLL to generate the reference. These days the typical laboratory frequency reference uses a decent oscillator that is then phase-locked to the 1pps GPS signal to get the equivalent stability of the cesium oscillators in the GPS satellites. Like one of these, but there are all kinds to pick from: http://us.flukecal.com/gps-frequency-standard-reference Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
On Fri, 12 Feb 2016 01:45:52 -0800 (PST), a.turowski@ymail.com wrote:

>W dniu czwartek, 11 lutego 2016 17:22:05 UTC u=C5=BCytkownik Tim Wescott na= >pisa=C5=82: >> On Thu, 11 Feb 2016 07:33:24 -0800, a.turowski wrote: >>=20 >> > W dniu czwartek, 11 lutego 2016 13:42:02 UTC u=C5=BCytkownik >> > mako...@yahoo.com napisa=C5=82: >> >> On Thursday, February 11, 2016 at 7:14:42 AM UTC-5, Tauno Voipio wrote= >: >> >> > On 11.2.16 12:21, a.turowski@ymail.com wrote: >> >> > > Hi all, >> >> > > >> >> > > Recently I've been faced with a problem of very accurate sine wave >> >> > > frequency measurement. Let me give you some details: >> >> > > I've got a sensor which outputs measurement result as a frequency >> >> > > of a sine wave. The frequency of the signal is within 149.4kHz - >> >> > > 150.6kHz range and is very stable, as sensed parameter changes ver= >y >> >> > > slowly. Say the frequency can change no more than tens of ppb >> >> > > (parts per billion) per second. Also the signal amplitude should b= >e >> >> > > very stable - it may vary very slowly with temperature. The goal i= >s >> >> > > to measure the frequency to 10-100ppb accuracy at least every >> >> > > second - it may be just a frequency change or if possible, absolut= >e >> >> > > frequency value. Lets denote the frequency we want to measure as f= >. >> >> > > >> >> > > I spent some time thinking about a solution and here is the idea I >> >> > > came up with. Lets assume that I undersample the signal using 5kHz >> >> > > sampling frequency. Then I use FFT to estimate roughly what the >> >> > > signal frequency is. Lets denote it as f_approx. Using automatic >> >> > > gain control I make sure that incoming signal has known and stable >> >> > > amplitude. Lets denote this signal as sig_in_agc. In digital domai= >n >> >> > > I generate a sine wave of frequency f_approx and the same amplitud= >e >> >> > > as sig_in_agc. Lets denote this signal as sig_approx. Next step is >> >> > > to multiply sig_in_agc by sig_approx. This is a standard mixing, >> >> > > which gives me a signal which is the sum of two cosines: one havin= >g >> >> > > frequency equal to f_approx+f, the other f_approx-f. Then I filter >> >> > > out the high frequency component with low pass filter and as a >> >> > > result I get only a signal which frequency is the difference >> >> > > between f_approx-f. Lets denote it f_diff. Actually this signal >> >> > > represents the instantaneous phase difference between sig_in_agc >> >> > > and sig_app >> >> > rox. I sample this phase difference periodically and then can >> >> > calculate the f_diff as a derivative over time of the phase >> >> > difference. >> >> > > >> >> > > Do you think that above makes any sense? Are there other (better) >> >> > > methods that you can recommend to measure the frequency accurately= >? >> >> > > >> >> > > Best regards, >> >> > > Adam Turowski >> >> >=20 >> >> >=20 >> >> > How about getting a reference-quality 150 kHz complex oscillator and >> >> > doing I/Q mixing with it? You'll get an analytic signal (two >> >> > channels) >> >> > of -600 Hz to 600 Hz, which should then be sampled with good >> >> > high-resolution A/D converters. >> >> >=20 >> >> > You have to follow the phase of the signal to get ppb frequency >> >> > changes every second. >> >> >=20 >> >> > Your frequency reference will be critical at ppb accuracy levels. >> >> >=20 >> >> > -- >> >> >=20 >> >> > -Tauno Voipio >> >>=20 >> >> right.. >> >>=20 >> >> OP...fundamentally, if you are measueing the absolute frq, you will >> >> need a reference with accuracy better than what you are trying to >> >> read.... >> >>=20 >> >> or >> >>=20 >> >> if you are measuring only changes, then you will still need a referenc= >e >> >> with STABILITY better than what you are trying to read. >> >>=20 >> >> next, is filter the BW to as low as possible, if the changes are slow, >> >> some type of PLL or tracking filter where the loop BW is very narrow. >> >>=20 >> >> no free lunch >> >>=20 >> >> M >> >=20 >> > Hi all, >> >=20 >> > Thank you for the responses. Yes, I realize that the frequency referenc= >e >> > is critical here (or at least its short term stability if I only measur= >e >> > frequency changes). >> >=20 >> > Evgeny, >> >=20 >> > Thank you for the hint about noise increase when doing undersampling. I >> > think I will have to consider using say 1MHz sampling frequency and the= >n >> > down-converting, low pass filtering and decimating in the digital >> > domain. >> >=20 >> > Tauno, >> > I think that using external analog I/Q mixer may not be a very good ide= >a >> > in my application. The reason is that I have to be measure the phase >> > very precisely and I feel that having to have two mixers (one for I the >> > other for Q) will introduce phase mismatches obscuring actual >> > measurement. Anyway, thanks for the suggestion. >>=20 >> I think you're best off to keep things in the digital domain as much as= >=20 >> possible. If you need mixing, do it in digital-land. >>=20 >> > Mako, >> > I fail to see how PLL would help me in solving the problem. I understan= >d >> > that one could infer the phase difference between signals from the >> > voltage/signal driving VCO/NCO, but it wouldn't be easy. I think that >> > the solution I've proposed originally would give me the same answer >> > without having to go through PLL behavior analysis (this is usually a >> > very hard to crack problem). >>=20 >> Phase-locked loop analysis is _easy_ if you have the chops. Lock to the= >=20 >> signal, then "infer" the frequency by looking at the frequency of your=20 >> reference. >>=20 >> I don't think you need a super-fancy PLL here. >>=20 >> > Any other ideas? >>=20 >> Get a good book on PLL theory and read it. >>=20 >> --=20 >>=20 >> Tim Wescott >> Wescott Design Services >> http://www.wescottdesign.com > >Hi Tim, > >Can you recommend any good book on PLL theory and/or DPLL design? > >Best regards, >Adam
Phaselock Techniques, by Gardner - oft referenced. The latest versions, at least from the third edition, have sections for DPLLs, which is helpful. A short presentation on some 2nd-order DPLL design processes that may or may not be helpful is here: http://www.compdsp.com/presentations/Jacobsen/abineau_dpll_analysis.pdf I think there are other, modern PLL texts that also include DPLL techniques, but I don't have specific titles for you. Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
Eric Jacobsen <eric.jacobsen@ieee.org> wrote:

>Just as a FWIW FYI, many laboratory high-stability frequency standards >have PLLs in them or use a PLL to generate the reference. These days >the typical laboratory frequency reference uses a decent oscillator >that is then phase-locked to the 1pps GPS signal to get the equivalent >stability of the cesium oscillators in the GPS satellites. > >Like one of these, but there are all kinds to pick from: > >http://us.flukecal.com/gps-frequency-standard-reference
Good point. The OP did not say what sort of costs or volume contraints exist; to build exactly one of these items, a connectorized system using something like the Fluke timebase might make a lot of sense. But crystal ovens can achieve 0.01 ppm, and are less costly. So if you had to build say 100 of the devices, the device could contain a crystal oven timebase; but to produce the devices would require a calibration procedure, and for that, you would need something like the Fluke or a similarly precise timebase. (I was assuming without proper evidence that the OP is designing a device for production.) Steve
On 2/12/2016 9:13 PM, Cedron wrote:
> [...snip...] > >> Ah. That's what you meant. Yes, a rapidly varying frequency would screw > >> things up, particularly if the amplitude varies with frequency >-- > > [...snip...] > >> www.wescottdesign.com > > The OP stated that the frequency doesn't vary that rapidly and the > amplitude stays constant. > > I come at this from a mathematical perspective, not a practical one, > meaning I don't have that deep of an understanding of how ADC circuits > really function in these situations. I have my doubts that any ADC > circuit sampling at 5 kHz is going to accurately capture signal values > from a ~150 kHz tone.
There are ADC designs that are suitable for undersampling a 150 kHz signal and there are some that are not so suitable. Generally such a design would use a track and hold so the ADC doesn't see a changing input during the aperture window.
> Since the OP only needs readings every second, I wonder why the signal > frequency needs to be so high. It sounds like a system that is using a > VCO (voltage controlled oscillator) to measure some physical property. It > would seem that he would be better off, if possible, to redesign the > hardware with a much lower frequency, and sample at a higher frequency. > If the frequency were brought down to around 10 kHz, a standard 44.1 kHz > sound card would be more than adequate for the job. The precision would > probably improve too.
There seem to be lots of tradeoffs and 100 ppb is an ambitious goal. -- Rick
W dniu niedziela, 14 lutego 2016 06:16:51 UTC u&#380;ytkownik rickman napisa&#322;:
> On 2/12/2016 9:13 PM, Cedron wrote: > > [...snip...] > > > >> Ah. That's what you meant. Yes, a rapidly varying frequency would screw > > > >> things up, particularly if the amplitude varies with frequency >-- > > > > [...snip...] > > > >> www.wescottdesign.com > > > > The OP stated that the frequency doesn't vary that rapidly and the > > amplitude stays constant. > > > > I come at this from a mathematical perspective, not a practical one, > > meaning I don't have that deep of an understanding of how ADC circuits > > really function in these situations. I have my doubts that any ADC > > circuit sampling at 5 kHz is going to accurately capture signal values > > from a ~150 kHz tone. > > There are ADC designs that are suitable for undersampling a 150 kHz > signal and there are some that are not so suitable. Generally such a > design would use a track and hold so the ADC doesn't see a changing > input during the aperture window. > > > > Since the OP only needs readings every second, I wonder why the signal > > frequency needs to be so high. It sounds like a system that is using a > > VCO (voltage controlled oscillator) to measure some physical property. It > > would seem that he would be better off, if possible, to redesign the > > hardware with a much lower frequency, and sample at a higher frequency. > > If the frequency were brought down to around 10 kHz, a standard 44.1 kHz > > sound card would be more than adequate for the job. The precision would > > probably improve too. > > There seem to be lots of tradeoffs and 100 ppb is an ambitious goal. > > -- > > Rick
Hi all, I was really busy for couple of days and couldn't check my emails. Sorry about that. In general the problem I've described in OP is just one of the problems that need to be solved in lot bigger system. I've shared the details of this problem with the group because: 1) it is an interesting problem and I know that the forum likes that kind of puzzles 2) I needed to get a second opinion about do ability of that kind of thing and what details are missing I think we all arrived to the conclusion that it all should be doable. The bigger system is now at the very early stage of feasibility study. That is why I didn't have a complete set of data regarding requirements or signal properties. In couple of weeks I will have a meeting with people who designed the sensor. This would be the opportunity to ask for more data regarding sensor operation, so if you have any questions you want me to ask, shoot away. I will try do my best to extract the information out of them and share that with the group if possible. Best regard, Adam
<a.turowski@ymail.com> wrote:

>I think we all arrived to the conclusion that it all should be doable. >The bigger system is now at the very early stage of feasibility study. >That is why I didn't have a complete set of data regarding requirements >or signal properties. In couple of weeks I will have a meeting with >people who designed the sensor. This would be the opportunity to ask for >more data regarding sensor operation, so if you have any questions you >want me to ask, shoot away.
One thing you may need is requirements collapse. That is, if your part of the system requires a timebase good to 0.01 ppm, it may be that other parts of the system require similarly accurate timebases. Perhaps there needs to be a system-wide timebase generator, distinct from your module, since if you "own" the entire timebase problem, your part of the system might appear disproportionately expensive. Another thing you may want to consider is whether you need live calibration -- that is, when employing the sensor, you alternate between a calibration phase (which could be infrequent) and measurement phase. This might make life easier. Good luck. Steve
On 15.2.16 22:54, Steve Pope wrote:
> <a.turowski@ymail.com> wrote: > >> I think we all arrived to the conclusion that it all should be doable. >> The bigger system is now at the very early stage of feasibility study. >> That is why I didn't have a complete set of data regarding requirements >> or signal properties. In couple of weeks I will have a meeting with >> people who designed the sensor. This would be the opportunity to ask for >> more data regarding sensor operation, so if you have any questions you >> want me to ask, shoot away. > > One thing you may need is requirements collapse. That is, if your part > of the system requires a timebase good to 0.01 ppm, it may be that other > parts of the system require similarly accurate timebases. Perhaps > there needs to be a system-wide timebase generator, distinct from your > module, since if you "own" the entire timebase problem, your part of > the system might appear disproportionately expensive. > > Another thing you may want to consider is whether you need live > calibration -- that is, when employing the sensor, you alternate > between a calibration phase (which could be infrequent) and > measurement phase. This might make life easier. > > Good luck. > > Steve
I just wonder what may be a physical system supplying the frequency to be measured to an accuracy in the ppb class, except a frequency standard. -- -TV
On Tue, 16 Feb 2016 10:03:49 +0200, Tauno Voipio wrote:

> On 15.2.16 22:54, Steve Pope wrote: >> <a.turowski@ymail.com> wrote: >> >>> I think we all arrived to the conclusion that it all should be doable. >>> The bigger system is now at the very early stage of feasibility study. >>> That is why I didn't have a complete set of data regarding >>> requirements or signal properties. In couple of weeks I will have a >>> meeting with people who designed the sensor. This would be the >>> opportunity to ask for more data regarding sensor operation, so if you >>> have any questions you want me to ask, shoot away. >> >> One thing you may need is requirements collapse. That is, if your part >> of the system requires a timebase good to 0.01 ppm, it may be that >> other parts of the system require similarly accurate timebases. >> Perhaps there needs to be a system-wide timebase generator, distinct >> from your module, since if you "own" the entire timebase problem, your >> part of the system might appear disproportionately expensive. >> >> Another thing you may want to consider is whether you need live >> calibration -- that is, when employing the sensor, you alternate >> between a calibration phase (which could be infrequent) and measurement >> phase. This might make life easier. >> >> Good luck. >> >> Steve > > > I just wonder what may be a physical system supplying the frequency to > be measured to an accuracy in the ppb class, except a frequency > standard.
The 10ppb figure does become suspicious, doesn't it? Some measurement system that depends on something like a piezo-electric crystal or a mechanical resonator changing it's resonant frequency in response to the parameter being measured jumps to mind. If I'm measuring to "100ppb, 10ppb preferred" then I probably have a total error budget of 1ppm or so, and I want the frequency measurement part of that error budget to be somewhere between definitely small enough and not a worry at all. I could see such a system being valid if it had temperature compensation, or if it were measuring temperature. -- www.wescottdesign.com
On 16.2.16 18:00, Tim Wescott wrote:
> On Tue, 16 Feb 2016 10:03:49 +0200, Tauno Voipio wrote: > >> On 15.2.16 22:54, Steve Pope wrote: >>> <a.turowski@ymail.com> wrote: >>> >>>> I think we all arrived to the conclusion that it all should be doable. >>>> The bigger system is now at the very early stage of feasibility study. >>>> That is why I didn't have a complete set of data regarding >>>> requirements or signal properties. In couple of weeks I will have a >>>> meeting with people who designed the sensor. This would be the >>>> opportunity to ask for more data regarding sensor operation, so if you >>>> have any questions you want me to ask, shoot away. >>> >>> One thing you may need is requirements collapse. That is, if your part >>> of the system requires a timebase good to 0.01 ppm, it may be that >>> other parts of the system require similarly accurate timebases. >>> Perhaps there needs to be a system-wide timebase generator, distinct >>> from your module, since if you "own" the entire timebase problem, your >>> part of the system might appear disproportionately expensive. >>> >>> Another thing you may want to consider is whether you need live >>> calibration -- that is, when employing the sensor, you alternate >>> between a calibration phase (which could be infrequent) and measurement >>> phase. This might make life easier. >>> >>> Good luck. >>> >>> Steve >> >> >> I just wonder what may be a physical system supplying the frequency to >> be measured to an accuracy in the ppb class, except a frequency >> standard. > > The 10ppb figure does become suspicious, doesn't it? Some measurement > system that depends on something like a piezo-electric crystal or a > mechanical resonator changing it's resonant frequency in response to the > parameter being measured jumps to mind. > > If I'm measuring to "100ppb, 10ppb preferred" then I probably have a > total error budget of 1ppm or so, and I want the frequency measurement > part of that error budget to be somewhere between definitely small enough > and not a worry at all. > > I could see such a system being valid if it had temperature compensation, > or if it were measuring temperature.
My son, a PhD in measurement technology, likes to say that every measurement system will be a thermometer, and maybe a barometer, if sufficiently sensitive. I have been suspecting the accuracy spec from the start on. -- -TV