summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv_nogui.py2
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv_pll.py10
2 files changed, 10 insertions, 2 deletions
diff --git a/gr-uhd/examples/usrp_wfm_rcv_nogui.py b/gr-uhd/examples/usrp_wfm_rcv_nogui.py
index d8fb055cb..ffeda4493 100755
--- a/gr-uhd/examples/usrp_wfm_rcv_nogui.py
+++ b/gr-uhd/examples/usrp_wfm_rcv_nogui.py
@@ -100,7 +100,7 @@ class wfm_rx_block (gr.top_block):
if options.gain is None:
# if no gain was specified, use the mid-point in dB
g = self.u.get_gain_range()
- options.gain = float(g.start()+g.stop())/2
+ options.gain = float(g.start()+g.stop())/2.0
if options.volume is None:
g = self.volume_range()
diff --git a/gr-uhd/examples/usrp_wfm_rcv_pll.py b/gr-uhd/examples/usrp_wfm_rcv_pll.py
index 2d9d6c599..0e2f7fce1 100755
--- a/gr-uhd/examples/usrp_wfm_rcv_pll.py
+++ b/gr-uhd/examples/usrp_wfm_rcv_pll.py
@@ -77,7 +77,7 @@ class wfm_rx_block (stdgui2.std_top_block):
usrp_rate = 320e3
demod_rate = 320e3
audio_rate = 48e3
- audio_decim = int(demod_rate / audio_rate)
+ audio_decim = 10
self.u.set_samp_rate(usrp_rate)
dev_rate = self.u.get_samp_rate()
@@ -131,6 +131,14 @@ class wfm_rx_block (stdgui2.std_top_block):
g = self.volume_range()
options.volume = float(g[0]+g[1])/2
+ frange = self.u.get_freq_range()
+ if(frange.start() > self.fm_freq_max or frange.stop() < self.fm_freq_min):
+ sys.stderr.write("Radio does not support required frequency range.\n")
+ sys.exit(1)
+ if(options.freq < self.fm_freq_min or options.freq > self.fm_freq_max):
+ sys.stderr.write("Requested frequency is outside of required frequency range.\n")
+ sys.exit(1)
+
# set initial values
self.set_gain(options.gain)
self.set_vol(options.volume)