[time-nuts] Homebrew frequency counter, need help

Bob Camp kb8tq at n1k.org
Fri Dec 12 17:15:22 UTC 2014


Hi

> On Dec 12, 2014, at 11:44 AM, Li Ang <lllaaa at gmail.com> wrote:
> 
> Yes, you are right. 5650_5650 is sig=ref case. prs10_5650 is sig=prs10 and
> ref=5650 case.

In the “both same (5650 / 5650) case” your linear regression filtering is faking you out a bit. The SR620 counter has exactly this same issue. That’s probably for the same reason. It’s a fine test to see if you have various problems under control. It’s not a perfect way to estimate the number of digits you will get on a real measurement. Using two independent sources is a better way to do that. 

When you have two identical signals, the TDC noise is the main issue. All the edges are arriving in the same relation to each other (same timing). The linear regression is (obviously) good at suppressing the sort of noise the TDC has. With two independent signals the noise is more complex. The edges arrive at various times relative to each other. More things contribute to the total noise. The linear regression is having a harder time suppressing that sort of noise. In some cases (as you observed) the linear regression is actually making things worse.

If Magnus was here, he would be tossing empty beer bottles at me and saying — see Bob, sqrt(N) doesn’t always work ….

The filtering process used does need to be adapted to the noise of the total system.

> 
> Since I really want to reduce the noise, what is the best test set you
> suggest? All the frequency source I have: FE5650 Rb , PRS10 Rb , MV89a*2
> OCXO,

If the MV89’s are in good working condition, they are the best thing to compare.The have the best ADEV of the group you have available I would check them for output level and stability before I trusted them. There are a lot of defective parts on the market. People get some, sort them and sell the bad ones. The bad ones just keep getting re-sold again and again … My guess is that they were good parts at one time and they got damaged when pulled off boards. If you use them, keep them on power at all times. Any OCXO will do better if you run it that way. 

Bob



