[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 03/16: fec: fixed QA for ber_bf.
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 03/16: fec: fixed QA for ber_bf. |
Date: |
Tue, 21 Jul 2015 19:27:51 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit b781fe746fb258af6ebc49499a76369665272f9d
Author: Johannes Demel <address@hidden>
Date: Fri Jul 17 14:59:06 2015 +0200
fec: fixed QA for ber_bf.
---
gr-fec/python/fec/qa_ber_bf.py | 57 +++++++++++++++++++++---------------------
1 file changed, 29 insertions(+), 28 deletions(-)
diff --git a/gr-fec/python/fec/qa_ber_bf.py b/gr-fec/python/fec/qa_ber_bf.py
index 7cd2871..3e7919e 100644
--- a/gr-fec/python/fec/qa_ber_bf.py
+++ b/gr-fec/python/fec/qa_ber_bf.py
@@ -20,13 +20,13 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gr_unittest
+from gnuradio import gr, gr_unittest, blocks
import fec_swig as fec
-import blocks_swig as blocks
-import numpy, copy
+import numpy
+import copy
-class test_ber_bf(gr_unittest.TestCase):
+class test_ber_bf(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_block()
@@ -45,16 +45,16 @@ class test_ber_bf(gr_unittest.TestCase):
src0 = blocks.vector_source_b(data0)
src1 = blocks.vector_source_b(data1)
- op = fec.ber_bf(mode)
- dst = blocks.vector_sink_f()
+ op = fec.ber_bf(mode)
+ dst = blocks.vector_sink_f()
- self.tb.connect(src0, (op,0))
- self.tb.connect(src1, (op,1))
+ self.tb.connect(src0, (op, 0))
+ self.tb.connect(src1, (op, 1))
self.tb.connect(op, dst)
- self.tb.run()
+ self.tb.run()
data = dst.data()
- expected_result = [numpy.log10(1.0/(8.0*N)),]
+ expected_result = [numpy.log10(1.0 / (8.0 * N)), ]
self.assertFloatTuplesAlmostEqual(expected_result, data, 5)
@@ -70,16 +70,16 @@ class test_ber_bf(gr_unittest.TestCase):
src0 = blocks.vector_source_b(data0)
src1 = blocks.vector_source_b(data1)
- op = fec.ber_bf(mode, 1)
- dst = blocks.vector_sink_f()
+ op = fec.ber_bf(mode, 1)
+ dst = blocks.vector_sink_f()
- self.tb.connect(src0, (op,0))
- self.tb.connect(src1, (op,1))
+ self.tb.connect(src0, (op, 0))
+ self.tb.connect(src1, (op, 1))
self.tb.connect(op, dst)
- self.tb.run()
+ self.tb.run()
data = dst.data()
- expected_result = [numpy.log10(1.0/(8.0*N)),]
+ expected_result = [numpy.log10(1.0 / (8.0 * N)), ]
self.assertFloatTuplesAlmostEqual(expected_result, data, 5)
@@ -95,16 +95,16 @@ class test_ber_bf(gr_unittest.TestCase):
src0 = blocks.vector_source_b(data0)
src1 = blocks.vector_source_b(data1)
- op = fec.ber_bf(mode, 1, -2.0)
- dst = blocks.vector_sink_f()
+ op = fec.ber_bf(mode, 1, -2.0)
+ dst = blocks.vector_sink_f()
- self.tb.connect(src0, (op,0))
- self.tb.connect(src1, (op,1))
+ self.tb.connect(src0, (op, 0))
+ self.tb.connect(src1, (op, 1))
self.tb.connect(op, dst)
- self.tb.run()
+ self.tb.run()
data = dst.data()
- expected_result = [numpy.log10(8.0/(8.0*N)),]
+ expected_result = [numpy.log10(8.0 / (8.0 * N)), ]
self.assertFloatTuplesAlmostEqual(expected_result, data, 5)
@@ -121,21 +121,22 @@ class test_ber_bf(gr_unittest.TestCase):
src0 = blocks.vector_source_b(data0)
src1 = blocks.vector_source_b(data1)
- op = fec.ber_bf(mode, 10, -2.0)
- dst = blocks.vector_sink_f()
+ op = fec.ber_bf(mode, 10, -2.0)
+ dst = blocks.vector_sink_f()
- self.tb.connect(src0, (op,0))
- self.tb.connect(src1, (op,1))
+ self.tb.connect(src0, (op, 0))
+ self.tb.connect(src1, (op, 1))
self.tb.connect(op, dst)
- self.tb.run()
+ self.tb.run()
data = dst.data()
- expected_result = [-2.0,]
+ expected_result = [-2.0, ]
print data
print expected_result
self.assertFloatTuplesAlmostEqual(expected_result, data, 5)
+
if __name__ == '__main__':
gr_unittest.run(test_ber_bf, "test_ber_bf.xml")
- [Commit-gnuradio] [gnuradio] branch master updated (55d8f48 -> cc973de), git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 05/16: fec: extended encoder now appends unpack_k_bits(8) block after encoder to satisfy get_output_conversion() = unpack behaviour, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 02/16: fec: some initial refactoring for ber_bf, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 03/16: fec: fixed QA for ber_bf.,
git <=
- [Commit-gnuradio] [gnuradio] 04/16: fec: code clean-up for block 'ber_bf'., git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 08/16: fec: added tests for extended_encoder input/output conversion., git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 15/16: Merge remote-tracking branch 'fewu/crc32_unpack', git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 01/16: updates to waterfall for suchsamples, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 10/16: Merge remote-tracking branch 'namccart/master' into master_waterfall_pdu, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 07/16: digital: added an option to the crc32_bb block that adds the unpacked CRC to the bit stream, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 12/16: qtgui: protect PDU handling waterfall port for wrong data type., git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 09/16: Merge remote-tracking branch 'jdemel/fec/fix-extended_encoder', git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 16/16: Merge branch 'maint', git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 11/16: qtgui: waterfall PDU handling, git, 2015/07/21