extrinsic): noisy_seq = helpers.multiplexed(systematic, code) llrs = maximum_a_posteriori(lookup_table, noisy_seq, channel_reliability, True, extrinsic) extrinsic_out = [llr - extr - channel_reliability * syst for llr, extr, syst in izip(llrs, extrinsic, systematic)] return llrs, extrinsic_out if __name__ == '__main__': # pragma: no cover rsc_table = { 0: {0: ((0, 0), 0), 1: ((1, 1), 2)}, 1: {0: ((0, 0), 2), 1: ((1, 1), 0)}, 2: {0: ((0, 1), 3), 1: ((1, 0), 1)}, 3: {0: ((0, 1), 1), 1: ((1, 0), 3)}, } permutation = range(9, -1, -1) il = interleave.Interleaver(permutation) ie = encode.RscEncoder(rsc_table) turbo_encoder = encode.TurboEncoder(il, ie) data = map(int, "0000000001") encoded = turbo_encoder.encode_sequence(data) modulated = list(helpers.modulaten(encoded)) noisy = list(channel.transmit_awgn(modulated, 0.3)) decoded = turbo_decode(noisy, rsc_table, il, 10, 2) print data print decoded
"decoder_func": pass_decode, "ebn0s": EBN0S, "repeat_count": COUNT, }, { "description": "MAP", "frame_length": FRAME_LEN, "encoder": encode.ConvoEncoder(lookup_tables.abrantes_convo213), "decoder_func": map_decode, "ebn0s": EBN0S, "repeat_count": COUNT, }, { "description": "Turbo (1 iteration)", "frame_length": FRAME_LEN, "encoder": encode.TurboEncoder(interleaver, encode.RscEncoder(lookup_tables.gzl_rsc)), "decoder_func": turbo_decode1, "ebn0s": EBN0S, "repeat_count": COUNT, }, { "description": "Turbo (2 iterations)", "frame_length": FRAME_LEN, "encoder": encode.TurboEncoder(interleaver, encode.RscEncoder(lookup_tables.gzl_rsc)), "decoder_func": make_turbo_decode(2), "ebn0s": EBN0S, "repeat_count": COUNT, }, { "description": "Turbo (4 iterations)", "frame_length": FRAME_LEN,
# rel = ebn0 * 2 return decode.turbo_decode(sequence, table, interleaver, k, rel) return turbo_decode if __name__ == '__main__': configurations = [ { "description": "jordan_nichols (2, slightly random)", "frame_length": LENGTH, "encoder": encode.TurboEncoder( interleave.Interleaver(make_permutation(LENGTH)), encode.RscEncoder(lookup_tables.jordan_nichols_rsc)), "decoder_func": make_turbo_decode(2, lookup_tables.jordan_nichols_rsc, interleave.Interleaver( make_permutation(LENGTH))), "ebn0s": EBN0S, "repeat_count": [10, 10], }, { "description": "jordan_nichols_rsc (2, random)", "frame_length": LENGTH, "encoder":
configurations = [ { "description": "Uncoded (10k frame)", "frame_length": LENGTH, "encoder": encode.PassEncoder(), "decoder_func": pass_decode, "ebn0s": EBN0S, "repeat_count": [10] * len(EBN0S), }, { "description": "gzl212 (block; 4)", "frame_length": LENGTH, "encoder": encode.TurboEncoder(interleave.BlockInterleaver(50, 20), encode.RscEncoder(lookup_tables.gzl_rsc212)), "decoder_func": make_turbo_decode(4, lookup_tables.gzl_rsc, interleave.BlockInterleaver(50, 20)), "ebn0s": EBN0S, "repeat_count": R, }, { "description": "gzl213 (block; 4)", "frame_length": LENGTH, "encoder": encode.TurboEncoder(interleave.BlockInterleaver(50, 20),
# rel = ebn0 * 2 return decode.turbo_decode(sequence, table, interleaver, k, rel) return turbo_decode if __name__ == '__main__': configurations = [ { "description": "gzl_rsc (almost none)", "frame_length": LENGTH, "encoder": encode.TurboEncoder( interleave.Interleaver(make_permutation(LENGTH)), encode.RscEncoder(lookup_tables.gzl_rsc)), "decoder_func": make_turbo_decode(2, lookup_tables.gzl_rsc, interleave.Interleaver( make_permutation(LENGTH))), "ebn0s": EBN0S, "repeat_count": [10, 10, 10, 10, 100], }, { "description": "gzl_rsc (random)", "frame_length": LENGTH, "encoder":