> Thunderbolt GPSDO, 8663-XS*2 OCXO, Wenzel 100M OCXO(not sure).
> 
> How to analyze the ADEV plot to get information about noise?
> 
> Thanks
> 
> 
> 2014-12-13 0:31 GMT+08:00 Bob Camp <kb8tq at n1k.org>:
>> 
>> Hi
>> 
>> In your original data:
>> 
>> Is the blue “5650 to 5650” trace looking at the same source for input and
>> reference?
>> 
>> Is the green “PRS10 to 5650” trace looking at two independent sources (one
>> reference and the other as input)?
>> 
>> I’m guessing that the answer is yes in both cases.
>> 
>> Bob
>> 
>> 
>>> On Dec 12, 2014, at 10:40 AM, Li Ang <lllaaa at gmail.com> wrote:
>>> 
>>> Hi Bob,
>>>   The job done by linear regression is to reduce the uncertainty. This
>>> counter is designed to use continous timestamp method. My current design
>>> can measure 9000 times/second. If I only use the 1st and last one to
>>> calculate, it's the traditional recipocal + interploator method. This is
>>> what you can see on the chart named "without linear regression". The
>>> uncertainty of slope(the frequency ratio of ref and signal ) is
>> contributed
>>> by these 2 measurements. With linear regression of all 9000 data within
>> one
>>> second, the uncertainty will reduced to smaller one. (I really can't
>>> remember the ratio. Something like sqrt(9000)).
>>> 
>>> 
>>> while(1) {
>>>       double t3;  //fraction part of refcnt, measured by tdc_gp22
>>>       double ref_curr;
>>>       uint32_t sig_curr;
>>>       static double ref_start;
>>>       static uint32_t sig_start;
>>>       uint32_t refcnt, sigcnt;
>>>       const uint32_t gate_time = 1000; // 1000ms gate time
>>> 
>>>       if (i == 0) {
>>>               init_regression(&rv);
>>>               cpld_rst();
>>>               timestamp(&refcnt, &sigcnt, &t3);
>>>               ref_start = refcnt - t3;
>>>               sig_start = sigcnt;
>>>               i++;
>>>               continue;
>>>       }
>>> 
>>>       timestamp(&refcnt, &sigcnt, &t3);
>>> 
>>>       regression_enter_data(&rv, refcnt - t3 - ref_start, sigcnt -
>> sig_start);
>>>       if (msecond < gate_time) {
>>>           i++;
>>>           continue;
>>>       } else  {
>>>               t = regression_slope(&rv) ; // with linear regression
>>>               printf("\r\nFreq=%.*f", 14, t);
>>>               ref_curr = refcnt - t3;
>>>               sig_curr = sigcnt;
>>> 
>>>               t = CalcFreq(ref_curr - ref_start, sig_curr -
>>> sig_start); // without linear regression
>>>               printf(" Interpolated=%.*f", 12, t);
>>> 
>>>               msecond = 0;
>>>             i = 0;
>>>       }
>>> }
>>> 
>>> 2014-12-12 21:18 GMT+08:00 Bob Camp <kb8tq at n1k.org>:
>>>> 
>>>> HI
>>>> 
>>>>> On Dec 12, 2014, at 4:04 AM, Tom Van Baak <tvb at LeapSecond.com> wrote:
>>>>> 
>>>>> This large posting is from Li Ang.
>>>>> /tvb
>>>>> 
>>>>> ----- Original Message -----
>>>>> From: Li Ang
>>>>> To: Discussion of precise time and frequency measurement
>>>>> Sent: Thursday, December 11, 2014 7:37 AM
>>>>> Subject: Re: [time-nuts] Homebrew frequency counter, need help
>>>>> 
>>>>> 
>>>>> Hi Bob,
>>>>> I've sent the PCB to the factory and I am waiting for the new board.
>>>> This time, it's a 4-layer borad and changed from CPLD to FPGA. This is
>> the
>>>> first time of FPGA & 4-layer project. Hope everthing be OK.
>>>> 
>>>> Very nice looking. I hope it works !!!
>>>> 
>>>>> TPS79333 as the LDO for TDC. Better PSRR and noise spec than before
>>>> (XC6206). Analog and digital parts have their dedicated LDO.
>>>>> 
>>>>> 
>>>>> While I'm waiting the the new board. I did a test with PRS10 & FE5650
>>>> with current board. It's strange that the 20s adev of "without linear
>>>> regression" is better than "with linear regression”
>>>> 
>>>> Be careful pre-processing ADEV data. There are a variety of statistical
>>>> “traps” you can fall into. An overly simple explanation is that ADEV
>> looks
>>>> at noise and that most pre-processing is a filter. Filters take out
>> noise.
>>>> Finding one that only takes out the “bad noise” and keeps the “good
>> noise”
>>>> can be quite difficult.
>>>> 
>>>> What exactly are you doing in your linear regression computation?
>>>> 
>>>> Bob
>>>> 
>>>>> 
>>>> 
>> .<bottom_layer.GIF><power_plane.GIF><top_layer.GIF><adev.gif>_______________________________________________
>>>>> time-nuts mailing list -- time-nuts at febo.com
>>>>> To unsubscribe, go to
>>>> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
>>>>> and follow the instructions there.
>>>> 
>>>> _______________________________________________
>>>> time-nuts mailing list -- time-nuts at febo.com
>>>> To unsubscribe, go to
>>>> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
>>>> and follow the instructions there.
>>>> 
>>> _______________________________________________
>>> time-nuts mailing list -- time-nuts at febo.com
>>> To unsubscribe, go to
>> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
>>> and follow the instructions there.
>> 
>> _______________________________________________
>> time-nuts mailing list -- time-nuts at febo.com
>> To unsubscribe, go to
>> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
>> and follow the instructions there.
>> 
> _______________________________________________
> time-nuts mailing list -- time-nuts at febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.




More information about the Time-nuts_lists.febo.com mailing list