Skip to content

Commit bd09e47

Browse files
authored
Merge pull request #42 from BastienTr/fix41
Fix #41
2 parents 463a0a0 + 754fcc7 commit bd09e47

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

commpy/channelcoding/interleavers.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11

2-
32
# Authors: Veeresh Taranalli <veeresht@gmail.com>
43
# License: BSD 3-Clause
54

65
""" Interleavers and De-interleavers """
76

8-
from numpy import array, arange, zeros
7+
from numpy import arange, zeros
98
from numpy.random import mtrand
109

1110
__all__ = ['RandInterlv']
1211

12+
1313
class _Interleaver:
1414

1515
def interlv(self, in_array):
@@ -26,7 +26,7 @@ def interlv(self, in_array):
2626
Interleaved output data.
2727
2828
"""
29-
out_array = array(map(lambda x: in_array[x], self.p_array))
29+
out_array = in_array[self.p_array]
3030
return out_array
3131

3232
def deinterlv(self, in_array):
@@ -48,6 +48,7 @@ def deinterlv(self, in_array):
4848
out_array[element] = in_array[index]
4949
return out_array
5050

51+
5152
class RandInterlv(_Interleaver):
5253
""" Random Interleaver.
5354
@@ -76,9 +77,3 @@ class RandInterlv(_Interleaver):
7677
def __init__(self, length, seed):
7778
rand_gen = mtrand.RandomState(seed)
7879
self.p_array = rand_gen.permutation(arange(length))
79-
80-
81-
#class SRandInterlv(_Interleaver):
82-
83-
84-
#class QPPInterlv(_Interleaver):

0 commit comments

Comments
 (0)