Ejemplo n.º 1
0
 def setUp (self):
     self.tb = gr.top_block ()
     
     ############################
     # define variables for test purposes
     self.fftl = fftl = 2048
     N_rb_dl = 6
     self.N_id = N_id = 124
     N_id_1 = N_id/3
     N_id_2 = N_id%3
     
     # This blocks are needed as "dummy" references
     self.tag = lte_swig.sss_tagging2_vcvc(fftl)
     self.eq = lte_swig.linear_OFDM_estimator_vcvc(N_rb_dl)
     self.demux = lte_swig.pbch_demux_vcvc(N_rb_dl)
     self.descr = lte_swig.descrambling_vfvf()
     self.daemon = lte_swig.cell_id_daemon(self.eq, self.demux, self.descr)
     
     #Source
     data = range(2*fftl)
     self.src = gr.vector_source_c(data, False, fftl)        
     # UUT
     self.calc = lte_swig.sss_calc2_vc(self.tag, self.daemon, fftl)
     
     self.tb.connect(self.src, self.calc)
Ejemplo n.º 2
0
    def setUp(self):
        self.tb = gr.top_block()

        N_rb_dl = 6

        self.eq = lte_swig.linear_OFDM_equalizer_vcvc(N_rb_dl)
        self.demux = lte_swig.pbch_demux_vcvc(N_rb_dl)
        self.ld = lte_swig.descrambling_vfvf()
        self.daemon = lte_swig.cell_id_daemon(self.eq, self.demux, self.ld)

        self.daemon.set_cell_id(124)
Ejemplo n.º 3
0
 def setUp (self):
     self.tb = gr.top_block ()
     
     N_rb_dl = 6
     
     self.eq   = lte_swig.linear_OFDM_estimator_vcvc(N_rb_dl)
     self.demux= lte_swig.pbch_demux_vcvc(N_rb_dl)
     self.ld   = lte_swig.descrambling_vfvf()
     self.daemon = lte_swig.cell_id_daemon(self.eq,self.demux,self.ld)
     
     self.daemon.set_cell_id(124)
Ejemplo n.º 4
0
    def setUp(self):
        self.tb = gr.top_block()
        N_rb_dl = 6

        self.eq = lte_swig.linear_OFDM_estimator_vcvc(N_rb_dl)
        self.demux = lte_swig.pbch_demux_vcvc(N_rb_dl)
        self.ld = lte_swig.descrambling_vfvf()
        self.daemon = lte_swig.cell_id_daemon(self.eq, self.demux, self.ld)
        self.dbg = gr.message_debug()

        self.tb.msg_connect(self.daemon, "cell_id", self.dbg, "print")
Ejemplo n.º 5
0
    def setUp (self):
        self.tb = gr.top_block ()
        
        print "qa_pbch_demux_vcvc START"
        
        # Input 1, PBCH frame
        mod=scipy.io.loadmat('/home/demel/exchange/matlab_frame.mat') 
        mat_u1=tuple(mod['frame_mat'].flatten())
        mat_d=range(len(mat_u1))
        for idx, val in enumerate(mat_u1):
            mat_d[idx]=val
        intu1=tuple(mat_d)
        
        # Input 2, CE values for antenna port 1
        mod=scipy.io.loadmat('/home/demel/exchange/matlab_ce_frame_mat1.mat')
        mat_u2=tuple(mod['ce_frame_mat1'].flatten())
        mat_d=range(len(mat_u2))
        for idx, val in enumerate(mat_u2):
            mat_d[idx]=val
        intu2=tuple(mat_d)

        # Input 2, CE values for antenna port 1
        mod=scipy.io.loadmat('/home/demel/exchange/matlab_ce_frame_mat2.mat')
        mat_u2=tuple(mod['ce_frame_mat2'].flatten())
        mat_d=range(len(mat_u2))
        for idx, val in enumerate(mat_u2):
            mat_d[idx]=val
        intu3=tuple(mat_d)

        
        self.src1 = gr.vector_source_c( intu1, False, 72)
        self.src2 = gr.vector_source_c( intu2, False, 72)
        self.src3 = gr.vector_source_c( intu3, False, 72)
        
        cell_id = 124
        N_rb_dl = 6
        self.demux = lte_swig.pbch_demux_vcvc(N_rb_dl) # cell_id,
        self.demux.set_cell_id(cell_id)
        
        self.snk1 = gr.vector_sink_c(240)
        self.snk2 = gr.vector_sink_c(240)
        self.snk3 = gr.vector_sink_c(240)
        
        self.tb.connect(self.src1,(self.demux,0) )
        self.tb.connect( (self.demux,0),self.snk1)
        self.tb.connect(self.src2,(self.demux,1) )
        self.tb.connect( (self.demux,1),self.snk2)
        self.tb.connect(self.src3,(self.demux,2) )
        self.tb.connect( (self.demux,2),self.snk3)
