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: Wed, 16 Jan 2013 16:26:29 -0800

Hi,

Please see my response below:

>>
>> How are you communicating the same start time to each device in your
>> setup? Suppose there were two devices, would it not be more like this:
>>
>> self.uhd_usrp_source_0.set_time_now(uhd.time_spec_t(time.time()))
>> self.uhd_usrp_source_1.set_time_now(uhd.time_spec_t(time.time()))
>>
>> #start stream time common for all N devices
>> start_time = uhd.time_spec_t(time.time() + 0.5)
>>
>> self.uhd_usrp_source_0.set_start_time(start_time)
>> self.uhd_usrp_source_1.set_start_time(start_time)
>>
>> -josh
>>
>>
> The 2 USRP is each connected to a different computer. Each computer is
> sync'd in time via NTP update. Since NTP time is accurate to ~ 1ms, I
> consider the 2 computers sync'd right after the NTP update. There is
> network communication (socket signal) between the 2 computer so that they
> note their system time immediately after the socket signal and schedule
> (round forward to a future integer 10 second point) to perform the same
> action (data gathering) at the same time in the future. That is, each
> schedule an amount of time and each watch its clock, when it gets to that
> scheduled point, it immediately launches the top_block.py script in which
> the same set_time_now and set_start_time command are performed. There is no
> "_0" and "_1" distinction because each is operating independently. I am

The code snippet was just supposed to help demonstrate. You need to
share the *same* start time for both flow graphs for this to work. The
fact that you are using different start times and scheduling the
execution of the flow graph and creation of device objects is
introducing all this extra variability.

-josh

My understanding is that the approximately *same* start time is enforced at the 2 computer that have just been sync'd to NTP, because the top_block.py is executed at the approximately (~ 1 ms accuracy) the same time. And inside top_block.py the same code is applied to the 2 units. So I would expect approximately the same start time is used. Maybe not. Maybe the better way to do this is to get away from the top_block.py script and start using the rx_samples_to_file command, and get the metadata structure info and correct for the difference in the metadata timestamp. My question is what are the files to modify and how I save the metadata, whether in a separate file or in the same file as the sampled data.

Thanks,

LD


reply via email to

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