discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Problems when using GPSDO


From: Josh Blum
Subject: Re: [Discuss-gnuradio] Problems when using GPSDO
Date: Sun, 19 Feb 2012 10:00:38 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111229 Thunderbird/9.0


On 02/19/2012 03:02 AM, Wu Ting wrote:
> 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 this:
> 
>               0.53928493
> 
> 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?
> 
>  

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
accurate.

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.

> 
> Another question. I'm now using message_sink and msg_queue to receive data
> from USRP. The sampling rate is 4MHz. I do some calculation for all the data
> in the msg_queue one by one and write some of them into a file. Now I want
> 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 (they
> 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 value
> 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?
> 
>  

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).

http://gnuradio.org/cgit/gnuradio.git/tree/gr-uhd/include/gr_uhd_usrp_source.h?h=master#n59

http://gnuradio.org/redmine/projects/gnuradio/wiki/BlocksCodingGuide#Reading-stream-tags

And my repo with "python_blocks" if you are interested:
git://gnuradio.org/jblum.git

-Josh



reply via email to

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