Hi Eric,
this mail kind of fell through the cracks. Have you found a solution to this, yet?
It's not overly clear from the documentation, but the finite_acquisition method really bypasses parts of what you configure as behaviour for the USRP_source. So, ok, that won't work.
The second one might be slightly off, syntaxwise. You'll need to create a stream_cmd_t (of the right type), not use one of the type constant fields of stream_cmd_t (just as you do in the next approach).
The third might work, but really breaks GNU Radio idea of processing streams of samples; so, I'm not 100% sure what is appropriate for you :(
Best regards,
Marcus
I'm using the GNURadio python interface to UHD, and I'm trying to set a specific time to start collecting samples and either collect a specific number of samples or stop the collection of samples at a specific time. Essentially, creating a timed snapshot of samples. This is something similar to the C++ Ettus UHD example 'rx_timed_sample'.
I can get a flowgraph to start at a specific time, but I can't seem to get it to stop at a specific time (at least without causing overflows). I've also tried doing a finite aquisition, which works, but I can't get it to start at a specific time. So I'm kind of lost at what to do next.
Here is my try at the finite acquisition (seems to just ignore the start time and collects 0 samples):
num_samples = 1000
usrp = uhd.usrp_source(",".join(("", "")),uhd.stream_args(cpu_format="fc32",channels=range(1),),)
...
usrp.set_start_time(absolute_start_time)samples = usrp.finite_acquisition(num_samples)
I've also tried some combinations of following without success (TypeError: in method 'usrp_source_sptr_issue_stream_cmd', argument 2 of type '::uhd::stream_cmd_t const &'):
usrp.set_command_time(absolute_start_time)usrp.issue_stream_cmd(uhd.stream_cmd.STREAM_MODE_NUM_SAMPS_AND_DONE)I also tried the following in a flowgraph:
...usrp = flowgrah.uhd_usrp_source_0absolute_start_time = uhd.uhd_swig.time_spec_t(start_time)usrp.set_start_time(absolute_start_time)
flowgrah.start()
stop_cmd = uhd.stream_cmd(uhd.stream_cmd.STREAM_MODE_STOP_CONTINUOUS)absolute_stop_time = absolute_start_time + uhd.uhd_swig.time_spec_t(collection_time)
usrp.set_command_time(absolute_stop_time)usrp.issue_stream_cmd(stop_cmd)
For whatever reason the flowgraph one generated overflows consistently for anything greater than a .02s collection time.
I posted this question on stack overflow without any success:
Any help would be greatly appreciated!!
Thanks.
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
No comments:
Post a Comment