discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] rx_time tags off by 0.7 fs


From: Paul Boven
Subject: [Discuss-gnuradio] rx_time tags off by 0.7 fs
Date: Thu, 23 Aug 2018 16:53:39 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Hi everyone,

We have an X310 + TwinRX, which is locked to a Rb, which itself is synchronized against GPS. I've made some adaptations to uhd_rx_cfile to make it use the external clock inputs, to set its clock to int(time.time()+1) on the next PPS edge, and to start streaming at the next integer second after that.

The rx_time tag correctly starts at an integer second, and there's 100 tags every second. However, when I look at the tags for the integer seconds, I see a small offset of 6.66134e-16 s added for every subsequent second. Presumably due to the precision at which the tag is printed, the effect is only visible for the integer seconds.

After a lot of head scratching, the cause seems to be that time and/or sample rate is actually a floating point number instead of an integer. And if you do 100 additions of 0.01s you don't get a full second, you get a little more:

t=0.0
for i in range(100):
  t= t + 0.01
print (t - int(t))
Result: 6.66133814775e-16

Now a sub femto-second offset doesn't seem much to get excited about (unless you're a time-nut), but we're planning to use this to compare atomic clock signals using VLBI. If this effect were real, we might detect it in observations of more than a few hours.

A dump of the rx_time header, filtered to just the sample number, integer second and fraction of each integer second is below. The recording in question was done at a sampling rate of 100MS/s.

 000000000 1534943079 0
 100000000 1534943080 6.66134e-16
 200000000 1534943081 1.33227e-15
 300000000 1534943082 1.9984e-15
 400000000 1534943083 2.66454e-15
 500000000 1534943084 3.33067e-15
 600000000 1534943085 3.9968e-15
 700000000 1534943086 4.66294e-15
 800000000 1534943087 5.32907e-15
 900000000 1534943088 5.9952e-15
1000000000 1534943089 6.66134e-15
1100000000 1534943090 7.32747e-15
1200000000 1534943091 7.99361e-15
1300000000 1534943092 8.65974e-15
1400000000 1534943093 9.32587e-15
1500000000 1534943094 9.99201e-15
1600000000 1534943095 1.06581e-14

Regards, Paul Boven.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]