Ejemplo n.º 6
0
    def setUp(self):
        self.tb = gr.top_block()

        print "qa_pbch_demux_vcvc START"

        # Input 1, PBCH frame
        mod = scipy.io.loadmat('/home/demel/exchange/matlab_frame.mat')
        mat_u1 = tuple(mod['frame_mat'].flatten())
        mat_d = range(len(mat_u1))
        for idx, val in enumerate(mat_u1):
            mat_d[idx] = val
        intu1 = tuple(mat_d)

        # Input 2, CE values for antenna port 1
        mod = scipy.io.loadmat('/home/demel/exchange/matlab_ce_frame_mat1.mat')
        mat_u2 = tuple(mod['ce_frame_mat1'].flatten())
        mat_d = range(len(mat_u2))
        for idx, val in enumerate(mat_u2):
            mat_d[idx] = val
        intu2 = tuple(mat_d)

        # Input 2, CE values for antenna port 1
        mod = scipy.io.loadmat('/home/demel/exchange/matlab_ce_frame_mat2.mat')
        mat_u2 = tuple(mod['ce_frame_mat2'].flatten())
        mat_d = range(len(mat_u2))
        for idx, val in enumerate(mat_u2):
            mat_d[idx] = val
        intu3 = tuple(mat_d)

        self.src1 = gr.vector_source_c(intu1, False, 72)
        self.src2 = gr.vector_source_c(intu2, False, 72)
        self.src3 = gr.vector_source_c(intu3, False, 72)

        cell_id = 124
        N_rb_dl = 6
        self.demux = lte_swig.pbch_demux_vcvc(N_rb_dl)  # cell_id,
        self.demux.set_cell_id(cell_id)

        self.snk1 = gr.vector_sink_c(240)
        self.snk2 = gr.vector_sink_c(240)
        self.snk3 = gr.vector_sink_c(240)

        self.tb.connect(self.src1, (self.demux, 0))
        self.tb.connect((self.demux, 0), self.snk1)
        self.tb.connect(self.src2, (self.demux, 1))
        self.tb.connect((self.demux, 1), self.snk2)
        self.tb.connect(self.src3, (self.demux, 2))
        self.tb.connect((self.demux, 2), self.snk3)
Ejemplo n.º 7
0
    def setUp (self):
        self.tb = gr.top_block ()

        self.N_rb_dl = N_rb_dl = 50
        self.key = key = "symbol"
        n_carriers = 12*N_rb_dl
        intu = np.zeros(n_carriers,dtype=np.complex)

        self.src1 = blocks.vector_source_c( intu, False, n_carriers)
        #self.src2 = blocks.vector_source_c( intu, False, n_carriers)
        #self.src3 = blocks.vector_source_c( intu, False, n_carriers)

        self.demux = lte.pbch_demux_vcvc(N_rb_dl) # cell_id,

        self.snk1 = blocks.vector_sink_c(240)
        #self.snk2 = blocks.vector_sink_c(240)
        #self.snk3 = blocks.vector_sink_c(240)

        self.tb.connect(self.src1,(self.demux,0) )
        self.tb.connect( (self.demux,0),self.snk1)
