summaryrefslogtreecommitdiff
path: root/gnuradio-examples/python/digital
diff options
context:
space:
mode:
authorTom Rondeau2010-02-26 10:11:39 -0500
committerTom Rondeau2010-02-26 10:11:39 -0500
commit598924aa8be0740583d9d32f99269e1e55134b6e (patch)
tree84a36302acb42c0c1b0e4ca9067f524b5f03688f /gnuradio-examples/python/digital
parent93c51f5c02311f89dc6eb47923b34b13038c805c (diff)
downloadgnuradio-598924aa8be0740583d9d32f99269e1e55134b6e.tar.gz
gnuradio-598924aa8be0740583d9d32f99269e1e55134b6e.tar.bz2
gnuradio-598924aa8be0740583d9d32f99269e1e55134b6e.zip
Fixing a few bugs in handling of real samples per symbol.
Diffstat (limited to 'gnuradio-examples/python/digital')
-rw-r--r--gnuradio-examples/python/digital/pick_bitrate2.py5
-rw-r--r--gnuradio-examples/python/digital/receive_path.py2
-rw-r--r--gnuradio-examples/python/digital/transmit_path.py2
3 files changed, 4 insertions, 5 deletions
diff --git a/gnuradio-examples/python/digital/pick_bitrate2.py b/gnuradio-examples/python/digital/pick_bitrate2.py
index 23081117c..92539560c 100644
--- a/gnuradio-examples/python/digital/pick_bitrate2.py
+++ b/gnuradio-examples/python/digital/pick_bitrate2.py
@@ -68,8 +68,7 @@ def _pick_bitrate(bitrate, bits_per_symbol, samples_per_symbol,
try:
xrate = rate
except UnboundLocalError:
- print "Requested bitrate out of bounds"
- sys.exit(1)
+ raise ValueError("Requested bitrate out of bounds")
samples_per_symbol = converter_rate / bits_per_symbol / rate / bitrate
bitrate = converter_rate / bits_per_symbol / xrate / samples_per_symbol
@@ -100,7 +99,7 @@ def _pick_bitrate(bitrate, bits_per_symbol, samples_per_symbol,
raise ValueError(("Invalid rate (rate = %d)" % xrate))
if((samples_per_symbol < _sps_min) or (samples_per_symbol > _sps_max)):
raise ValueError(("Invalid samples per symbol (sps = %.2f). Must be in [%.0f, %.0f]." \
- % (xrate, _sps_min, _sps_max)))
+ % (samples_per_symbol, _sps_min, _sps_max)))
return (bitrate, samples_per_symbol, int(xrate))
diff --git a/gnuradio-examples/python/digital/receive_path.py b/gnuradio-examples/python/digital/receive_path.py
index 7df945ed0..0024d6941 100644
--- a/gnuradio-examples/python/digital/receive_path.py
+++ b/gnuradio-examples/python/digital/receive_path.py
@@ -119,7 +119,7 @@ class receive_path(gr.hier_block2):
normal.add_option("-r", "--bitrate", type="eng_float", default=100e3,
help="specify bitrate [default=%default].")
normal.add_option("-v", "--verbose", action="store_true", default=False)
- expert.add_option("-S", "--samples-per-symbol", type="int", default=None,
+ expert.add_option("-S", "--samples-per-symbol", type="float", default=None,
help="set samples/symbol [default=%default]")
expert.add_option("", "--log", action="store_true", default=False,
help="Log all parts of flow graph to files (CAUTION: lots of data)")
diff --git a/gnuradio-examples/python/digital/transmit_path.py b/gnuradio-examples/python/digital/transmit_path.py
index ba0c434da..86ebf75c3 100644
--- a/gnuradio-examples/python/digital/transmit_path.py
+++ b/gnuradio-examples/python/digital/transmit_path.py
@@ -99,7 +99,7 @@ class transmit_path(gr.hier_block2):
help="set transmitter digital amplitude: 0 <= AMPL < 1 [default=%default]")
normal.add_option("-v", "--verbose", action="store_true", default=False)
- expert.add_option("-S", "--samples-per-symbol", type="int", default=None,
+ expert.add_option("-S", "--samples-per-symbol", type="float", default=None,
help="set samples/symbol [default=%default]")
expert.add_option("", "--log", action="store_true", default=False,
help="Log all parts of flow graph to file (CAUTION: lots of data)")