[USRP-users] mimo sync and acceracy

iftah giladi g_iftah at yahoo.com
Fri Sep 5 03:06:44 EDT 2014

Hi everyone,


I have 2 USRP N200, I wrote my own code using the help of the examples.

I am connecting the 2 USRP's together using the MIMO cable.

And The sync is done via this procedure:

1.       The slave program set's the time & clk to the mimo:

usrp -> set_time_source("mimo",0);

usrp -> set_clock_source("mimo",0);

and then it is sets all the other channel parameter(freq,gain,etc) 

2.       The master program set's clock source to internal :

usrp -> set_clock_source(ref);

And then sets all the other channel parameter(freq,gain,etc)  

3.       Then the master program gets time from local machine and set the
usrp time to it:

tod = uhd::time_spec_t::get_system_time();


4.       As I understand at that point both usrp has the same time and clk.
Then the master program sets a rx_stream

uhd::stream_args_t stream_args("sc16", wirefmt);

uhd::rx_streamer::sptr rx_stream = usrp->get_rx_stream(stream_args);


using this sequence of stream_cmd:

uhd::stream_cmd_t stream_cmd((total_num_samps == 0)?




    stream_cmd.num_samps = total_num_samps;

    stream_cmd.stream_now = false;

       stream_cmd.time_spec = uhd::time_spec_t(tod + seconds_in_future );



5.       Mean time the slave program wait to receive a time file from the
master program with the stream_cmd.time_spec which is sent via TCP sockt to
the slave program

6.       In the slave program the file is received and then a stream commend
sequence using it is done:

uhd::stream_args_t stream_args(cpu_format,wire_format);

uhd::rx_streamer::sptr rx_stream = usrp->get_rx_stream(stream_args);


uhd::stream_cmd_t stream_cmd((num_requested_samples == 0)?




    stream_cmd.num_samps = num_requested_samples;

    stream_cmd.stream_now = false;


    stream_cmd.time_spec = uhd::time_spec_t(full_sec + frac_sec); // in the
slave device this should be recived from the master host via lan


7.  Then they both wait for the time = tod + seconds_in_future, and then
they both sample and create a file.

8.  Later on I get this file to the same computer to process with MATLAB.


I would really like to get answers to a few question:


1.       What is the accuracy of this:

tod = uhd::time_spec_t::get_system_time();


2.       What is the process or how those the time and clock are now
transfer to the other usrp and what is the latency of that process?

3.       Is there a time stamp that is passing from the master usrp to the
slave usrp every clock or those this happen once and then we rely on the
fact that the clock is the same?

4.       And if there is a time massage that is passing from one usrp to the
other then what is the latency of that massage?

5.       About the sample clock, is it based on the same 10MHZ that is
passing on the mimo cable? How does this 10M get synthesized to the sample
frequency at the A2D? and what would be the latency between the 2 different
A2D sample Signal?

Any help would be very appreciated,




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20140905/3f32d1bb/attachment-0002.html>

More information about the USRP-users mailing list