diff options
author | Johannes Demel <ufcsy@student.kit.edu> | 2015-06-18 12:14:32 +0200 |
---|---|---|
committer | Johannes Demel <ufcsy@student.kit.edu> | 2015-09-21 10:45:12 +0200 |
commit | 13592802e792a417b1db511dbb1d0445ff4955c8 (patch) | |
tree | 4ecb7d8f8527f9d501a22d871fcca5e0c4b3f838 /gr-fec/python/fec/polar/helper_functions.py | |
parent | 87670ad6f14e61bf4bde6c6e5b18d19b262fe33f (diff) |
polar: SC and SC List decoder implemented in C++
Diffstat (limited to 'gr-fec/python/fec/polar/helper_functions.py')
-rw-r--r-- | gr-fec/python/fec/polar/helper_functions.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gr-fec/python/fec/polar/helper_functions.py b/gr-fec/python/fec/polar/helper_functions.py index ffa4fc17dc..213f3cb7c0 100644 --- a/gr-fec/python/fec/polar/helper_functions.py +++ b/gr-fec/python/fec/polar/helper_functions.py @@ -19,6 +19,7 @@ # import numpy as np +from channel_construction_bec import get_bec_frozen_indices def is_power_of_two(num): @@ -72,7 +73,8 @@ def pack_byte(bits): def get_frozen_bit_positions(directory, n, k, p): import glob, os - os.chdir(directory) + if not os.getcwd().endswith(directory): + os.chdir(directory) prefix = 'frozen_bit_positions_' prefix_len = len(prefix) for file in glob.glob("*.npy"): @@ -90,7 +92,7 @@ def get_frozen_bit_positions(directory, n, k, p): pstr = float(pstr[0][1:]) if n == nstr and k == kstr: return np.load(filename) - return np.arange(k) + return get_bec_frozen_indices(n, k, p) def main(): |