Пример #1
0
 def setUp (self):
     self.tb = gr.top_block ()
     
     self.N_rb_dl = N_rb_dl = 6
     self.key = "symbol"
     self.out_key = "subframe"
     self.msg_buf_name = "cell_id"
     n_carriers = 12*N_rb_dl
     n_cfi_vec = 16
     intu = np.zeros(n_carriers,dtype=np.complex)
     
     self.src0 = blocks.vector_source_c( intu, False, n_carriers)
     self.src1 = blocks.vector_source_c( intu, False, n_carriers)
     self.src2 = blocks.vector_source_c( intu, False, n_carriers)
     
     self.demux = lte.pcfich_demux_vcvc(N_rb_dl, self.key, self.out_key, self.msg_buf_name)
             
     self.snk0 = blocks.vector_sink_c(n_cfi_vec)
     self.snk1 = blocks.vector_sink_c(n_cfi_vec)
     self.snk2 = blocks.vector_sink_c(n_cfi_vec)
     
     self.tag = blocks.tag_debug(n_cfi_vec * 8, "TAG")
     
     self.tb.connect(self.src0, (self.demux,0) )
     self.tb.connect( (self.demux,0), self.snk0)
     self.tb.connect(self.src1, (self.demux,1) )
     self.tb.connect( (self.demux,1), self.snk1)
     self.tb.connect(self.src2, (self.demux,2) )
     self.tb.connect( (self.demux,2), self.snk2)
     self.tb.connect( (self.demux,0), self.tag)
Пример #2
0
    def __init__(self, N_rb_dl, key, out_key, msg_cell_id_name, msg_N_ant_name, msg_cfi_name):
        gr.hier_block2.__init__(self,
            "decode_pcfich_vcm",
            gr.io_signature(3, 3, gr.sizeof_gr_complex * 12 * N_rb_dl),  # Input signature
            gr.io_signature(0, 0, 0)) # Output signature
        
        # register message ports        
        self.message_port_register_hier_out(msg_cell_id_name)
        self.message_port_register_hier_out(msg_N_ant_name)
        self.message_port_register_hier_in(msg_cfi_name)
        # define some variables
        cvlen = 16
        N_ant = 2 # dummy resetable during runtime
        style = "tx_diversity" # PCFICH only uses this value (no spatial multiplexing etc.)
        
        # instatiate blocks with there parameters
        self.demux = lte.pcfich_demux_vcvc(N_rb_dl, key, out_key, msg_cell_id_name)
        self.predecoder = lte.pre_decoder_vcvc(N_ant, cvlen, style)
        self.demapper = lte.layer_demapper_vcvc(N_ant, cvlen, style)
        self.qpsk = lte.qpsk_soft_demod_vcvf(cvlen)
        self.descrambler = lte.pcfich_descrambler_vfvf(out_key, msg_cell_id_name)
        self.unpack = lte.cfi_unpack_vf(out_key, msg_cfi_name)

        # Connect defined blocks
        self.connect((self, 0), (self.demux, 0), (self.predecoder, 0))
        self.connect((self, 1), (self.demux, 1), (self.predecoder, 1))
        self.connect((self, 2), (self.demux, 2), (self.predecoder, 2))
        self.connect(self.predecoder, self.demapper, self.qpsk, self.descrambler, self.unpack)
        
        # Don't forget the message ports
        self.msg_connect(self, msg_N_ant_name, self.predecoder, msg_N_ant_name)
        self.msg_connect(self, msg_N_ant_name, self.demapper, msg_N_ant_name)
        self.msg_connect(self, msg_cell_id_name, self.demux, msg_cell_id_name)
        self.msg_connect(self, msg_cell_id_name, self.descrambler, msg_cell_id_name)
        self.msg_connect(self.unpack, msg_cfi_name, self, msg_cfi_name)