summaryrefslogtreecommitdiff
path: root/gr-uhd/examples
diff options
context:
space:
mode:
Diffstat (limited to 'gr-uhd/examples')
-rwxr-xr-xgr-uhd/examples/fm_tx4.py17
-rwxr-xr-xgr-uhd/examples/usrp_am_mw_rcv.py17
-rwxr-xr-xgr-uhd/examples/usrp_nbfm_ptt.py17
-rwxr-xr-xgr-uhd/examples/usrp_nbfm_rcv.py16
-rwxr-xr-xgr-uhd/examples/usrp_spectrum_sense.py16
-rwxr-xr-xgr-uhd/examples/usrp_tv_rcv.py16
-rwxr-xr-xgr-uhd/examples/usrp_tv_rcv_nogui.py16
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv.py16
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv2_nogui.py1
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv_fmdet.py16
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv_nogui.py16
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv_pll.py16
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv_sca.py16
-rwxr-xr-xgr-uhd/examples/usrp_wxapt_rcv.py16
14 files changed, 104 insertions, 108 deletions
diff --git a/gr-uhd/examples/fm_tx4.py b/gr-uhd/examples/fm_tx4.py
index 714eed3cf..aecb35b54 100755
--- a/gr-uhd/examples/fm_tx4.py
+++ b/gr-uhd/examples/fm_tx4.py
@@ -37,7 +37,6 @@ from gnuradio import uhd
from gnuradio import blks2
from gnuradio.eng_option import eng_option
from optparse import OptionParser
-from usrpm import usrp_dbid
import math
import sys
@@ -119,6 +118,14 @@ class fm_tx_block(stdgui2.std_top_block):
self.u = uhd.usrp_sink(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)
+
self.usrp_rate = options.samp_rate
self.u.set_samp_rate(self.usrp_rate)
self.usrp_rate = self.u.get_samp_rate()
@@ -134,14 +141,6 @@ class fm_tx_block(stdgui2.std_top_block):
self.set_gain(options.gain)
self.set_freq(options.freq)
- # 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)
-
self.sum = gr.add_cc ()
# Instantiate N NBFM channels
diff --git a/gr-uhd/examples/usrp_am_mw_rcv.py b/gr-uhd/examples/usrp_am_mw_rcv.py
index 31fe9af70..85ffd7632 100755
--- a/gr-uhd/examples/usrp_am_mw_rcv.py
+++ b/gr-uhd/examples/usrp_am_mw_rcv.py
@@ -28,7 +28,6 @@ from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
from gnuradio.wxgui import stdgui2, fftsink2, form
from optparse import OptionParser
-from usrpm import usrp_dbid
import sys
import math
import wx
@@ -77,6 +76,14 @@ class wfm_rx_block (stdgui2.std_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 = 256e3
demod_rate = 64e3
audio_rate = 32e3
@@ -150,14 +157,6 @@ class wfm_rx_block (stdgui2.std_top_block):
if not(self.set_freq(options.freq)):
self._set_status_msg("Failed to set initial frequency")
- # 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_status_msg(self, msg, which=0):
self.frame.GetStatusBar().SetStatusText(msg, which)
diff --git a/gr-uhd/examples/usrp_nbfm_ptt.py b/gr-uhd/examples/usrp_nbfm_ptt.py
index 3b28bc2ea..075604af3 100755
--- a/gr-uhd/examples/usrp_nbfm_ptt.py
+++ b/gr-uhd/examples/usrp_nbfm_ptt.py
@@ -28,7 +28,6 @@ from optparse import OptionParser
from gnuradio import gr, audio, blks2, uhd
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import stdgui2, fftsink2, scopesink2, slider, form
-from usrpm import usrp_dbid
from numpy import convolve, array
@@ -283,6 +282,14 @@ class transmit_path(gr.hier_block2):
self.u = uhd.usrp_sink(device_addr=args, stream_args=uhd.stream_args('fc32'))
+ # Set the subdevice spec
+ if(spec):
+ self.u.set_subdev_spec(spec, 0)
+
+ # Set the antenna
+ if(antenna):
+ self.u.set_antenna(antenna, 0)
+
self.if_rate = 320e3
self.audio_rate = 32e3
@@ -333,14 +340,6 @@ class transmit_path(gr.hier_block2):
self.set_enable(False)
- # Set the subdevice spec
- if(spec):
- self.u.set_subdev_spec(spec, 0)
-
- # Set the antenna
- if(antenna):
- self.u.set_antenna(antenna, 0)
-
def set_freq(self, target_freq):
"""
Set the center frequency we're interested in.
diff --git a/gr-uhd/examples/usrp_nbfm_rcv.py b/gr-uhd/examples/usrp_nbfm_rcv.py
index 7e15abbcf..6fdf95a30 100755
--- a/gr-uhd/examples/usrp_nbfm_rcv.py
+++ b/gr-uhd/examples/usrp_nbfm_rcv.py
@@ -268,6 +268,14 @@ class receive_path(gr.hier_block2):
self.u = uhd.usrp_source(device_addr=args, stream_args=uhd.stream_args('fc32'))
+ # Set the subdevice spec
+ if(spec):
+ self.u.set_subdev_spec(spec, 0)
+
+ # Set the antenna
+ if(antenna):
+ self.u.set_antenna(antenna, 0)
+
self.if_rate = 256e3
self.quad_rate = 64e3
self.audio_rate = 32e3
@@ -320,14 +328,6 @@ class receive_path(gr.hier_block2):
s = self.squelch_range()
self.set_squelch((s[0]+s[1])/2)
- # Set the subdevice spec
- if(spec):
- self.u.set_subdev_spec(spec, 0)
-
- # Set the antenna
- if(antenna):
- self.u.set_antenna(antenna, 0)
-
def volume_range(self):
return (-20.0, 0.0, 0.5)
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
diff --git a/gr-uhd/examples/usrp_tv_rcv.py b/gr-uhd/examples/usrp_tv_rcv.py
index 6e61eceec..700915bf8 100755
--- a/gr-uhd/examples/usrp_tv_rcv.py
+++ b/gr-uhd/examples/usrp_tv_rcv.py
@@ -133,6 +133,14 @@ class tv_rx_block (stdgui2.std_top_block):
else: # use a UHD device
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)
+
self.u.set_samp_rate(usrp_rate)
dev_rate = self.u.get_samp_rate()
@@ -143,14 +151,6 @@ class tv_rx_block (stdgui2.std_top_block):
self.src=self.u
- # 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)
-
self.gain = options.gain
f2uc=gr.float_to_uchar()
diff --git a/gr-uhd/examples/usrp_tv_rcv_nogui.py b/gr-uhd/examples/usrp_tv_rcv_nogui.py
index f6a40d675..870e65b27 100755
--- a/gr-uhd/examples/usrp_tv_rcv_nogui.py
+++ b/gr-uhd/examples/usrp_tv_rcv_nogui.py
@@ -133,6 +133,14 @@ class my_top_block(gr.top_block):
# build the 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)
+
self.u.set_samp_rate(input_rate)
dev_rate = self.u.get_samp_rate()
@@ -149,14 +157,6 @@ class my_top_block(gr.top_block):
sys.stderr.write('Failed to set frequency\n')
raise SystemExit, 1
- # 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)
-
self.agc = gr.agc_cc(1e-7,1.0,1.0) #1e-7
self.am_demod = gr.complex_to_mag ()
diff --git a/gr-uhd/examples/usrp_wfm_rcv.py b/gr-uhd/examples/usrp_wfm_rcv.py
index a4abdd2a7..f6c5cf853 100755
--- a/gr-uhd/examples/usrp_wfm_rcv.py
+++ b/gr-uhd/examples/usrp_wfm_rcv.py
@@ -71,6 +71,14 @@ class wfm_rx_block (stdgui2.std_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 = 320e3
demod_rate = 320e3
audio_rate = 32e3
@@ -129,14 +137,6 @@ class wfm_rx_block (stdgui2.std_top_block):
if not(self.set_freq(options.freq)):
self._set_status_msg("Failed to set initial frequency")
- # 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_status_msg(self, msg, which=0):
self.frame.GetStatusBar().SetStatusText(msg, which)
diff --git a/gr-uhd/examples/usrp_wfm_rcv2_nogui.py b/gr-uhd/examples/usrp_wfm_rcv2_nogui.py
index 4173468ef..b70334f30 100755
--- a/gr-uhd/examples/usrp_wfm_rcv2_nogui.py
+++ b/gr-uhd/examples/usrp_wfm_rcv2_nogui.py
@@ -23,7 +23,6 @@
from gnuradio import gr, optfir, audio, blks2, uhd
from gnuradio.eng_option import eng_option
from optparse import OptionParser
-from usrpm import usrp_dbid
import sys
import math
diff --git a/gr-uhd/examples/usrp_wfm_rcv_fmdet.py b/gr-uhd/examples/usrp_wfm_rcv_fmdet.py
index 225c9607b..9649857c0 100755
--- a/gr-uhd/examples/usrp_wfm_rcv_fmdet.py
+++ b/gr-uhd/examples/usrp_wfm_rcv_fmdet.py
@@ -73,6 +73,14 @@ class wfm_rx_block (stdgui2.std_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 = 320e3
demod_rate = 320e3
audio_rate = 48e3
@@ -151,14 +159,6 @@ class wfm_rx_block (stdgui2.std_top_block):
if not(self.set_freq(options.freq)):
self._set_status_msg("Failed to set initial frequency")
- # 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_status_msg(self, msg, which=0):
self.frame.GetStatusBar().SetStatusText(msg, which)
diff --git a/gr-uhd/examples/usrp_wfm_rcv_nogui.py b/gr-uhd/examples/usrp_wfm_rcv_nogui.py
index 498d2dec6..f0195bcb5 100755
--- a/gr-uhd/examples/usrp_wfm_rcv_nogui.py
+++ b/gr-uhd/examples/usrp_wfm_rcv_nogui.py
@@ -65,6 +65,14 @@ class wfm_rx_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 = 320e3
demod_rate = 320e3
audio_rate = 32e3
@@ -119,14 +127,6 @@ class wfm_rx_block (gr.top_block):
if not(self.set_freq(options.freq)):
self._set_status_msg("Failed to set initial frequency")
- # 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_vol (self, vol):
g = self.volume_range()
self.vol = max(g[0], min(g[1], vol))
diff --git a/gr-uhd/examples/usrp_wfm_rcv_pll.py b/gr-uhd/examples/usrp_wfm_rcv_pll.py
index 383670c75..b0744b00b 100755
--- a/gr-uhd/examples/usrp_wfm_rcv_pll.py
+++ b/gr-uhd/examples/usrp_wfm_rcv_pll.py
@@ -73,6 +73,14 @@ class wfm_rx_block (stdgui2.std_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 = 320e3
demod_rate = 320e3
audio_rate = 48e3
@@ -149,14 +157,6 @@ class wfm_rx_block (stdgui2.std_top_block):
if not(self.set_freq(options.freq)):
self._set_status_msg("Failed to set initial frequency")
- # 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_status_msg(self, msg, which=0):
self.frame.GetStatusBar().SetStatusText(msg, which)
diff --git a/gr-uhd/examples/usrp_wfm_rcv_sca.py b/gr-uhd/examples/usrp_wfm_rcv_sca.py
index 9b233a7fb..224f30cf8 100755
--- a/gr-uhd/examples/usrp_wfm_rcv_sca.py
+++ b/gr-uhd/examples/usrp_wfm_rcv_sca.py
@@ -102,6 +102,14 @@ class wfm_rx_sca_block (stdgui2.std_top_block):
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 = 320e3
demod_rate = 320e3
audio_rate = 32e3
@@ -210,14 +218,6 @@ class wfm_rx_sca_block (stdgui2.std_top_block):
if not(self.set_freq(options.freq)):
self._set_status_msg("Failed to set initial frequency")
self.set_sca_freq(67000) # A common SCA Frequency
-
- # 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_status_msg(self, msg, which=0):
self.frame.GetStatusBar().SetStatusText(msg, which)
diff --git a/gr-uhd/examples/usrp_wxapt_rcv.py b/gr-uhd/examples/usrp_wxapt_rcv.py
index 78cc7bd08..d9b1a0188 100755
--- a/gr-uhd/examples/usrp_wxapt_rcv.py
+++ b/gr-uhd/examples/usrp_wxapt_rcv.py
@@ -71,6 +71,14 @@ class wxapt_rx_block (stdgui2.std_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 = 320e3
demod_rate = 320e3
audio_rate = 32e3
@@ -124,14 +132,6 @@ class wxapt_rx_block (stdgui2.std_top_block):
if not(self.set_freq(options.freq)):
self._set_status_msg("Failed to set initial frequency")
- # 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_status_msg(self, msg, which=0):
self.frame.GetStatusBar().SetStatusText(msg, which)