Ejemplo n.º 8
0
    def setUp (self):
        self.tb = gr.top_block ()

        self.N_rb_dl = N_rb_dl = 50
        self.key = key = "symbol"
        n_carriers = 12*N_rb_dl
        intu = np.zeros(n_carriers,dtype=np.complex)

        self.src1 = blocks.vector_source_c( intu, False, n_carriers)
        #self.src2 = blocks.vector_source_c( intu, False, n_carriers)
        #self.src3 = blocks.vector_source_c( intu, False, n_carriers)

        self.demux = lte.pbch_demux_vcvc(N_rb_dl, 1) # cell_id,

        self.snk1 = blocks.vector_sink_c(240)
        #self.snk2 = blocks.vector_sink_c(240)
        #self.snk3 = blocks.vector_sink_c(240)

        self.tb.connect(self.src1,(self.demux,0) )
        self.tb.connect( (self.demux,0),self.snk1)
Ejemplo n.º 9
0
    def setUp (self):
    
        #print os.getpid()
        #raw_input("Press the ANY key to continue")
        setuptime = time.clock()
    
        self.tb = gr.top_block ()
        
        print "\nqa_multi_block_test START"
 

        offset =  1133
        fftl = 512
        cell_id = 124
        N_rb_dl = 6
        I = 768
        D = 1000

        # This first part is for syncing!
        #self.src  = gr.vector_source_c(intu,False,1)
        
        infile1 = '/home/demel/Dokumente/Messungen/Messung_LTE_2012-05-23_12:48:19.dat' # successful!
        infile2 = '/home/demel/Dokumente/Messungen/Messung_LTE_2012-05-23_12:48:07.dat' # failed!
        infile3 = '/home/demel/Dokumente/Messungen/Messung_LTE_2012-05-23_12:46:30.dat' # successful!
        infile4 = '/home/johannes/lte/data/Messung_LTE_2012-05-23_12:47:32.dat' # successful!
        infile5 = '/home/demel/Dokumente/Messungen/Messung_LTE_2012-05-23_12:49:57.dat' # successful!
        
        samps = (fftl*7*2*10+10*fftl)*300 +offset
        input_file = infile3
        print input_file
        
        self.src = gr.file_source(gr.sizeof_gr_complex,input_file, False)
        self.resample = blks2.rational_resampler_ccc(I, D)
        
        self.head1 = gr.head(gr.sizeof_gr_complex, samps)
        #self.tag  = lte_swig.tag_symbol_cc(offset,fftl)
        self.sync = lte_swig.cp_time_freq_sync_cc(fftl)
        self.pss = lte.hier_pss_sync_cc(fftl)
        self.est = lte.hier_freq_estimate_cc(fftl)
        # This is the actual place to initialize self.sss
        # Nevertheless it it the last block to be initialized because it needs pointers to some others.
        # self.sss = lte.hier_sss_sync_cc(fftl)
        
        #This part does still process all data (more ore less)
        self.rcp  = lte_swig.remove_cp_cvc(fftl)        
        self.fft  = gr.fft_vcc(fftl,True,window.rectangular(fftl),False,1)
        self.ext  = lte_swig.extract_occupied_tones_vcvc(N_rb_dl,fftl)
        
        self.eq   = lte.linear_OFDM_estimator_hier_vcvc(N_rb_dl)#cell_id,
        #self.eq.set_cell_id(cell_id)
        #self.sh1  = gr.skiphead(gr.sizeof_gr_complex*12*N_rb_dl,7)
        #self.sh2  = gr.skiphead(gr.sizeof_gr_complex*12*N_rb_dl,7)
        #self.sh3  = gr.skiphead(gr.sizeof_gr_complex*12*N_rb_dl,7)
        
        # After the next block only the PBCH is processed!
        self.demux= lte_swig.pbch_demux_vcvc(N_rb_dl)#cell_id,
        #self.demux.set_cell_id(cell_id)
        self.pd1  = lte_swig.pre_decoder_vcvc(1,'tx_diversity')
        self.pd2  = lte_swig.pre_decoder_vcvc(2,'tx_diversity')
        self.ldm1 = lte_swig.layer_demapper_vcvc(1,'tx_diversity')
        self.ldm2 = lte_swig.layer_demapper_vcvc(2,'tx_diversity')
        self.int  = gr.interleave(240*8)
        self.dmd  = lte_swig.qpsk_soft_demod_vcvf()
       	self.ld   = lte_swig.descrambling_vfvf()
       	#self.ld.set_cell_id(cell_id)
        self.lru  = lte_swig.rate_unmatch_vff()
        

        # After Viterbi decoding, only bits are processed!
        self.vit  = lte.viterbi_vfvb()
        self.crc  = lte_swig.crc_calculator_vbvb()
        self.mib  = lte_swig.mib_unpack_vb()
        
        #############################################################
        # This last block is just a daemon to propagate the calculated cell id
        #############################################################
        
        self.daemon = lte.cell_id_daemon(self.eq.get_eq(),self.demux, self.ld)
        self.sss = lte.hier_sss_sync_cc(self.daemon, fftl)
        
        # declaration of additional sink blocks for tests
        #self.snk1 = gr.vector_sink_f(120)
        #self.snk2 = gr.vector_sink_b(40)
        
        
        # Connect all blocks together!
        self.tb.connect(self.src,self.resample,self.head1,self.sync,self.pss,self.est,self.sss,self.rcp,self.fft,self.ext,self.eq)#
        
        self.tb.connect( (self.eq,0), (self.demux,0) )
        self.tb.connect( (self.eq,1), (self.demux,1) )
        self.tb.connect( (self.eq,2), (self.demux,2) )
        
        self.tb.connect( (self.demux,0) ,(self.pd1,0) )
        self.tb.connect( (self.demux,1) ,(self.pd1,1) )
        self.tb.connect( (self.demux,0) ,(self.pd2,0) )
        self.tb.connect( (self.demux,1) ,(self.pd2,1) )
        self.tb.connect( (self.demux,2) ,(self.pd2,2) )
        self.tb.connect(self.pd1,self.ldm1,(self.int,0) )
        self.tb.connect(self.pd2,self.ldm2,(self.int,1) )
        self.tb.connect(self.int,self.dmd,self.ld,self.lru,self.vit,self.crc)
        self.tb.connect( (self.crc,0),(self.mib,0) )
        self.tb.connect( (self.crc,1),(self.mib,1) )
        
        # additional sink blocks for testing
        #self.tb.connect(self.lru,self.snk1)
        #self.tb.connect(self.vit,self.snk2)
        
        print "\n\nsetuptime = " + str(time.clock() - setuptime) + "\n\n"
