Beispiel #1
0
    def __init__(self, vlen_in=1, vlen_out=1, n_tailbits=1, denom_mother_code_rate=1, gen_poly=0, bits_per_symbol=1, map_tab=0, pp_0=0, interl_seq_0_2=(0,1), interl_seq_1_2=(0,1), pp_1_tail=0, pp_1=0, pp_0_tail=0, M_total=0, part_len_top=3, part_len_bot=3):
        gr.hier_block2.__init__(
            self, "MLC 16QAM",
            gr.io_signature(1, 1, gr.sizeof_char*1),
            gr.io_signature(1, 1, gr.sizeof_gr_complex*1),
        )

        ##################################################
        # Parameters
        ##################################################
        self.vlen_in = vlen_in
        self.vlen_out = vlen_out
        self.n_tailbits = n_tailbits
        self.denom_mother_code_rate = denom_mother_code_rate
        self.gen_poly = gen_poly
        self.bits_per_symbol = bits_per_symbol
        self.map_tab = map_tab
        self.pp_0 = pp_0
        self.interl_seq_0_2 = interl_seq_0_2
        self.interl_seq_1_2 = interl_seq_1_2
        self.pp_1_tail = pp_1_tail
        self.pp_1 = pp_1
        self.pp_0_tail = pp_0_tail
        self.M_total = M_total
        self.part_len_top = part_len_top
        self.part_len_bot = part_len_bot

        ##################################################
        # Blocks
        ##################################################
        self.trellis_encoder_xx_top =  trellis.encoder_bb(trellis.fsm(1, denom_mother_code_rate, gen_poly), 0, 0) if False else trellis.encoder_bb(trellis.fsm(1, denom_mother_code_rate, gen_poly), 0) 
        self.trellis_encoder_xx_bot =  trellis.encoder_bb(trellis.fsm(1, denom_mother_code_rate, gen_poly), 0, 0) if False else trellis.encoder_bb(trellis.fsm(1, denom_mother_code_rate, gen_poly), 0) 
        self.drm_qam_map_bc_0 = drm.qam_map_bc(map_tab, bits_per_symbol, vlen_out, 2)
        self.drm_punct_bb_top = drm.punct_bb(pp_0, pp_0_tail, (part_len_top + n_tailbits) * denom_mother_code_rate, vlen_out * 2, n_tailbits * denom_mother_code_rate)
        self.drm_punct_bb_bot = drm.punct_bb(pp_1, pp_1_tail, (part_len_bot + n_tailbits) * denom_mother_code_rate, vlen_out * 2, n_tailbits * denom_mother_code_rate)
        self.drm_partitioning_16_bb_0 = drm.partitioning_bb(vlen_in, M_total)
        self.drm_interleaver_bb_top = drm.interleaver_bb((interl_seq_0_2))
        self.drm_interleaver_bb_bot = drm.interleaver_bb((interl_seq_1_2))
        self.drm_add_tailbits_bb_top = drm.add_tailbits_bb(part_len_top, n_tailbits)
        self.drm_add_tailbits_bb_bot = drm.add_tailbits_bb(part_len_bot, n_tailbits)
        self.blocks_unpack_k_bits_bb_top = blocks.unpack_k_bits_bb(denom_mother_code_rate)
        self.blocks_unpack_k_bits_bb_bot = blocks.unpack_k_bits_bb(denom_mother_code_rate)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.blocks_unpack_k_bits_bb_bot, 0), (self.drm_punct_bb_bot, 0))    
        self.connect((self.blocks_unpack_k_bits_bb_top, 0), (self.drm_punct_bb_top, 0))    
        self.connect((self.drm_add_tailbits_bb_bot, 0), (self.trellis_encoder_xx_bot, 0))    
        self.connect((self.drm_add_tailbits_bb_top, 0), (self.trellis_encoder_xx_top, 0))    
        self.connect((self.drm_interleaver_bb_bot, 0), (self.drm_qam_map_bc_0, 1))    
        self.connect((self.drm_interleaver_bb_top, 0), (self.drm_qam_map_bc_0, 0))    
        self.connect((self.drm_partitioning_16_bb_0, 1), (self.drm_add_tailbits_bb_bot, 0))    
        self.connect((self.drm_partitioning_16_bb_0, 0), (self.drm_add_tailbits_bb_top, 0))    
        self.connect((self.drm_punct_bb_bot, 0), (self.drm_interleaver_bb_bot, 0))    
        self.connect((self.drm_punct_bb_top, 0), (self.drm_interleaver_bb_top, 0))    
        self.connect((self.drm_qam_map_bc_0, 0), (self, 0))    
        self.connect((self, 0), (self.drm_partitioning_16_bb_0, 0))    
        self.connect((self.trellis_encoder_xx_bot, 0), (self.blocks_unpack_k_bits_bb_bot, 0))    
        self.connect((self.trellis_encoder_xx_top, 0), (self.blocks_unpack_k_bits_bb_top, 0))    
