summaryrefslogtreecommitdiff
path: root/gr-uhd/examples/usrp_spectrum_sense.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-uhd/examples/usrp_spectrum_sense.py')
-rwxr-xr-xgr-uhd/examples/usrp_spectrum_sense.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/gr-uhd/examples/usrp_spectrum_sense.py b/gr-uhd/examples/usrp_spectrum_sense.py
index ceb95ea2a..55e0c6152 100755
--- a/gr-uhd/examples/usrp_spectrum_sense.py
+++ b/gr-uhd/examples/usrp_spectrum_sense.py
@@ -133,6 +133,14 @@ class my_top_block(gr.top_block):
# build graph
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)
+
+ # Set the antenna
+ if(options.antenna):
+ self.u.set_antenna(options.antenna, 0)
+
usrp_rate = options.samp_rate
self.u.set_samp_rate(usrp_rate)
dev_rate = self.u.get_samp_rate()
@@ -182,14 +190,6 @@ class my_top_block(gr.top_block):
self.set_gain(options.gain)
print "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)
-
def set_next_freq(self):
target_freq = self.next_freq
self.next_freq = self.next_freq + self.freq_step