diff options
Diffstat (limited to 'gr-fec/python/fec/polar/__init__.py')
-rw-r--r-- | gr-fec/python/fec/polar/__init__.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gr-fec/python/fec/polar/__init__.py b/gr-fec/python/fec/polar/__init__.py index ce4e506334..26698752c8 100644 --- a/gr-fec/python/fec/polar/__init__.py +++ b/gr-fec/python/fec/polar/__init__.py @@ -17,19 +17,25 @@ from .helper_functions import is_power_of_two CHANNEL_TYPE_AWGN = 'AWGN' CHANNEL_TYPE_BEC = 'BEC' + def get_z_params(is_prototype, channel, block_size, design_snr, mu): - print('POLAR code channel construction called with parameters channel={0}, blocksize={1}, design SNR={2}, mu={3}'.format(channel, block_size, design_snr, mu)) + print('POLAR code channel construction called with parameters channel={0}, blocksize={1}, design SNR={2}, mu={3}'.format( + channel, block_size, design_snr, mu)) if not (channel == 'AWGN' or channel == 'BEC'): - raise ValueError("channel is {0}, but only BEC and AWGN are supported!".format(channel)) + raise ValueError( + "channel is {0}, but only BEC and AWGN are supported!".format(channel)) if not is_power_of_two(block_size): - raise ValueError("block size={0} is not a power of 2!".format(block_size)) + raise ValueError( + "block size={0} is not a power of 2!".format(block_size)) if design_snr < -1.5917: - raise ValueError("design SNR={0} < -1.5917. MUST be greater!".format(design_snr)) + raise ValueError( + "design SNR={0} < -1.5917. MUST be greater!".format(design_snr)) if not mu > 0: raise ValueError("mu={0} < 1. MUST be > 1!".format(mu)) if not is_prototype and channel == 'AWGN': z_params = cc.load_z_parameters(block_size, design_snr, mu) - print('Read Z-parameter file: {0}'.format(cc.default_dir() + cc.generate_filename(block_size, design_snr, mu))) + print('Read Z-parameter file: {0}'.format(cc.default_dir() + + cc.generate_filename(block_size, design_snr, mu))) return z_params return bhattacharyya_bounds(design_snr, block_size) @@ -48,5 +54,5 @@ def load_frozen_bits_info(is_prototype, channel, block_size, num_info_bits, desi 'design_snr': design_snr, 'channel': channel, 'mu': mu, - } + } return data_set |