Problems when using GPSDO

Hi all,

I have two questions for using GPSDO. First, I’m now using
usrp_source.get_time_now().get_frac_secs() to get a time value like


My question is how accurate is this value. I don’t know much about GPS,
so I
hope my question is not so stupid: is this value as accurate as PPS?

Another question. I’m now using message_sink and msg_queue to receive
from USRP. The sampling rate is 4MHz. I do some calculation for all the
in the msg_queue one by one and write some of them into a file. Now I
to know the accurate time when certain data were produced from USRP. But
when I process some data, they already have been produced for a while
have to spend certain time in msg_queue). I’m also trying to use
get_time_now().get_frac_secs() when msg_queue is empty and take this
as the beginning time of the next message. But this method seems to be
awkward and not accurate. Is there any idea for this problem?

I’m really new to GNURadio, and I have learned a lot from this mail list
recently. Thanks.


On 02/19/2012 03:02 AM, Wu Ting wrote:

hope my question is not so stupid: is this value as accurate as PPS?

There is no event associated with get time now. So you know the time as
it was read several ms ago, give or take. This can be helpful, but not

But when a time has an event associated with it, then its very accurate
relative to the event you are measuring (down to the clock cycle). For
example, consider get_time_last_pps() or the time associated with an RX
packet full of samples.

Don’t pipe the samples into a message queue. You loose the stream tags.

Use the time stream tag produced by the USRP source. This way you know
exactly that time was set for a particular sample. If you know the
sample rate, you can interpolate to know the exact time of every sample.

To do this, either write a custom c++ block to fit your needs. Or, you
can install my “python_blocks” branch and do the equivalent in python
(if python is going to be fast enough for you).

And my repo with “python_blocks” if you are interested: