06-08-2017 02:50 PM
I'm using GNU Radio and an NI USRP-2900 with an external PPS to the input. A waveform file is played in loop and passed to the transmit channel. The signal is looped back to the receive side, with an attenuator. Simultaneously, the receive channel reads and saves the samples to a file.
My issue is that whenever the program is stopped and restarted the relative alignment between transmit and receive streams has changed. The offset must be consistent for my application.
I've tried syncing to the PPS. I've tried time commands. I feel as though I've tried everything. Any help would be greatly appreciated. Thanks all.
Solved! Go to Solution.
06-08-2017 05:56 PM
I solved the issue. Here is the solution for everyone's reference. The trick was to use the .set_time_next_pps() and .set_start_time() functions. More details on these functions are available here. The following hand code must be added to the python file generated by the GNU Radio companion, or to another hand coded python/gnuradio program.
Take note of the lines which are added immediately after creation of the source/sink blocks, but before .set_center_freq() is sent for each which would otherwise start the streaming immediately.
# create a zero time and a start time zero_time = uhd.time_spec_t(0.0) # hand coded start_time = uhd.time_spec_t(2.0) # hand coded # Add following lines following creation of source block self.uhd_usrp_source_1.set_time_next_pps( zero_time ) # hand coded self.uhd_usrp_source_1.set_start_time( start_time ) # hand coded # Add following lines following creation of sink block self.uhd_usrp_sink_0.set_time_next_pps(zero_time ) # hand coded self.uhd_usrp_sink_0.set_start_time( start_time ) # hand coded
06-09-2017 04:11 PM
Thanks for following up and posting your solution.
Cheers,
Michael B.