summaryrefslogtreecommitdiff
path: root/gr-uhd/apps
diff options
context:
space:
mode:
Diffstat (limited to 'gr-uhd/apps')
-rwxr-xr-xgr-uhd/apps/uhd_fft.py12
-rwxr-xr-xgr-uhd/apps/uhd_rx_cfile.py8
-rwxr-xr-xgr-uhd/apps/uhd_rx_nogui.py4
-rwxr-xr-xgr-uhd/apps/uhd_siggen.py12
4 files changed, 15 insertions, 21 deletions
diff --git a/gr-uhd/apps/uhd_fft.py b/gr-uhd/apps/uhd_fft.py
index 7f529a528..c06a23036 100755
--- a/gr-uhd/apps/uhd_fft.py
+++ b/gr-uhd/apps/uhd_fft.py
@@ -74,9 +74,11 @@ 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,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self.u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
+
+ # Set the subdevice spec
+ if(options.spec):
+ self.u.set_subdev_spec(options.spec, 0)
self.u.set_samp_rate(options.samp_rate)
input_rate = self.u.get_samp_rate()
@@ -119,10 +121,6 @@ class app_top_block(stdgui2.std_top_block):
self.set_gain(options.gain)
- # Set the subdevice spec
- if(options.spec):
- self.u.set_subdev_spec(options.spec, 0)
-
# Set the antenna
if(options.antenna):
self.u.set_antenna(options.antenna, 0)
diff --git a/gr-uhd/apps/uhd_rx_cfile.py b/gr-uhd/apps/uhd_rx_cfile.py
index 625de36d3..61d5342c5 100755
--- a/gr-uhd/apps/uhd_rx_cfile.py
+++ b/gr-uhd/apps/uhd_rx_cfile.py
@@ -41,14 +41,10 @@ class rx_cfile_block(gr.top_block):
# Create a UHD device source
if options.output_shorts:
- self._u = uhd.usrp_source(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_INT16,
- num_channels=1)
+ self._u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('sc16'))
self._sink = gr.file_sink(gr.sizeof_short*2, filename)
else:
- self._u = uhd.usrp_source(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self._u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
self._sink = gr.file_sink(gr.sizeof_gr_complex, filename)
# Set receiver sample rate
diff --git a/gr-uhd/apps/uhd_rx_nogui.py b/gr-uhd/apps/uhd_rx_nogui.py
index 25068b3ac..7a2e0a07a 100755
--- a/gr-uhd/apps/uhd_rx_nogui.py
+++ b/gr-uhd/apps/uhd_rx_nogui.py
@@ -88,9 +88,7 @@ class uhd_src(gr.hier_block2):
gr.io_signature(0, 0, 0), # Input signature
gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
- self._src = uhd.usrp_source(device_addr=args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self._src = uhd.usrp_source(device_addr=args, stream_args=uhd.stream_args('fc32'))
self._src.set_samp_rate(samp_rate)
dev_rate = self._src.get_samp_rate()
diff --git a/gr-uhd/apps/uhd_siggen.py b/gr-uhd/apps/uhd_siggen.py
index 4b7060460..27e9e8e01 100755
--- a/gr-uhd/apps/uhd_siggen.py
+++ b/gr-uhd/apps/uhd_siggen.py
@@ -92,15 +92,17 @@ class top_block(gr.top_block, pubsub):
self[TYPE_KEY] = options.type #set type last
def _setup_usrpx(self, options):
- self._u = uhd.usrp_sink(device_addr=options.args,
- io_type=uhd.io_type.COMPLEX_FLOAT32,
- num_channels=1)
+ self._u = uhd.usrp_sink(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
self._u.set_samp_rate(options.samp_rate)
# Set the subdevice spec
if(options.spec):
self._u.set_subdev_spec(options.spec, 0)
+ # Set the gain on the usrp from options
+ if(options.gain):
+ self._u.set_gain(options.gain)
+
# Set the antenna
if(options.antenna):
self._u.set_antenna(options.antenna, 0)
@@ -145,7 +147,7 @@ class top_block(gr.top_block, pubsub):
def set_gain(self, gain):
if gain is None:
g = self[GAIN_RANGE_KEY]
- gain = float(g[0]+g[1])/2
+ gain = float(g.start()+g.stop())/2
if self._verbose:
print "Using auto-calculated mid-point TX gain"
self[GAIN_KEY] = gain
@@ -158,7 +160,7 @@ class top_block(gr.top_block, pubsub):
if target_freq is None:
f = self[FREQ_RANGE_KEY]
- target_freq = float(f[0]+f[1])/2.0
+ target_freq = float(f.start()+f.stop())/2.0
if self._verbose:
print "Using auto-calculated mid-point frequency"
self[TX_FREQ_KEY] = target_freq