diff options
author | Tom Rondeau | 2010-02-26 10:11:39 -0500 |
---|---|---|
committer | Tom Rondeau | 2010-02-26 10:11:39 -0500 |
commit | 598924aa8be0740583d9d32f99269e1e55134b6e (patch) | |
tree | 84a36302acb42c0c1b0e4ca9067f524b5f03688f /gnuradio-examples/python/digital/pick_bitrate2.py | |
parent | 93c51f5c02311f89dc6eb47923b34b13038c805c (diff) | |
download | gnuradio-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/pick_bitrate2.py')
-rw-r--r-- | gnuradio-examples/python/digital/pick_bitrate2.py | 5 |
1 files changed, 2 insertions, 3 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)) |