# Time Granularity of USRP N2XX

**URL:** <https://www.ruby-forum.com/t/time-granularity-of-usrp-n2xx/237714>\
**Category:** GNU Radio\
**Created:** [November 26, 2013, 1:06pm UTC](https://www.ruby-forum.com/t/time-granularity-of-usrp-n2xx/237714 "2013-11-26T13:06:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [November 26, 2013, 1:06pm UTC](https://www.ruby-forum.com/t/time-granularity-of-usrp-n2xx/237714/1 "2013-11-26T13:06:20Z")

</div>

Hi,  
Since we can get receive time of rx\_stream’s first sample via rx tags, I  
have two questions about the time granularity. Given the internal clock  
is 10Mhz, is the time granularity 0.1us? The fractional second is stored  
double type. Does it mean the last digits of the fractional sec are  
invalid?

---

<div class="post-metadata">

**Author:** ![harryzurray](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/73ab20/32.png) [@harryzurray](https://www.ruby-forum.com/u/harryzurray)\
**Post date:** [November 26, 2013, 1:14pm UTC](https://www.ruby-forum.com/t/time-granularity-of-usrp-n2xx/237714/2 "2013-11-26T13:14:31Z")

</div>

Hi Harry,

as far as I know, the granularity of a time stamp is the sample duration  
at the downsampled side.  
As for the 10MHz: The 10MHz clock is used to derive different other  
clocks, especially the rx ADC and tx DAC clocks, which are an order of  
magnitude higher; bear in mind that when you request e.g. “5MHz samle  
rate” you still get the 100MHz\* samples of the ADC, but downsampled by a  
factor of 20.

Please also bear in mind that due to physics, processing etc the  
timestamp of the rx side is delayed to the actual reception of “that  
sample”, and that this delay is largely constant when receiving using  
the same settings, but my change based on sampling rate and other  
factors.

Greetings  
Marcus

\*for USRP2 arch, if I remember correctly.

---

<div class="post-metadata">

**Author:** ![harryzurray](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/73ab20/32.png) [@harryzurray](https://www.ruby-forum.com/u/harryzurray)\
**Post date:** [November 26, 2013, 2:50pm UTC](https://www.ruby-forum.com/t/time-granularity-of-usrp-n2xx/237714/3 "2013-11-26T14:50:54Z")

</div>

Dear Marcus,  
Thank you for your reply.  
I’m confused about two concepts. Referring to the file  
time\_spec.hpp in UHD, fractional sec is calculated according to the  
parameter ticks and tick\_rate. So I think the time granularity is  
‘1/tick\_rate’ which is 0.1us using 10Mhz clock. But for the timestamp  
of sample stream, the granularity is the sample duration. Is it  
correct?

Best,  
Harry

---

<div class="post-metadata">

**Author:** ![harryzurray](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/73ab20/32.png) [@harryzurray](https://www.ruby-forum.com/u/harryzurray)\
**Post date:** [November 26, 2013, 5:16pm UTC](https://www.ruby-forum.com/t/time-granularity-of-usrp-n2xx/237714/4 "2013-11-26T17:16:57Z")

</div>

Hi Harry -

Actually, the name `tick\_rate

---

<div class="post-metadata">

**Author:** ![harryzurray](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/73ab20/32.png) [@harryzurray](https://www.ruby-forum.com/u/harryzurray)\
**Post date:** [November 26, 2013, 5:27pm UTC](https://www.ruby-forum.com/t/time-granularity-of-usrp-n2xx/237714/5 "2013-11-26T17:27:29Z")

</div>

Hi Harry -

Actually, the name `tick_rate` is somewhat confusing. The tick\_rate  
refers  
to the clock rate that the DSP chain runs at. Here is a bit of code  
regarding the tick\_rate from the USRP2 / N-Series implementation that  
might  
make things a little more clear:

```
    _tree->create<double>(mb_path / "tick_rate")
        .publish(boost::bind(&usrp2_clock_ctrl::get_master_clock_rate,

```

\_mbc[mb].clock))  
.subscribe(boost::bind(&usrp2\_impl::update\_tick\_rate, this,  
\_1));

Marcus explained things correctly in his e-mail. So, on an N-Series  
device,  
the time step between samples is 1/100e6 = 10 ns.

Cheers,  
Ben
