summaryrefslogtreecommitdiff
path: root/gr-digital/python/digital/qa_constellation_soft_decoder_cf.py
diff options
context:
space:
mode:
authorDouglas Anderson <danderson@ntia.doc.gov>2017-02-12 15:52:19 -0800
committerJohnathan Corgan <johnathan@corganlabs.com>2017-02-26 18:21:22 -0800
commit9e625c4821f4c63421b3d3747c0c4f358fef6c5f (patch)
tree41dedbe053417be7314cdce15d64fbbb89db4d8d /gr-digital/python/digital/qa_constellation_soft_decoder_cf.py
parente5aabcc6a4a9335f3ef8abf5f89104b626e9364d (diff)
python3: update non-GRC components to use python2 or python3
Diffstat (limited to 'gr-digital/python/digital/qa_constellation_soft_decoder_cf.py')
-rw-r--r--gr-digital/python/digital/qa_constellation_soft_decoder_cf.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/gr-digital/python/digital/qa_constellation_soft_decoder_cf.py b/gr-digital/python/digital/qa_constellation_soft_decoder_cf.py
index 872aed0157..629d52c0a4 100644
--- a/gr-digital/python/digital/qa_constellation_soft_decoder_cf.py
+++ b/gr-digital/python/digital/qa_constellation_soft_decoder_cf.py
@@ -20,6 +20,7 @@
# Boston, MA 02110-1301, USA.
#
+
from gnuradio import gr, gr_unittest, digital, blocks
from math import sqrt
from numpy import random, vectorize
@@ -36,7 +37,7 @@ class test_constellation_soft_decoder(gr_unittest.TestCase):
cnst_pts, code = const_gen()
Es = max([abs(c) for c in cnst_pts])
lut = digital.soft_dec_table_generator(const_sd_gen, prec, Es)
- expected_result = list()
+ expected_result = list()
for s in src_data:
res = digital.calc_soft_dec_from_table(s, lut, prec, sqrt(2.0))
expected_result += res
@@ -52,14 +53,14 @@ class test_constellation_soft_decoder(gr_unittest.TestCase):
self.tb.run()
actual_result = dst.data() # fetch the contents of the sink
- #print "actual result", actual_result
- #print "expected result", expected_result
+ #print "actual result", actual_result
+ #print "expected result", expected_result
self.assertFloatTuplesAlmostEqual(expected_result, actual_result, 5)
def helper_no_lut(self, prec, src_data, const_gen, const_sd_gen):
cnst_pts, code = const_gen()
cnst = digital.constellation_calcdist(cnst_pts, code, 2, 1)
- expected_result = list()
+ expected_result = list()
for s in src_data:
res = digital.calc_soft_dec(s, cnst.points(), code)
expected_result += res
@@ -73,8 +74,8 @@ class test_constellation_soft_decoder(gr_unittest.TestCase):
self.tb.run()
actual_result = dst.data() # fetch the contents of the sink
- #print "actual result", actual_result
- #print "expected result", expected_result
+ #print "actual result", actual_result
+ #print "expected result", expected_result
# Double vs. float precision issues between Python and C++, so
# use only 4 decimals in comparisons.