summaryrefslogtreecommitdiff
path: root/gr-uhd
diff options
context:
space:
mode:
authorTom Rondeau2011-12-04 11:19:19 -0500
committerTom Rondeau2011-12-04 11:19:19 -0500
commit5c1576570e156633c9531932baa79fda9ff9a573 (patch)
tree92984dba6b7af9f36a1f3a27b662cf88b0d4b6cf /gr-uhd
parent0e7c799e4ef7a392a8ffe47170666908bfcb183f (diff)
parenta6b5389139341784edf30d512aa42360d3a8cf02 (diff)
downloadgnuradio-5c1576570e156633c9531932baa79fda9ff9a573.tar.gz
gnuradio-5c1576570e156633c9531932baa79fda9ff9a573.tar.bz2
gnuradio-5c1576570e156633c9531932baa79fda9ff9a573.zip
Merge branch 'master' of gnuradio.org:gnuradio
Conflicts: docs/doxygen/Doxyfile.in
Diffstat (limited to 'gr-uhd')
-rwxr-xr-xgr-uhd/apps/uhd_fft.py11
-rw-r--r--gr-uhd/examples/tag_sink_demo.h5
-rw-r--r--gr-uhd/examples/tag_source_demo.h2
-rw-r--r--gr-uhd/lib/gr_uhd_usrp_source.cc4
4 files changed, 15 insertions, 7 deletions
diff --git a/gr-uhd/apps/uhd_fft.py b/gr-uhd/apps/uhd_fft.py
index c06a23036..7ebf5e106 100755
--- a/gr-uhd/apps/uhd_fft.py
+++ b/gr-uhd/apps/uhd_fft.py
@@ -63,10 +63,14 @@ class app_top_block(stdgui2.std_top_block):
help="Enable oscilloscope display")
parser.add_option("", "--avg-alpha", type="eng_float", default=1e-1,
help="Set fftsink averaging factor, default=[%default]")
+ parser.add_option ("", "--averaging", action="store_true", default=False,
+ help="Enable fftsink averaging, default=[%default]")
parser.add_option("", "--ref-scale", type="eng_float", default=1.0,
help="Set dBFS=0dB input value, default=[%default]")
parser.add_option("--fft-size", type="int", default=1024,
help="Set number of FFT bins [default=%default]")
+ parser.add_option("--fft-rate", type="int", default=30,
+ help="Set FFT update rate, [default=%default]")
(options, args) = parser.parse_args()
if len(args) != 0:
parser.print_help()
@@ -74,7 +78,8 @@ class app_top_block(stdgui2.std_top_block):
self.options = options
self.show_debug_info = True
- self.u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
+ self.u = uhd.usrp_source(device_addr=options.args,
+ stream_args=uhd.stream_args('fc32'))
# Set the subdevice spec
if(options.spec):
@@ -98,7 +103,9 @@ class app_top_block(stdgui2.std_top_block):
ref_scale=options.ref_scale,
ref_level=20.0,
y_divs = 12,
- avg_alpha=options.avg_alpha)
+ average=options.averaging,
+ avg_alpha=options.avg_alpha,
+ fft_rate=options.fft_rate)
self.frame.SetMinSize((800, 420))
self.connect(self.u, self.scope)
diff --git a/gr-uhd/examples/tag_sink_demo.h b/gr-uhd/examples/tag_sink_demo.h
index 524f0ae0f..7d49bd971 100644
--- a/gr-uhd/examples/tag_sink_demo.h
+++ b/gr-uhd/examples/tag_sink_demo.h
@@ -51,12 +51,13 @@ public:
//print all tags
BOOST_FOREACH(const gr_tag_t &rx_time_tag, rx_time_tags){
- const uint64_t count = rx_time_tag.offset;
+ const uint64_t offset = rx_time_tag.offset;
const pmt::pmt_t &value = rx_time_tag.value;
- std::cout << boost::format("Full seconds %u, Frac seconds %f")
+ std::cout << boost::format("Full seconds %u, Frac seconds %f, abs sample offset %u")
% pmt::pmt_to_uint64(pmt_tuple_ref(value, 0))
% pmt::pmt_to_double(pmt_tuple_ref(value, 1))
+ % offset
<< std::endl;
}
diff --git a/gr-uhd/examples/tag_source_demo.h b/gr-uhd/examples/tag_source_demo.h
index a995762f7..9743c3407 100644
--- a/gr-uhd/examples/tag_source_demo.h
+++ b/gr-uhd/examples/tag_source_demo.h
@@ -122,7 +122,7 @@ private:
const double _samp_rate;
const uint64_t _samps_per_burst;
const double _cycle_duration;
- bool _do_new_burst;
uint64_t _samps_left_in_burst;
+ bool _do_new_burst;
};
diff --git a/gr-uhd/lib/gr_uhd_usrp_source.cc b/gr-uhd/lib/gr_uhd_usrp_source.cc
index 953ef6995..51a756908 100644
--- a/gr-uhd/lib/gr_uhd_usrp_source.cc
+++ b/gr-uhd/lib/gr_uhd_usrp_source.cc
@@ -388,11 +388,11 @@ public:
while (true){
#ifdef GR_UHD_USE_STREAM_API
const size_t bpi = uhd::convert::get_bytes_per_item(_stream_args.cpu_format);
- const size_t num_samps = _rx_stream->recv(
+ _rx_stream->recv(
outputs, nbytes/bpi, _metadata, 0.0
);
#else
- const size_t num_samps = _dev->get_device()->recv(
+ _dev->get_device()->recv(
outputs, nbytes/_type->size, _metadata,
*_type, uhd::device::RECV_MODE_FULL_BUFF, 0.0
);