Beispiel #2
0
    def __init__(self, vlen_in=1, vlen_out=1, n_tailbits=1, denom_mother_code_rate=1, map_tab=0, interl_seq=(0,1), bits_per_symbol=1, pp=0, pp_tail=0, gen_poly=0):
        gr.hier_block2.__init__(
            self, "MLC 4QAM",
            gr.io_signature(1, 1, gr.sizeof_char*1),
            gr.io_signature(1, 1, gr.sizeof_gr_complex*1),
        )

        ##################################################
        # Parameters
        ##################################################
        self.vlen_in = vlen_in
        self.vlen_out = vlen_out
        self.n_tailbits = n_tailbits
        self.denom_mother_code_rate = denom_mother_code_rate
        self.map_tab = map_tab
        self.interl_seq = interl_seq
        self.bits_per_symbol = bits_per_symbol
        self.pp = pp
        self.pp_tail = pp_tail
        self.gen_poly = gen_poly

        ##################################################
        # Blocks
        ##################################################
        self.trellis_encoder_xx_0 =  trellis.encoder_bb(trellis.fsm(1, denom_mother_code_rate, gen_poly), 0, 0) if False else trellis.encoder_bb(trellis.fsm(1, denom_mother_code_rate, gen_poly), 0) 
        self.drm_qam_map_bc_0 = drm.qam_map_bc(map_tab, bits_per_symbol, vlen_out, 1)
        self.drm_punct_bb_0 = drm.punct_bb(pp, pp_tail, (vlen_in + n_tailbits) * denom_mother_code_rate, vlen_out * 2, n_tailbits * denom_mother_code_rate)
        self.drm_interleaver_bb_0 = drm.interleaver_bb(((interl_seq)))
        self.blocks_unpack_k_bits_bb_0 = blocks.unpack_k_bits_bb(denom_mother_code_rate)
        self.add_tailbits_bb_0 = drm.add_tailbits_bb(vlen_in, n_tailbits)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.add_tailbits_bb_0, 0), (self.trellis_encoder_xx_0, 0))    
        self.connect((self.blocks_unpack_k_bits_bb_0, 0), (self.drm_punct_bb_0, 0))    
        self.connect((self.drm_interleaver_bb_0, 0), (self.drm_qam_map_bc_0, 0))    
        self.connect((self.drm_punct_bb_0, 0), (self.drm_interleaver_bb_0, 0))    
        self.connect((self.drm_qam_map_bc_0, 0), (self, 0))    
        self.connect((self, 0), (self.add_tailbits_bb_0, 0))    
        self.connect((self.trellis_encoder_xx_0, 0), (self.blocks_unpack_k_bits_bb_0, 0))    
