summaryrefslogtreecommitdiff
path: root/gr-blocks/python/blocks/qa_interleave.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-blocks/python/blocks/qa_interleave.py')
-rw-r--r--[-rwxr-xr-x]gr-blocks/python/blocks/qa_interleave.py38
1 files changed, 20 insertions, 18 deletions
diff --git a/gr-blocks/python/blocks/qa_interleave.py b/gr-blocks/python/blocks/qa_interleave.py
index 526e4a4e6f..9d334a465f 100755..100644
--- a/gr-blocks/python/blocks/qa_interleave.py
+++ b/gr-blocks/python/blocks/qa_interleave.py
@@ -20,6 +20,8 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import division
+
from gnuradio import gr, gr_unittest, blocks
class test_interleave (gr_unittest.TestCase):
@@ -32,10 +34,10 @@ class test_interleave (gr_unittest.TestCase):
def test_int_001 (self):
lenx = 64
- src0 = blocks.vector_source_f (range (0, lenx, 4))
- src1 = blocks.vector_source_f (range (1, lenx, 4))
- src2 = blocks.vector_source_f (range (2, lenx, 4))
- src3 = blocks.vector_source_f (range (3, lenx, 4))
+ src0 = blocks.vector_source_f (list(range(0, lenx, 4)))
+ src1 = blocks.vector_source_f (list(range(1, lenx, 4)))
+ src2 = blocks.vector_source_f (list(range(2, lenx, 4)))
+ src3 = blocks.vector_source_f (list(range(3, lenx, 4)))
op = blocks.interleave (gr.sizeof_float)
dst = blocks.vector_sink_f ()
@@ -54,13 +56,13 @@ class test_interleave (gr_unittest.TestCase):
lenx = 64
plusup_big = lambda a: a + (blksize * 4)
plusup_little = lambda a: a + blksize
- a_vec = range(0,blksize)
- for i in range(0,(lenx/(4 * blksize)) - 1):
- a_vec += map(plusup_big, a_vec[len(a_vec) - blksize:])
+ a_vec = list(range(0,blksize))
+ for i in range(0,(lenx // (4 * blksize)) - 1):
+ a_vec += list(map(plusup_big, a_vec[len(a_vec) - blksize:]))
- b_vec = map(plusup_little, a_vec)
- c_vec = map(plusup_little, b_vec)
- d_vec = map(plusup_little, c_vec)
+ b_vec = list(map(plusup_little, a_vec))
+ c_vec = list(map(plusup_little, b_vec))
+ d_vec = list(map(plusup_little, c_vec))
src0 = blocks.vector_source_f (a_vec)
src1 = blocks.vector_source_f (b_vec)
@@ -82,7 +84,7 @@ class test_interleave (gr_unittest.TestCase):
def test_deint_001 (self):
lenx = 64
- src = blocks.vector_source_f (range (lenx))
+ src = blocks.vector_source_f (list(range(lenx)))
op = blocks.deinterleave (gr.sizeof_float)
dst0 = blocks.vector_sink_f ()
dst1 = blocks.vector_sink_f ()
@@ -109,7 +111,7 @@ class test_interleave (gr_unittest.TestCase):
def test_deint_002 (self):
blksize = 4
lenx = 64
- src = blocks.vector_source_f (range (lenx))
+ src = blocks.vector_source_f (list(range(lenx)))
op = blocks.deinterleave (gr.sizeof_float, blksize)
dst0 = blocks.vector_sink_f ()
dst1 = blocks.vector_sink_f ()
@@ -125,13 +127,13 @@ class test_interleave (gr_unittest.TestCase):
plusup_big = lambda a: a + (blksize * 4)
plusup_little = lambda a: a + blksize
- a_vec = range(0,blksize)
- for i in range(0,(lenx/(4 * blksize)) - 1):
- a_vec += map(plusup_big, a_vec[len(a_vec) - blksize:])
+ a_vec = list(range(0,blksize))
+ for i in range(0,(lenx // (4 * blksize)) - 1):
+ a_vec += list(map(plusup_big, a_vec[len(a_vec) - blksize:]))
- b_vec = map(plusup_little, a_vec)
- c_vec = map(plusup_little, b_vec)
- d_vec = map(plusup_little, c_vec)
+ b_vec = list(map(plusup_little, a_vec))
+ c_vec = list(map(plusup_little, b_vec))
+ d_vec = list(map(plusup_little, c_vec))
expected_result0 = tuple (a_vec)
expected_result1 = tuple (b_vec)