Ejemplo n.º 10
0
    def setUp(self):

        #print os.getpid()
        #raw_input("Press the ANY key to continue")
        setuptime = time.clock()

        self.tb = gr.top_block()

        print "\nqa_multi_block_test START"

        offset = 1133
        fftl = 512
        cell_id = 124
        N_rb_dl = 6
        I = 768
        D = 1000

        # This first part is for syncing!
        #self.src  = gr.vector_source_c(intu,False,1)

        infile1 = '/home/demel/Dokumente/Messungen/Messung_LTE_2012-05-23_12:48:19.dat'  # successful!
        infile2 = '/home/demel/Dokumente/Messungen/Messung_LTE_2012-05-23_12:48:07.dat'  # failed!
        infile3 = '/home/demel/Dokumente/Messungen/Messung_LTE_2012-05-23_12:46:30.dat'  # successful!
        infile4 = '/home/johannes/lte/data/Messung_LTE_2012-05-23_12:47:32.dat'  # successful!
        infile5 = '/home/demel/Dokumente/Messungen/Messung_LTE_2012-05-23_12:49:57.dat'  # successful!

        samps = (fftl * 7 * 2 * 10 + 10 * fftl) * 300 + offset
        input_file = infile3
        print input_file

        self.src = gr.file_source(gr.sizeof_gr_complex, input_file, False)
        self.resample = blks2.rational_resampler_ccc(I, D)

        self.head1 = gr.head(gr.sizeof_gr_complex, samps)
        #self.tag  = lte_swig.tag_symbol_cc(offset,fftl)
        self.sync = lte_swig.cp_time_freq_sync_cc(fftl)
        self.pss = lte.hier_pss_sync_cc(fftl)
        self.est = lte.hier_freq_estimate_cc(fftl)
        # This is the actual place to initialize self.sss
        # Nevertheless it it the last block to be initialized because it needs pointers to some others.
        # self.sss = lte.hier_sss_sync_cc(fftl)

        #This part does still process all data (more ore less)
        self.rcp = lte_swig.remove_cp_cvc(fftl)
        self.fft = gr.fft_vcc(fftl, True, window.rectangular(fftl), False, 1)
        self.ext = lte_swig.extract_occupied_tones_vcvc(N_rb_dl, fftl)

        self.eq = lte.linear_OFDM_estimator_hier_vcvc(N_rb_dl)  #cell_id,
        #self.eq.set_cell_id(cell_id)
        #self.sh1  = gr.skiphead(gr.sizeof_gr_complex*12*N_rb_dl,7)
        #self.sh2  = gr.skiphead(gr.sizeof_gr_complex*12*N_rb_dl,7)
        #self.sh3  = gr.skiphead(gr.sizeof_gr_complex*12*N_rb_dl,7)

        # After the next block only the PBCH is processed!
        self.demux = lte_swig.pbch_demux_vcvc(N_rb_dl)  #cell_id,
        #self.demux.set_cell_id(cell_id)
        self.pd1 = lte_swig.pre_decoder_vcvc(1, 'tx_diversity')
        self.pd2 = lte_swig.pre_decoder_vcvc(2, 'tx_diversity')
        self.ldm1 = lte_swig.layer_demapper_vcvc(1, 'tx_diversity')
        self.ldm2 = lte_swig.layer_demapper_vcvc(2, 'tx_diversity')
        self.int = gr.interleave(240 * 8)
        self.dmd = lte_swig.qpsk_soft_demod_vcvf()
        self.ld = lte_swig.descrambling_vfvf()
        #self.ld.set_cell_id(cell_id)
        self.lru = lte_swig.rate_unmatch_vff()

        # After Viterbi decoding, only bits are processed!
        self.vit = lte.viterbi_vfvb()
        self.crc = lte_swig.crc_calculator_vbvb()
        self.mib = lte_swig.mib_unpack_vb()

        #############################################################
        # This last block is just a daemon to propagate the calculated cell id
        #############################################################

        self.daemon = lte.cell_id_daemon(self.eq.get_eq(), self.demux, self.ld)
        self.sss = lte.hier_sss_sync_cc(self.daemon, fftl)

        # declaration of additional sink blocks for tests
        #self.snk1 = gr.vector_sink_f(120)
        #self.snk2 = gr.vector_sink_b(40)

        # Connect all blocks together!
        self.tb.connect(self.src, self.resample, self.head1, self.sync,
                        self.pss, self.est, self.sss, self.rcp, self.fft,
                        self.ext, self.eq)  #

        self.tb.connect((self.eq, 0), (self.demux, 0))
        self.tb.connect((self.eq, 1), (self.demux, 1))
        self.tb.connect((self.eq, 2), (self.demux, 2))

        self.tb.connect((self.demux, 0), (self.pd1, 0))
        self.tb.connect((self.demux, 1), (self.pd1, 1))
        self.tb.connect((self.demux, 0), (self.pd2, 0))
        self.tb.connect((self.demux, 1), (self.pd2, 1))
        self.tb.connect((self.demux, 2), (self.pd2, 2))
        self.tb.connect(self.pd1, self.ldm1, (self.int, 0))
        self.tb.connect(self.pd2, self.ldm2, (self.int, 1))
        self.tb.connect(self.int, self.dmd, self.ld, self.lru, self.vit,
                        self.crc)
        self.tb.connect((self.crc, 0), (self.mib, 0))
        self.tb.connect((self.crc, 1), (self.mib, 1))

        # additional sink blocks for testing
        #self.tb.connect(self.lru,self.snk1)
        #self.tb.connect(self.vit,self.snk2)

        print "\n\nsetuptime = " + str(time.clock() - setuptime) + "\n\n"