Beispiel #3
0
    def __init__(self,
                 vlen_in=1,
                 vlen_out=1,
                 n_tailbits=1,
                 denom_mother_code_rate=1,
                 map_tab=0,
                 interl_seq=(0, 1),
                 bits_per_symbol=1,
                 pp=0,
                 pp_tail=0,
                 gen_poly=0):
        gr.hier_block2.__init__(
            self,
            "MLC 4QAM",
            gr.io_signature(1, 1, gr.sizeof_char * 1),
            gr.io_signature(1, 1, gr.sizeof_gr_complex * 1),
        )

        ##################################################
        # Parameters
        ##################################################
        self.vlen_in = vlen_in
        self.vlen_out = vlen_out
        self.n_tailbits = n_tailbits
        self.denom_mother_code_rate = denom_mother_code_rate
        self.map_tab = map_tab
        self.interl_seq = interl_seq
        self.bits_per_symbol = bits_per_symbol
        self.pp = pp
        self.pp_tail = pp_tail
        self.gen_poly = gen_poly

        ##################################################
        # Blocks
        ##################################################
        self.trellis_encoder_xx_0 = trellis.encoder_bb(
            trellis.fsm(1, denom_mother_code_rate, gen_poly), 0,
            0) if False else trellis.encoder_bb(
                trellis.fsm(1, denom_mother_code_rate, gen_poly), 0)
        self.drm_qam_map_bc_0 = drm.qam_map_bc(map_tab, bits_per_symbol,
                                               vlen_out, 1)
        self.drm_punct_bb_0 = drm.punct_bb(
            pp, pp_tail, (vlen_in + n_tailbits) * denom_mother_code_rate,
            vlen_out * 2, n_tailbits * denom_mother_code_rate)
        self.drm_interleaver_bb_0 = drm.interleaver_bb(((interl_seq)))
        self.blocks_unpack_k_bits_bb_0 = blocks.unpack_k_bits_bb(
            denom_mother_code_rate)
        self.add_tailbits_bb_0 = drm.add_tailbits_bb(vlen_in, n_tailbits)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.add_tailbits_bb_0, 0),
                     (self.trellis_encoder_xx_0, 0))
        self.connect((self.blocks_unpack_k_bits_bb_0, 0),
                     (self.drm_punct_bb_0, 0))
        self.connect((self.drm_interleaver_bb_0, 0),
                     (self.drm_qam_map_bc_0, 0))
        self.connect((self.drm_punct_bb_0, 0), (self.drm_interleaver_bb_0, 0))
        self.connect((self.drm_qam_map_bc_0, 0), (self, 0))
        self.connect((self, 0), (self.add_tailbits_bb_0, 0))
        self.connect((self.trellis_encoder_xx_0, 0),
                     (self.blocks_unpack_k_bits_bb_0, 0))
