discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] How do I capture of the time of USRP N210 samples


From: LD Zhang
Subject: Re: [Discuss-gnuradio] How do I capture of the time of USRP N210 samples with host computer system time?
Date: Fri, 4 Jan 2013 11:21:37 -0800

Great! Thanks Josh for the answers to my last email. Please see my comments
and questions below.

============================================================================
========

If you want to use the PC clock, I recommend calling set time now with the
current PC time before scheduling streaming. This will make the USRP tick
counter roughly match the PC clock.

python:
usrp_source.set_time_now(uhd.time_spec_t(time.time())

c++
usrp_source->set_time_now(uhd::time_spec_t(secs, micros, long(1e6));

This way, your only time-ambiguity is the variance in ethernet control
packets and the difference in time between the different PCs. That should
satisfy referenced to PC's time anyway...

>>> 
I will try it in Python to set the USRP time. My generated top_block.py is
doing as: self.uhd_usrp_source_0.set_.......
I suppose I will just do:
self.uhd_usrp_source_0.set_time_now(uhd.time_spec_t(time.time())

There is however a question of how often one needs to set the USRP time. It
would depend on how fast the USRP clock drifts with respect to host computer
system time. I remember a number of 2 ppm accuracy of the TCXO frequency
reference. How does this translate to rate of clock drift (in say
micro-seconds drift per hour)?

>>>

--------------------------------------

The next step would be to schedule when a stream begins for each device so
they send RX samples to the host at the "same time" (according to the USRP
anyway).

I think the USRP source block supports setting the time, and streaming at a
specific time, but there isnt a way to do this at the GRC level. So you
might need some hand coded python added to the generated flowgraph, if you
are using GRC.

>>>
OK, I want to do this. But what is the command to do in python? Something
like:
self.uhd_usrp_source_0.rx_sample_time??? Or .schedule_time??? 

I do need to pass the sample gather start time as a variable to the
top_block.py script.  How do I do that (I am a matlaber who is still clumsy
with python)?

Thanks and Regards,

LD

_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio




reply via email to

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