def setUp (self): self.tb = gr.top_block () self.src = gr.vector_source_f([0]*120, False, 120) self.bch = lte.decode_bch_vfvb() self.snk0 = gr.vector_sink_b(24) self.snk1 = gr.vector_sink_b(1) self.tb.connect(self.src, self.bch) self.tb.connect((self.bch, 0), self.snk0) self.tb.connect((self.bch, 1), self.snk1)
def __init__(self): gr.top_block.__init__(self, "LTE flowgraph") ################################################## # Variables ################################################## self.fftlen = fftlen = 2048 self.cpl0 = cpl0 = 160*fftlen/2048 self.cpl = cpl = 144*fftlen/2048 self.slotl = slotl = 7*fftlen+6*cpl+cpl0 self.samp_rate = samp_rate = slotl/0.0005 self.style = style = "tx_diversity" self.interp_val = interp_val = int(samp_rate/1e4) self.N_rb_dl = N_rb_dl = 6 ################################################## # Blocks ################################################## self.lte_remove_cp_cvc_1 = lte.remove_cp_cvc(fftlen) self.lte_pbch_demux_vcvc_1 = lte.pbch_demux_vcvc(N_rb_dl) self.lte_mib_unpack_vb_0 = lte.mib_unpack_vb() self.lte_hier_sss_sync_cc_1 = lte.hier_sss_sync_cc(fftlen) self.lte_hier_pss_sync_cc_0 = lte.hier_pss_sync_cc(fftlen) self.lte_hier_freq_estimate_cc_0 = lte.hier_freq_estimate_cc(fftlen) self.lte_extract_occupied_tones_vcvc_0 = lte.extract_occupied_tones_vcvc(N_rb_dl,fftlen) self.lte_decode_pbch_vcvf_0 = lte.decode_pbch_vcvf() self.lte_decode_bch_vfvb_0 = lte.decode_bch_vfvb() self.lte_cp_time_freq_sync_cc_0 = lte.cp_time_freq_sync_cc(fftlen) self.lte_channel_estimator_0 = lte.channel_estimator(N_rb_dl) self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex*1, samp_rate) self.gr_file_source_0_0 = gr.file_source(gr.sizeof_gr_complex*1, "/home/demel/gr-lte/data/Messung_Resampled_3072MSps.dat", False) self.fft_vxx_0 = fft.fft_vcc(fftlen, True, (window.rectangular(fftlen)), False, 1) ################################################## # Connections ################################################## self.connect((self.gr_file_source_0_0, 0), (self.gr_throttle_0, 0)) self.connect((self.lte_cp_time_freq_sync_cc_0, 0), (self.lte_hier_pss_sync_cc_0, 0)) self.connect((self.gr_throttle_0, 0), (self.lte_cp_time_freq_sync_cc_0, 0)) self.connect((self.lte_hier_pss_sync_cc_0, 0), (self.lte_hier_freq_estimate_cc_0, 0)) self.connect((self.lte_extract_occupied_tones_vcvc_0, 0), (self.lte_channel_estimator_0, 0)) self.connect((self.lte_decode_bch_vfvb_0, 0), (self.lte_mib_unpack_vb_0, 0)) self.connect((self.lte_decode_bch_vfvb_0, 1), (self.lte_mib_unpack_vb_0, 1)) self.connect((self.lte_decode_pbch_vcvf_0, 0), (self.lte_decode_bch_vfvb_0, 0)) self.connect((self.lte_pbch_demux_vcvc_1, 0), (self.lte_decode_pbch_vcvf_0, 0)) self.connect((self.lte_pbch_demux_vcvc_1, 1), (self.lte_decode_pbch_vcvf_0, 1)) self.connect((self.lte_pbch_demux_vcvc_1, 2), (self.lte_decode_pbch_vcvf_0, 2)) self.connect((self.lte_channel_estimator_0, 1), (self.lte_pbch_demux_vcvc_1, 1)) self.connect((self.lte_channel_estimator_0, 0), (self.lte_pbch_demux_vcvc_1, 0)) self.connect((self.lte_remove_cp_cvc_1, 0), (self.fft_vxx_0, 0)) self.connect((self.fft_vxx_0, 0), (self.lte_extract_occupied_tones_vcvc_0, 0)) self.connect((self.lte_hier_sss_sync_cc_1, 0), (self.lte_remove_cp_cvc_1, 0)) self.connect((self.lte_hier_freq_estimate_cc_0, 0), (self.lte_hier_sss_sync_cc_1, 0)) self.connect((self.lte_channel_estimator_0, 2), (self.lte_pbch_demux_vcvc_1, 2)) ################################################## # Asynch Message Connections ################################################## self.msg_connect(self.lte_hier_sss_sync_cc_1, "cell_id", self.lte_decode_pbch_vcvf_0, "cell_id") self.msg_connect(self.lte_hier_sss_sync_cc_1, "cell_id", self.lte_pbch_demux_vcvc_1, "cell_id") self.msg_connect(self.lte_hier_sss_sync_cc_1, "cell_id", self.lte_channel_estimator_0, "cell_id")