Beispiel #4
0
    def __init__(self,
                 vlen_in=1,
                 vlen_out=1,
                 n_tailbits=1,
                 denom_mother_code_rate=1,
                 gen_poly=0,
                 bits_per_symbol=1,
                 map_tab=0,
                 pp_0=0,
                 interl_seq_0_2=(0, 1),
                 interl_seq_1_2=(0, 1),
                 pp_1_tail=0,
                 pp_1=0,
                 pp_0_tail=0,
                 M_total=0,
                 part_len_top=3,
                 part_len_bot=3):
        gr.hier_block2.__init__(
            self,
            "MLC 16QAM",
            gr.io_signature(1, 1, gr.sizeof_char * 1),
            gr.io_signature(1, 1, gr.sizeof_gr_complex * 1),
        )

        ##################################################
        # Parameters
        ##################################################
        self.vlen_in = vlen_in
        self.vlen_out = vlen_out
        self.n_tailbits = n_tailbits
        self.denom_mother_code_rate = denom_mother_code_rate
        self.gen_poly = gen_poly
        self.bits_per_symbol = bits_per_symbol
        self.map_tab = map_tab
        self.pp_0 = pp_0
        self.interl_seq_0_2 = interl_seq_0_2
        self.interl_seq_1_2 = interl_seq_1_2
        self.pp_1_tail = pp_1_tail
        self.pp_1 = pp_1
        self.pp_0_tail = pp_0_tail
        self.M_total = M_total
        self.part_len_top = part_len_top
        self.part_len_bot = part_len_bot

        ##################################################
        # Blocks
        ##################################################
        self.trellis_encoder_xx_top = trellis.encoder_bb(
            trellis.fsm(1, denom_mother_code_rate, gen_poly), 0,
            0) if False else trellis.encoder_bb(
                trellis.fsm(1, denom_mother_code_rate, gen_poly), 0)
        self.trellis_encoder_xx_bot = trellis.encoder_bb(
            trellis.fsm(1, denom_mother_code_rate, gen_poly), 0,
            0) if False else trellis.encoder_bb(
                trellis.fsm(1, denom_mother_code_rate, gen_poly), 0)
        self.drm_qam_map_bc_0 = drm.qam_map_bc(map_tab, bits_per_symbol,
                                               vlen_out, 2)
        self.drm_punct_bb_top = drm.punct_bb(
            pp_0, pp_0_tail,
            (part_len_top + n_tailbits) * denom_mother_code_rate, vlen_out * 2,
            n_tailbits * denom_mother_code_rate)
        self.drm_punct_bb_bot = drm.punct_bb(
            pp_1, pp_1_tail,
            (part_len_bot + n_tailbits) * denom_mother_code_rate, vlen_out * 2,
            n_tailbits * denom_mother_code_rate)
        self.drm_partitioning_16_bb_0 = drm.partitioning_bb(vlen_in, M_total)
        self.drm_interleaver_bb_top = drm.interleaver_bb((interl_seq_0_2))
        self.drm_interleaver_bb_bot = drm.interleaver_bb((interl_seq_1_2))
        self.drm_add_tailbits_bb_top = drm.add_tailbits_bb(
            part_len_top, n_tailbits)
        self.drm_add_tailbits_bb_bot = drm.add_tailbits_bb(
            part_len_bot, n_tailbits)
        self.blocks_unpack_k_bits_bb_top = blocks.unpack_k_bits_bb(
            denom_mother_code_rate)
        self.blocks_unpack_k_bits_bb_bot = blocks.unpack_k_bits_bb(
            denom_mother_code_rate)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.blocks_unpack_k_bits_bb_bot, 0),
                     (self.drm_punct_bb_bot, 0))
        self.connect((self.blocks_unpack_k_bits_bb_top, 0),
                     (self.drm_punct_bb_top, 0))
        self.connect((self.drm_add_tailbits_bb_bot, 0),
                     (self.trellis_encoder_xx_bot, 0))
        self.connect((self.drm_add_tailbits_bb_top, 0),
                     (self.trellis_encoder_xx_top, 0))
        self.connect((self.drm_interleaver_bb_bot, 0),
                     (self.drm_qam_map_bc_0, 1))
        self.connect((self.drm_interleaver_bb_top, 0),
                     (self.drm_qam_map_bc_0, 0))
        self.connect((self.drm_partitioning_16_bb_0, 1),
                     (self.drm_add_tailbits_bb_bot, 0))
        self.connect((self.drm_partitioning_16_bb_0, 0),
                     (self.drm_add_tailbits_bb_top, 0))
        self.connect((self.drm_punct_bb_bot, 0),
                     (self.drm_interleaver_bb_bot, 0))
        self.connect((self.drm_punct_bb_top, 0),
                     (self.drm_interleaver_bb_top, 0))
        self.connect((self.drm_qam_map_bc_0, 0), (self, 0))
        self.connect((self, 0), (self.drm_partitioning_16_bb_0, 0))
        self.connect((self.trellis_encoder_xx_bot, 0),
                     (self.blocks_unpack_k_bits_bb_bot, 0))
        self.connect((self.trellis_encoder_xx_top, 0),
                     (self.blocks_unpack_k_bits_bb_top, 0))