def test_int_001 (self):
     lenx = 64
     src0 = [0,0]
     i = 0
     while i < lenx-3:
         i+=2
         src0.append(i)
         src0.append(0)
     src1 = [1,0]
     i=1
     while i < lenx-2:
         i+=2
         src1.append(i)
         src1.append(0)
     a = sb.DataSource(dataFormat="float")
     b = sb.DataSource(dataFormat="float")
     op = gr.interleave (gr.sizeof_gr_complex, 2)
     dst = gr.vector_sink_c ()
     a.connect(op, providesPortName="complex_in_0")
     b.connect(op, providesPortName="complex_in_1")
     a.push(src0,EOS=True)
     b.push(src1,EOS=True)
     self.tb.connect (op, dst)
     self.tb.run ()
     expected_result = tuple (range (lenx))
     result_data = dst.data ()
     self.assertComplexTuplesAlmostEqual (expected_result, result_data)
    def test_int_001 (self):
        lenx = 64
        src0 = range (0, lenx, 4)
        src1 = range (1, lenx, 4)
        src2 = range (2, lenx, 4)
        src3 = range (3, lenx, 4)
        a = sb.DataSource(dataFormat="long")
        b = sb.DataSource(dataFormat="long")
        c = sb.DataSource(dataFormat="long")
        d = sb.DataSource(dataFormat="long")
        op = gr.interleave (gr.sizeof_int, 4)
        dst = gr.vector_sink_i ()
        a.connect(op, providesPortName="long_in_0")
        b.connect(op, providesPortName="long_in_1")
        c.connect(op, providesPortName="long_in_2")
        d.connect(op, providesPortName="long_in_3")
        a.push(src0,EOS=True)
        b.push(src1,EOS=True)
        c.push(src2,EOS=True)
        d.push(src3,EOS=True)
        self.tb.connect (op, dst)
        self.tb.run ()
        expected_result = tuple (range (lenx))
        result_data = dst.data ()

        self.assertFloatTuplesAlmostEqual (expected_result, result_data)
Example #3
0
    def __init__(self):
        gr.hier_block2.__init__(self,
            "decode_pbch_vcvf",
            gr.io_signature(3, 3, gr.sizeof_gr_complex*240),  # Input signature
            gr.io_signature(1, 1, gr.sizeof_float*120)) # Output signature
        self.message_port_register_hier_out("cell_id")
        # Define blocks and connect them
        style = "tx_diversity"
        self.pre_decoder_1ant = lte.pre_decoder_vcvc(1, style)
        self.pre_decoder_2ant = lte.pre_decoder_vcvc(2, style)
        self.demapper_1ant = lte.layer_demapper_vcvc(1, style)
        self.demapper_2ant = lte.layer_demapper_vcvc(2, style)
        self.interleave = gr.interleave(240*gr.sizeof_gr_complex)
        self.demod = lte.qpsk_soft_demod_vcvf()
        self.descr = lte.descrambling_vfvf()
        
        self.msg_connect(self, "cell_id", self.descr, "cell_id")

        self.connect( (self, 0) , (self.pre_decoder_1ant, 0) )
        self.connect( (self, 1) , (self.pre_decoder_1ant, 1) )
        self.connect( (self, 0) , (self.pre_decoder_2ant, 0) )
        self.connect( (self, 1) , (self.pre_decoder_2ant, 1) )
        self.connect( (self, 2) , (self.pre_decoder_2ant, 2) )
        
        self.connect( self.pre_decoder_1ant, self.demapper_1ant, (self.interleave, 0) )
        self.connect( self.pre_decoder_2ant, self.demapper_2ant, (self.interleave, 1) )
        
        
        self.connect(self.interleave, self.descr, self)
def graph (args):

    nargs = len (args)
    if nargs == 1:
	infile = args[0]
    else:
	sys.stderr.write('usage: interp.py input_file\n')
	sys.exit (1)

    sampling_freq = 6400000

    fg = gr.flow_graph ()

    src0 = gr.file_source (gr.sizeof_gr_complex,infile)
    src1 = gr.sig_source_c (sampling_freq, gr.GR_CONST_WAVE, 1, 0)
    src2 = gr.sig_source_c (sampling_freq, gr.GR_CONST_WAVE, 1, 0)

    interlv = gr.interleave(gr.sizeof_gr_complex)

    lp_coeffs = gr.firdes.low_pass ( 3, 19.2e6, 3.2e6, .5e6, gr.firdes.WIN_HAMMING )
    lp = gr.fir_filter_ccf ( 1, lp_coeffs )

    file = gr.file_sink(gr.sizeof_gr_complex,"/tmp/atsc_pipe_1")

    fg.connect( src0, (interlv, 0) )
    fg.connect( src1, (interlv, 1) )
    fg.connect( src2, (interlv, 2) )
    fg.connect( interlv, lp, file )

    fg.start()
    raw_input ('Head End: Press Enter to stop')
    fg.stop()
Example #5
0
    def __init__(self):
        gr.top_block.__init__(self)

        usage = "%prog: [options] side-A-tx-freq side-B-tx-freq"
        parser = OptionParser(option_class=eng_option, usage=usage)
        (options, args) = parser.parse_args()

        if len(args) != 2:
            parser.print_help()
            raise SystemExit
        else:
            freq0 = str_to_num(args[0])
            freq1 = str_to_num(args[1])

        # ----------------------------------------------------------------
        # Set up USRP to transmit on both daughterboards

        self.u = usrp.sink_c(nchan=2)  # say we want two channels

        self.dac_rate = self.u.dac_rate()  # 128 MS/s
        self.usrp_interp = 400
        self.u.set_interp_rate(self.usrp_interp)
        self.usrp_rate = self.dac_rate / self.usrp_interp  # 320 kS/s

        # we're using both daughterboard slots, thus subdev is a 2-tuple
        self.subdev = (self.u.db(0, 0), self.u.db(1, 0))
        print "Using TX d'board %s" % (self.subdev[0].side_and_name(),)
        print "Using TX d'board %s" % (self.subdev[1].side_and_name(),)

        # set up the Tx mux so that
        #  channel 0 goes to Slot A I&Q and channel 1 to Slot B I&Q
        self.u.set_mux(0xBA98)

        self.subdev[0].set_gain(self.subdev[0].gain_range()[1])  # set max Tx gain
        self.subdev[1].set_gain(self.subdev[1].gain_range()[1])  # set max Tx gain

        self.set_freq(0, freq0)
        self.set_freq(1, freq1)
        self.subdev[0].set_enable(True)  # enable transmitter
        self.subdev[1].set_enable(True)  # enable transmitter

        # ----------------------------------------------------------------
        # build two signal sources, interleave them, amplify and connect them to usrp

        sig0 = example_signal_0(self.usrp_rate)
        sig1 = example_signal_1(self.usrp_rate)

        intl = gr.interleave(gr.sizeof_gr_complex)
        self.connect(sig0, (intl, 0))
        self.connect(sig1, (intl, 1))

        # apply some gain
        if_gain = 10000
        ifamp = gr.multiply_const_cc(if_gain)

        # and wire them up
        self.connect(intl, ifamp, self.u)
Example #6
0
    def __init__(self, Source):
        gr.top_block.__init__(self, "Top Block")

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 750e3
        self.transition = transition = 100e3
        self.cutoff = cutoff = 100000


        ##################################################
        # Blocks
        ##################################################
        self.frame_source = FrameS.FrameSource(Source)

        self.gr_short_to_float_0 = gr.short_to_float(1, 32768)
        self.gr_short_to_float_1 = gr.short_to_float(1, 32768)

        self.high_pass_filter_0 = gr.fir_filter_fff(1, firdes.high_pass(
			1, samp_rate, cutoff, transition, firdes.WIN_RECTANGULAR, 6.76))
        self.high_pass_filter_1 = gr.fir_filter_fff(1, firdes.high_pass(
			1, samp_rate, cutoff, transition, firdes.WIN_RECTANGULAR, 6.76))

        self.gr_float_to_short_0 = gr.float_to_short(1, 32768)
        self.gr_float_to_short_1 = gr.float_to_short(1, 32768)

        self.threshold = Threshold.CustomTwoChannelThreshold()

        self.gr_interleave = gr.interleave(gr.sizeof_short*1)

        self.frame_sink = FrameTFS.FrameToFileSink()


        ##################################################
        # Connections
        ##################################################
        self.connect((self.frame_source, 0), (self.gr_short_to_float_0, 0))
        self.connect((self.frame_source, 1), (self.gr_short_to_float_1, 0))

        self.connect((self.gr_short_to_float_0, 0), (self.high_pass_filter_0, 0))
        self.connect((self.gr_short_to_float_1, 0), (self.high_pass_filter_1, 0))

        self.connect((self.high_pass_filter_0, 0), (self.gr_float_to_short_0, 0))
        self.connect((self.high_pass_filter_1, 0), (self.gr_float_to_short_1, 0))

        self.connect((self.gr_float_to_short_0, 0), (self.threshold, 0))
        self.connect((self.gr_float_to_short_1, 0), (self.threshold, 1))

        self.connect((self.threshold, 0), (self.gr_interleave, 0))
        self.connect((self.threshold, 1), (self.gr_interleave, 1))

        self.connect((self.gr_interleave, 0), (self.frame_sink, 0))
    def test_int_001 (self):
        lenx = 64
        src0 = range (0, lenx, 1)
        a = sb.DataSource(dataFormat="long")
        op = gr.interleave (gr.sizeof_int, 1)
        dst = gr.vector_sink_i ()
        a.connect(op, providesPortName="long_in")
        a.push(src0,EOS=True)
        self.tb.connect (op, dst)
        self.tb.run ()
        expected_result = tuple (range (lenx))
        result_data = dst.data ()

        self.assertFloatTuplesAlmostEqual (expected_result, result_data)
Example #8
0
    def test_int_001 (self):
        lenx = 64
        src0 = gr.vector_source_f (range (0, lenx, 4))
        src1 = gr.vector_source_f (range (1, lenx, 4))
        src2 = gr.vector_source_f (range (2, lenx, 4))
        src3 = gr.vector_source_f (range (3, lenx, 4))
        op = gr.interleave (gr.sizeof_float)
        dst = gr.vector_sink_f ()

        self.tb.connect (src0, (op, 0))
        self.tb.connect (src1, (op, 1))
        self.tb.connect (src2, (op, 2))
        self.tb.connect (src3, (op, 3))
        self.tb.connect (op, dst)
        self.tb.run ()
        expected_result = tuple (range (lenx))
        result_data = dst.data ()
        self.assertFloatTuplesAlmostEqual (expected_result, result_data)
 def test_int_001 (self):
     lenx = 64
     src0 = range (0, lenx, 2)
     src1 = range (1, lenx, 2)
     a = sb.DataSource(dataFormat="octet")
     b = sb.DataSource(dataFormat="octet")
     op = gr.interleave (gr.sizeof_char, 2)
     dst = gr.vector_sink_b ()
     a.connect(op, providesPortName="byte_in_0")
     b.connect(op, providesPortName="byte_in_1")
     a.push(src0,EOS=True)
     b.push(src1,EOS=True)
     self.tb.connect (op, dst)
     self.tb.run ()
     expected_result = tuple (range (lenx))
     result_data = dst.data ()
     
     self.assertFloatTuplesAlmostEqual (expected_result, result_data)
Example #10
0
  def __init__(self, N_id_2, decim=16, avg_halfframes=2*8, freq_corr=0, dump=None):
    gr.hier_block2.__init__(
        self, "PSS correlator",
        gr.io_signature(1, 1, gr.sizeof_gr_complex),
        gr.io_signature(1, 1, gr.sizeof_float),
    )
    vec_half_frame = 30720*5/decim
    
    self.taps = []
    for i in range(0,3):
      self.taps.append(gen_pss_td(i, N_re=2048/decim, freq_corr=freq_corr).get_data_conj_rev())
    self.corr = filter.fir_filter_ccc(1, self.taps[N_id_2])
    self.mag = gr.complex_to_mag_squared()
    self.vec = gr.stream_to_vector(gr.sizeof_float*1, vec_half_frame)
    self.deint = gr.deinterleave(gr.sizeof_float*vec_half_frame)
    self.add = gr.add_vff(vec_half_frame)
    self.argmax = gr.argmax_fs(vec_half_frame)
    self.null = gr.null_sink(gr.sizeof_short*1)
    self.max = gr.max_ff(vec_half_frame)
    self.to_float = gr.short_to_float(1, 1./decim)
    self.interleave = gr.interleave(gr.sizeof_float)
    #self.framestart = gr.add_const_ii(-160-144*5-2048*6+30720*5)
    
    self.connect(self, self.corr, self.mag, self.vec)
    self.connect((self.argmax,1), self.null)
    #self.connect(self.argmax, self.to_float, self.to_int, self.framestart, self)
    self.connect(self.argmax, self.to_float, self.interleave, self)
    self.connect(self.max, (self.interleave,1))
    
    if avg_halfframes == 1:
      self.connect(self.vec, self.argmax)
      self.connect(self.vec, self.max)
    else:
      self.connect(self.vec, self.deint)
      self.connect(self.add, self.argmax)
      self.connect(self.add, self.max)
      for i in range(0, avg_halfframes):
        self.connect((self.deint, i), (self.add, i))

    if dump != None:
      self.connect(self.mag, gr.file_sink(gr.sizeof_float, dump + "_pss_corr_f.cfile"))
      self.connect(self.add, gr.file_sink(gr.sizeof_float*vec_half_frame, dump + "_pss_corr_add_f.cfile"))
Example #11
0
    def __init__(self, which):
        """
		USRP simple sink contructor.
		@param which the unit number
		"""
        # initialize hier2 block
        gr.hier_block2.__init__(
            self, "usrp_dual_sink", gr.io_signature(2, 2, self._get_io_size()), gr.io_signature(0, 0, 0)
        )
        # create usrp object
        self._make_usrp(which=which, nchan=2)
        subdev_spec_a = common.to_spec("A")
        subdev_spec_b = common.to_spec("B")
        self._get_u().set_mux(self._get_u().determine_tx_mux_value(subdev_spec_a, subdev_spec_b))
        self._subdev_a = self._get_u().selected_subdev(subdev_spec_a)
        self._subdev_b = self._get_u().selected_subdev(subdev_spec_b)
        # connect
        inter = gr.interleave(self._get_io_size())
        self.connect(inter, self._get_u())
        for i in range(2):
            self.connect((self, i), (inter, i))
Example #12
0
    def __init__(self, Source):
        gr.top_block.__init__(self, "Top Block")

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 750e3


        ##################################################
        # Blocks
        ##################################################
        self.frame_source = FrameS.FrameSource(Source, N=6*1024, complete_buffs_only = False)
        self.frame_sink = FrameTFS.FrameToFileSink()
        self.threshold = Threshold.CustomTwoChannelThreshold()
        self.gr_deinterleave = gr.deinterleave(gr.sizeof_short*1)
        self.gr_interleave = gr.interleave(gr.sizeof_short*1)

        self.sink_queue = gr.msg_queue()
        self.msg_sink = gr.message_sink(gr.sizeof_short, self.sink_queue, True)
        self.testblock = custom_block(None)


        ##################################################
        # Connections
        ##################################################
        self.connect((self.frame_source, 0), (self.gr_deinterleave, 0))

        self.connect((self.gr_deinterleave, 0), (self.threshold, 0))
        self.connect((self.gr_deinterleave, 1), (self.threshold, 1))

        self.connect((self.threshold, 0), (self.gr_interleave, 0))
        self.connect((self.threshold, 1), (self.gr_interleave, 1))

        self.connect((self.gr_interleave, 0), (self.frame_sink, 0))


        self.connect((self.frame_source, 0), (self.testblock, 0))
        self.connect((self.testblock, 0), (self.msg_sink, 0))
Example #13
0
    def __init__(self, type="BER", win_size=default_win_size, bits_per_symbol=2):
        """
		Error rate constructor.
		@param type a string 'BER' or 'SER'
		@param win_size the number of samples to calculate over
		@param bits_per_symbol the number of information bits per symbol (BER only)
		"""
        # init
        gr.hier_block2.__init__(
            self, "error_rate", gr.io_signature(2, 2, gr.sizeof_char), gr.io_signature(1, 1, gr.sizeof_float)
        )
        # initialize ber and ser
        self.ber_ = 0
        self.ser_ = 0

        assert type in ("BER", "SER")
        self._max_samples = win_size
        self._bits_per_symbol = bits_per_symbol
        # setup message queue
        msg_source = gr.message_source(gr.sizeof_float, 1)
        self._msgq_source = msg_source.msgq()
        msgq_sink = gr.msg_queue(2)
        msg_sink = gr.message_sink(gr.sizeof_char, msgq_sink, False)  # False -> blocking
        inter = gr.interleave(gr.sizeof_char)
        # start thread
        self._num_errs = 0
        self._err_index = 0
        self._num_samps = 0
        self._err_array = numpy.zeros(self._max_samples, numpy.int8)
        if type == "BER":
            input_watcher(msgq_sink, self._handler_ber)
        elif type == "SER":
            input_watcher(msgq_sink, self._handler_ser)
            # connect
        self.connect(msg_source, self)
        self.connect((self, 0), (inter, 0))
        self.connect((self, 1), (inter, 1))
        self.connect(inter, msg_sink)
Example #14
0
	def __init__(self, callback, options):
		gr.top_block.__init__(self)
		packet_len = 12160 
		options.sender = True
		self.txpath = transmit_path.transmit_path(options)
		options.sender = False
		self.rxpath = receive_path.receive_path(callback, options)		
		self.tovector_1 = gr.stream_to_vector(gr.sizeof_gr_complex, packet_len)
		self.tovector_2 = gr.stream_to_vector(gr.sizeof_gr_complex, packet_len)
		self.tostream = gr.vector_to_stream(gr.sizeof_gr_complex, packet_len)
		self.interleaver = gr.interleave(gr.sizeof_gr_complex*packet_len)
		#self.noise = gr.noise_source_c(gr.GR_GAUSSIAN, options.noise, 1002)
		self.file_sink = gr.file_sink(gr.sizeof_gr_complex, "transmitted.dat")
		#self.file_source = gr.file_source(gr.sizeof_gr_complex, "transmitted.dat", True)
		self.null_source = gr.null_source(gr.sizeof_gr_complex)
		#self.throttle = gr.throttle(gr.sizeof_gr_complex, 500000)
		#self.add = gr.add_cc()

		self.connect(self.txpath, self.tovector_1, (self.interleaver, 0))
		self.connect(self.null_source, self.tovector_2, (self.interleaver, 1))
		self.connect(self.interleaver, self.tostream)
		self.connect(self.tostream, self.file_sink)
		self.connect(self.tostream, self.rxpath)
Example #15
0
    def __init__(self, FileOrDir):
        gr.top_block.__init__(self, "Top Block")

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 750e3


        ##################################################
        # Blocks
        ##################################################
        self.frame_source = fs.frame_source_ss(FileOrDir)
        self.frame_sink = FrameTFS.FrameToFileSink()
        self.gr_interleave = gr.interleave(gr.sizeof_short*1)


        ##################################################
        # Connections
        ##################################################
        self.connect((self.frame_source, 0), (self.gr_interleave, 0))
        self.connect((self.frame_source, 1), (self.gr_interleave, 1))

        self.connect((self.gr_interleave, 0), (self.frame_sink, 0))
Example #16
0
	def __init__(self):
		gr.top_block.__init__(self, "LTE flowgraph")
		Qt.QWidget.__init__(self)
		self.setWindowTitle("LTE flowgraph")
		self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
		self.top_scroll_layout = Qt.QVBoxLayout()
		self.setLayout(self.top_scroll_layout)
		self.top_scroll = Qt.QScrollArea()
		self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame)
		self.top_scroll_layout.addWidget(self.top_scroll)
		self.top_scroll.setWidgetResizable(True)
		self.top_widget = Qt.QWidget()
		self.top_scroll.setWidget(self.top_widget)
		self.top_layout = Qt.QVBoxLayout(self.top_widget)
		self.top_grid_layout = Qt.QGridLayout()
		self.top_layout.addLayout(self.top_grid_layout)


		##################################################
		# Variables
		##################################################
		self.fftlen = fftlen = 512
		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.eq = lte.linear_OFDM_equalizer_hier_vcvc(N_rb_dl)
		self.descr = lte.descrambling_vfvf()
		self.demux = lte.pbch_demux_vcvc(N_rb_dl)
		self.daemon = lte.cell_id_daemon(self.eq.eq, self.demux, self.descr)
		self.qtgui_sink_x_0 = qtgui.sink_c(
			1024, #fftsize
			firdes.WIN_BLACKMAN_hARRIS, #wintype
			0, #fc
			samp_rate, #bw
			"QT GUI Plot", #name
			True, #plotfreq
			True, #plotwaterfall
			True, #plottime
			True, #plotconst
		)
		self._qtgui_sink_x_0_win = sip.wrapinstance(self.qtgui_sink_x_0.pyqwidget(), Qt.QWidget)
		self.top_layout.addWidget(self._qtgui_sink_x_0_win)
		self.lte_viterbi_vfvb_0 = lte.viterbi_vfvb()
		self.lte_remove_cp_cvc_1 = lte.remove_cp_cvc(fftlen)
		self.lte_rate_unmatch_vff_0 = lte.rate_unmatch_vff()
		self.lte_qpsk_soft_demod_vcvf_0 = lte.qpsk_soft_demod_vcvf()
		self.lte_pss_sync_hier_cc_0 = lte.pss_sync_hier_cc(fftlen)
		self.lte_pre_decoder_vcvc_0_0 = lte.pre_decoder_vcvc(2, style)
		self.lte_pre_decoder_vcvc_0 = lte.pre_decoder_vcvc(1, style)
		self.lte_mib_unpack_vb_0 = lte.mib_unpack_vb()
		self.lte_layer_demapper_vcvc_0_0 = lte.layer_demapper_vcvc(2, style)
		self.lte_layer_demapper_vcvc_0 = lte.layer_demapper_vcvc(1, style)
		self.lte_hier_sss_sync_cc_0 = lte.hier_sss_sync_cc(self.daemon, 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_crc_calculator_vbvb_0 = lte.crc_calculator_vbvb()
		self.lte_cp_time_freq_sync_cc_0 = lte.cp_time_freq_sync_cc(fftlen)
		self.gr_vector_to_stream_0 = gr.vector_to_stream(gr.sizeof_gr_complex*1, 240)
		self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex*1, samp_rate)
		self.gr_interleave_0 = gr.interleave(gr.sizeof_gr_complex*240)
		self.gr_file_source_0 = gr.file_source(gr.sizeof_gr_complex*1, "/home/demel/Dokumente/Messungen_31_10_2012/samples_12.5MSps_20dB.iq", False)
		self.fft_vxx_0 = fft.fft_vcc(fftlen, True, (window.rectangular(fftlen)), False, 1)
		self.blks2_rational_resampler_xxx_0 = blks2.rational_resampler_ccc(
			interpolation=interp_val,
			decimation=1250,
			taps=None,
			fractional_bw=None,
		)

		##################################################
		# Connections
		##################################################
		self.connect((self.gr_file_source_0, 0), (self.blks2_rational_resampler_xxx_0, 0))
		self.connect((self.blks2_rational_resampler_xxx_0, 0), (self.gr_throttle_0, 0))
		self.connect((self.lte_hier_freq_estimate_cc_0, 0), (self.lte_hier_sss_sync_cc_0, 0))
		self.connect((self.lte_pss_sync_hier_cc_0, 0), (self.lte_hier_freq_estimate_cc_0, 0))
		self.connect((self.lte_cp_time_freq_sync_cc_0, 0), (self.lte_pss_sync_hier_cc_0, 0))
		self.connect((self.gr_throttle_0, 0), (self.lte_cp_time_freq_sync_cc_0, 0))
		self.connect((self.lte_hier_sss_sync_cc_0, 0), (self.lte_remove_cp_cvc_1, 0))
		self.connect((self.fft_vxx_0, 0), (self.lte_extract_occupied_tones_vcvc_0, 0))
		self.connect((self.lte_remove_cp_cvc_1, 0), (self.fft_vxx_0, 0))
		self.connect((self.lte_extract_occupied_tones_vcvc_0, 0), (self.eq, 0))
		self.connect((self.lte_pre_decoder_vcvc_0, 0), (self.lte_layer_demapper_vcvc_0, 0))
		self.connect((self.eq, 0), (self.demux, 0))
		self.connect((self.eq, 1), (self.demux, 1))
		self.connect((self.eq, 2), (self.demux, 2))
		self.connect((self.lte_pre_decoder_vcvc_0_0, 0), (self.lte_layer_demapper_vcvc_0_0, 0))
		self.connect((self.lte_layer_demapper_vcvc_0_0, 0), (self.gr_interleave_0, 1))
		self.connect((self.demux, 1), (self.lte_pre_decoder_vcvc_0_0, 1))
		self.connect((self.demux, 1), (self.lte_pre_decoder_vcvc_0, 1))
		self.connect((self.demux, 0), (self.lte_pre_decoder_vcvc_0, 0))
		self.connect((self.demux, 2), (self.lte_pre_decoder_vcvc_0_0, 2))
		self.connect((self.demux, 0), (self.lte_pre_decoder_vcvc_0_0, 0))
		self.connect((self.lte_qpsk_soft_demod_vcvf_0, 0), (self.descr, 0))
		self.connect((self.gr_interleave_0, 0), (self.lte_qpsk_soft_demod_vcvf_0, 0))
		self.connect((self.lte_layer_demapper_vcvc_0, 0), (self.gr_interleave_0, 0))
		self.connect((self.descr, 0), (self.lte_rate_unmatch_vff_0, 0))
		self.connect((self.lte_crc_calculator_vbvb_0, 1), (self.lte_mib_unpack_vb_0, 1))
		self.connect((self.lte_crc_calculator_vbvb_0, 0), (self.lte_mib_unpack_vb_0, 0))
		self.connect((self.lte_viterbi_vfvb_0, 0), (self.lte_crc_calculator_vbvb_0, 0))
		self.connect((self.lte_rate_unmatch_vff_0, 0), (self.lte_viterbi_vfvb_0, 0))
		self.connect((self.gr_interleave_0, 0), (self.gr_vector_to_stream_0, 0))
		self.connect((self.gr_vector_to_stream_0, 0), (self.qtgui_sink_x_0, 0))
Example #17
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"
Example #18
0
    def __init__(self, FileOrDir):
        gr.top_block.__init__(self, "Top Block")

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 750e3
        self.transition = transition = 100e3
        self.cutoff = cutoff = 100000


        ##################################################
        # Blocks
        ##################################################
        self.frame_source = fs.frame_source_ss(FileOrDir)

        self.gr_short_to_float_0 = gr.short_to_float(1, 32768)
        self.gr_short_to_float_1 = gr.short_to_float(1, 32768)

        self.high_pass_filter_0 = gr.fir_filter_fff(1, 
							firdes.high_pass(1,			# gain
									samp_rate,		# sampling rate
									cutoff,			# cutoff frequency
									transition,		# transition width
									firdes.WIN_RECTANGULAR,	# filter type
									6.76))			# beta = 6.76 by default
        self.high_pass_filter_1 = gr.fir_filter_fff(1, 
							firdes.high_pass(1,			# gain
									samp_rate,		# sampling rate
									cutoff,			# cutoff frequency
									transition,		# transition width
									firdes.WIN_RECTANGULAR,	# filter type
									6.76))			# beta = 6.76 by default

        self.gr_float_to_short_0 = gr.float_to_short(1, 32768)
        self.gr_float_to_short_1 = gr.float_to_short(1, 32768)

        self.gr_threshold = tct.two_channel_threshold_ssss(983, 600, 500)

        self.gr_interleave = gr.interleave(gr.sizeof_short*1)

        self.frame_sink = FrameTFS.FrameToFileSink()


        ##################################################
        # Connections
        ##################################################
        self.connect((self.frame_source, 0), (self.gr_short_to_float_0, 0))
        self.connect((self.frame_source, 1), (self.gr_short_to_float_1, 0))

        self.connect((self.gr_short_to_float_0, 0), (self.high_pass_filter_0, 0))
        self.connect((self.gr_short_to_float_1, 0), (self.high_pass_filter_1, 0))

        self.connect((self.high_pass_filter_0, 0), (self.gr_float_to_short_0, 0))
        self.connect((self.high_pass_filter_1, 0), (self.gr_float_to_short_1, 0))

        self.connect((self.gr_float_to_short_0, 0), (self.gr_threshold, 0))
        self.connect((self.gr_float_to_short_1, 0), (self.gr_threshold, 1))

        self.connect((self.gr_threshold, 0), (self.gr_interleave, 0))
        self.connect((self.gr_threshold, 1), (self.gr_interleave, 1))

        self.connect((self.gr_interleave, 0), (self.frame_sink, 0))
Example #19
0
	def __init__(self, freq_corr=0, N_id_1=134, avg_frames=1, N_id_2=0, decim=16):
		grc_wxgui.top_block_gui.__init__(self, title="Sss Corr2 Gui")
		_icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png"
		self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY))

		##################################################
		# Parameters
		##################################################
		self.freq_corr = freq_corr
		self.N_id_1 = N_id_1
		self.avg_frames = avg_frames
		self.N_id_2 = N_id_2
		self.decim = decim

		##################################################
		# Variables
		##################################################
		self.vec_half_frame = vec_half_frame = 30720*5/decim
		self.samp_rate = samp_rate = 30720e3/decim
		self.rot = rot = 0
		self.noise_level = noise_level = 0
		self.fft_size = fft_size = 2048/decim

		##################################################
		# Blocks
		##################################################
		_rot_sizer = wx.BoxSizer(wx.VERTICAL)
		self._rot_text_box = forms.text_box(
			parent=self.GetWin(),
			sizer=_rot_sizer,
			value=self.rot,
			callback=self.set_rot,
			label='rot',
			converter=forms.float_converter(),
			proportion=0,
		)
		self._rot_slider = forms.slider(
			parent=self.GetWin(),
			sizer=_rot_sizer,
			value=self.rot,
			callback=self.set_rot,
			minimum=0,
			maximum=1,
			num_steps=100,
			style=wx.SL_HORIZONTAL,
			cast=float,
			proportion=1,
		)
		self.Add(_rot_sizer)
		_noise_level_sizer = wx.BoxSizer(wx.VERTICAL)
		self._noise_level_text_box = forms.text_box(
			parent=self.GetWin(),
			sizer=_noise_level_sizer,
			value=self.noise_level,
			callback=self.set_noise_level,
			label='noise_level',
			converter=forms.float_converter(),
			proportion=0,
		)
		self._noise_level_slider = forms.slider(
			parent=self.GetWin(),
			sizer=_noise_level_sizer,
			value=self.noise_level,
			callback=self.set_noise_level,
			minimum=0,
			maximum=10,
			num_steps=100,
			style=wx.SL_HORIZONTAL,
			cast=float,
			proportion=1,
		)
		self.Add(_noise_level_sizer)
		self.wxgui_scopesink2_0 = scopesink2.scope_sink_c(
			self.GetWin(),
			title="Scope Plot",
			sample_rate=samp_rate,
			v_scale=0,
			v_offset=0,
			t_scale=0,
			ac_couple=False,
			xy_mode=False,
			num_inputs=2,
			trig_mode=gr.gr_TRIG_MODE_AUTO,
			y_axis_label="Counts",
		)
		self.Add(self.wxgui_scopesink2_0.win)
		self.gr_vector_to_stream_1 = gr.vector_to_stream(gr.sizeof_gr_complex*1, fft_size)
		self.gr_vector_to_stream_0_2 = gr.vector_to_stream(gr.sizeof_gr_complex*1, fft_size)
		self.gr_vector_to_stream_0_1 = gr.vector_to_stream(gr.sizeof_gr_complex*1, fft_size)
		self.gr_vector_to_stream_0_0 = gr.vector_to_stream(gr.sizeof_gr_complex*1, fft_size)
		self.gr_vector_to_stream_0 = gr.vector_to_stream(gr.sizeof_float*1, fft_size)
		self.gr_vector_source_x_0_0_0 = gr.vector_source_c((gen_pss_fd(N_id_2, fft_size, False).get_data()), True, fft_size)
		self.gr_vector_source_x_0_0 = gr.vector_source_c((gen_pss_fd(N_id_2, fft_size, False).get_data()), True, fft_size)
		self.gr_vector_source_x_0 = gr.vector_source_c((gen_sss_fd( N_id_1, N_id_2, fft_size).get_sss(True)), True, fft_size)
		self.gr_stream_to_vector_0_0 = gr.stream_to_vector(gr.sizeof_gr_complex*1, fft_size)
		self.gr_stream_to_vector_0 = gr.stream_to_vector(gr.sizeof_gr_complex*1, fft_size)
		self.gr_repeat_0 = gr.repeat(gr.sizeof_float*1, fft_size)
		self.gr_null_sink_0_0 = gr.null_sink(gr.sizeof_gr_complex*1)
		self.gr_null_sink_0 = gr.null_sink(gr.sizeof_gr_complex*1)
		self.gr_noise_source_x_0 = gr.noise_source_c(gr.GR_GAUSSIAN, noise_level, 0)
		self.gr_multiply_xx_1 = gr.multiply_vcc(1)
		self.gr_multiply_xx_0 = gr.multiply_vcc(fft_size)
		self.gr_multiply_const_vxx_1 = gr.multiply_const_vcc((1/1500., ))
		self.gr_multiply_const_vxx_0 = gr.multiply_const_vcc((exp(rot*2*numpy.pi*1j), ))
		self.gr_interleave_0 = gr.interleave(gr.sizeof_gr_complex*fft_size)
		self.gr_integrate_xx_0 = gr.integrate_ff(fft_size)
		self.gr_float_to_complex_0_0 = gr.float_to_complex(1)
		self.gr_float_to_complex_0 = gr.float_to_complex(1)
		self.gr_file_source_0 = gr.file_source(gr.sizeof_gr_complex*1, "/home/user/git/gr-lte/gr-lte/test/foo_pss0_sss_in.cfile", True)
		self.gr_fft_vxx_1 = gr.fft_vcc(fft_size, False, (window.blackmanharris(1024)), True, 1)
		self.gr_fft_vxx_0 = gr.fft_vcc(fft_size, True, (window.blackmanharris(1024)), True, 1)
		self.gr_divide_xx_0_1 = gr.divide_cc(1)
		self.gr_divide_xx_0_0 = gr.divide_ff(1)
		self.gr_divide_xx_0 = gr.divide_cc(1)
		self.gr_deinterleave_0 = gr.deinterleave(gr.sizeof_gr_complex*fft_size)
		self.gr_conjugate_cc_1 = gr.conjugate_cc()
		self.gr_conjugate_cc_0 = gr.conjugate_cc()
		self.gr_complex_to_mag_squared_0_0 = gr.complex_to_mag_squared(1)
		self.gr_complex_to_mag_squared_0 = gr.complex_to_mag_squared(fft_size)
		self.gr_add_xx_0 = gr.add_vcc(1)
		self.gr_add_const_vxx_0 = gr.add_const_vff((1, ))
		self.const_source_x_0_0 = gr.sig_source_f(0, gr.GR_CONST_WAVE, 0, 0, 0)
		self.const_source_x_0 = gr.sig_source_f(0, gr.GR_CONST_WAVE, 0, 0, 0)

		##################################################
		# Connections
		##################################################
		self.connect((self.gr_file_source_0, 0), (self.gr_stream_to_vector_0, 0))
		self.connect((self.gr_conjugate_cc_0, 0), (self.gr_stream_to_vector_0_0, 0))
		self.connect((self.gr_stream_to_vector_0_0, 0), (self.gr_multiply_xx_0, 1))
		self.connect((self.gr_deinterleave_0, 0), (self.gr_multiply_xx_0, 0))
		self.connect((self.gr_multiply_xx_0, 0), (self.gr_complex_to_mag_squared_0, 0))
		self.connect((self.gr_complex_to_mag_squared_0, 0), (self.gr_vector_to_stream_0, 0))
		self.connect((self.gr_vector_to_stream_0, 0), (self.gr_integrate_xx_0, 0))
		self.connect((self.gr_integrate_xx_0, 0), (self.gr_repeat_0, 0))
		self.connect((self.gr_multiply_xx_0, 0), (self.gr_vector_to_stream_0_0, 0))
		self.connect((self.gr_vector_to_stream_0_1, 0), (self.gr_multiply_xx_1, 1))
		self.connect((self.gr_divide_xx_0, 0), (self.gr_multiply_xx_1, 0))
		self.connect((self.gr_float_to_complex_0, 0), (self.gr_divide_xx_0, 1))
		self.connect((self.gr_conjugate_cc_1, 0), (self.gr_divide_xx_0, 0))
		self.connect((self.gr_deinterleave_0, 1), (self.gr_vector_to_stream_0_1, 0))
		self.connect((self.gr_repeat_0, 0), (self.gr_float_to_complex_0, 0))
		self.connect((self.const_source_x_0, 0), (self.gr_float_to_complex_0, 1))
		self.connect((self.gr_vector_to_stream_0_0, 0), (self.gr_conjugate_cc_1, 0))
		self.connect((self.gr_vector_to_stream_0_0, 0), (self.gr_complex_to_mag_squared_0_0, 0))
		self.connect((self.gr_complex_to_mag_squared_0_0, 0), (self.gr_divide_xx_0_0, 0))
		self.connect((self.gr_repeat_0, 0), (self.gr_divide_xx_0_0, 1))
		self.connect((self.gr_divide_xx_0_0, 0), (self.gr_add_const_vxx_0, 0))
		self.connect((self.gr_add_const_vxx_0, 0), (self.gr_float_to_complex_0_0, 0))
		self.connect((self.const_source_x_0_0, 0), (self.gr_float_to_complex_0_0, 1))
		self.connect((self.gr_float_to_complex_0_0, 0), (self.gr_divide_xx_0_1, 1))
		self.connect((self.gr_multiply_xx_1, 0), (self.gr_divide_xx_0_1, 0))
		self.connect((self.gr_stream_to_vector_0, 0), (self.gr_fft_vxx_0, 0))
		self.connect((self.gr_fft_vxx_0, 0), (self.gr_deinterleave_0, 0))
		self.connect((self.gr_vector_to_stream_0_2, 0), (self.gr_conjugate_cc_0, 0))
		self.connect((self.gr_divide_xx_0_1, 0), (self.gr_null_sink_0, 0))
		self.connect((self.gr_vector_source_x_0, 0), (self.gr_interleave_0, 1))
		self.connect((self.gr_interleave_0, 0), (self.gr_fft_vxx_1, 0))
		self.connect((self.gr_fft_vxx_1, 0), (self.gr_vector_to_stream_1, 0))
		self.connect((self.gr_vector_source_x_0_0, 0), (self.gr_interleave_0, 0))
		self.connect((self.gr_vector_source_x_0_0_0, 0), (self.gr_vector_to_stream_0_2, 0))
		self.connect((self.gr_noise_source_x_0, 0), (self.gr_add_xx_0, 1))
		self.connect((self.gr_vector_to_stream_1, 0), (self.gr_add_xx_0, 0))
		self.connect((self.gr_add_xx_0, 0), (self.gr_multiply_const_vxx_0, 0))
		self.connect((self.gr_vector_to_stream_0_1, 0), (self.gr_multiply_const_vxx_1, 0))
		self.connect((self.gr_multiply_const_vxx_0, 0), (self.gr_null_sink_0_0, 0))
		self.connect((self.gr_multiply_const_vxx_1, 0), (self.wxgui_scopesink2_0, 1))
		self.connect((self.gr_divide_xx_0_1, 0), (self.wxgui_scopesink2_0, 0))
Example #20
0
    def __init__(self, parent, ID, title):
        wxFrame.__init__(self, parent, ID, title,
                wxDefaultPosition)

        self.pga = 0
        self.pgaMin = -20
        self.pgaMax = 0
        self.pgaStep = 0.25

# Parsing options
        parser = OptionParser(option_class=eng_option,
                usage="usage: %prog [options] filename1" \
                " [-f frequency2 filename2 [...]]")
        parser.add_option("-a", "--agc", action="store_true",
                help="enable agc")
        parser.add_option("-c", "--clockrate", type="eng_float", default=128e6,
                help="set USRP clock rate (128e6)")
        parser.add_option("--copy", action="store_true",
                help="enable real to imag data copy when in real mode")
        parser.add_option("-e", "--encoding", type="choice", choices=["s", "f"],
                default="f", help="choose data encoding: [s]igned or [f]loat.")
        parser.add_option("-f", "--frequency", type="eng_float",
                action="callback", callback=appendFrequency,
                help="set output frequency (222.064e6)")
        parser.add_option("-g", "--gain", type="float",
                help="set output pga gain")
        parser.add_option("-l", "--list", action="callback", callback=listUsrp,
                help="list USRPs and daugtherboards")
        parser.add_option("-m", "--mode", type="eng_float", default=2,
                help="mode: 1: real, 2: complex (2)")
        parser.add_option("-o", "--osc", action="store_true",
                help="enable oscilloscope")
        parser.add_option("-r", "--samplingrate", type="eng_float",
                default=3.2e6,
                help="set input sampling rate (3200000)")
        parser.add_option("-s", "--spectrum", action="store_true",
                help="enable spectrum analyzer")
#        parser.add_option("-t", "--tx", type="choice", choices=["A", "B"],
#                default="A", help="choose USRP tx A|B output (A)")
        parser.add_option("-u", "--usrp", action="store_true",
                help="enable USRP output")

        (options, args) = parser.parse_args()
        if len(args) == 0 :
            options.filename = [ "/dev/stdin" ]
        else :
            options.filename = args
# Setting default frequency
        if options.frequency is None :
            options.frequency = [ 222.064e6 ]
        if len(options.filename) != len(options.frequency) :
            parser.error("Nb input file != nb frequency!")

# Status bar
#        self.CreateStatusBar(3, 0)
#        msg = "PGA: %.2f dB" % (self.pga * self.pgaStep)
#        self.SetStatusText(msg, 1)
#        msg = "Freq: %.3f mHz" % (options.frequency[0] / 1000000.0)
#        self.SetStatusText(msg, 2)

# Menu bar
        menu = wxMenu()
        menu.Append(ID_ABOUT, "&About",
                "More information about this program")
        menu.AppendSeparator()
        menu.Append(ID_EXIT, "E&xit", "Terminate the program")
        menuBar = wxMenuBar()
        menuBar.Append(menu, "&File")
        self.SetMenuBar(menuBar)
        

# Main windows
        mainSizer = wxFlexGridSizer(0, 1)
        sliderSizer = wxFlexGridSizer(0, 2)
        buttonSizer = wxBoxSizer(wxHORIZONTAL)

        if options.usrp :
            # TX d'board 0
            gainLabel = wxStaticText(self, -1, "PGA 0")
            gainSlider = wxSlider(self, ID_GAIN_SLIDER0, self.pga,
                    self.pgaMin / self.pgaStep, self.pgaMax / self.pgaStep,
                    style = wxSL_HORIZONTAL | wxSL_AUTOTICKS)
            gainSlider.SetSize((400, -1))
            sliderSizer.Add(gainLabel, 0,
                    wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 0)
            sliderSizer.Add(gainSlider, 0,
                    wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 0)

            freqLabel = wxStaticText(self, -1, "Frequency 0")
            freqSlider = wxSlider(self, ID_FREQ_SLIDER0,
                    options.frequency[0] / 16000, 0, 20e3,
                    style = wxSL_HORIZONTAL | wxSL_AUTOTICKS)
            freqSlider.SetSize((400, -1))
            sliderSizer.Add(freqLabel, 0,
                    wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 0)
            sliderSizer.Add(freqSlider, 0,
                    wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 0)

            if len(options.frequency) > 1 :
                # TX d'board 1
                gainLabel = wxStaticText(self, -1, "PGA 1")
                gainSlider = wxSlider(self, ID_GAIN_SLIDER1, self.pga,
                        self.pgaMin / self.pgaStep, self.pgaMax / self.pgaStep,
                        style = wxSL_HORIZONTAL | wxSL_AUTOTICKS)
                gainSlider.SetSize((400, -1))
                sliderSizer.Add(gainLabel, 0,
                        wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 0)
                sliderSizer.Add(gainSlider, 0,
                        wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 0)

                freqLabel = wxStaticText(self, -1, "Frequency 1")
                freqSlider = wxSlider(self, ID_FREQ_SLIDER1,
                        options.frequency[1] / 16000, 0, 20e3,
                        style = wxSL_HORIZONTAL | wxSL_AUTOTICKS)
                freqSlider.SetSize((400, -1))
                sliderSizer.Add(freqLabel, 0,
                        wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 0)
                sliderSizer.Add(freqSlider, 0,
                        wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 0)

            mainSizer.Add(sliderSizer, 1, wxEXPAND, 0)

        start = wxButton(self, ID_START, "Start")
        stop = wxButton(self, ID_STOP, "Stop")
        buttonSizer.Add(start, 1, wxALIGN_CENTER, 0)
        buttonSizer.Add(stop, 1, wxALIGN_CENTER, 0)
        mainSizer.Add(buttonSizer, 1, wxEXPAND, 0)
    
# GnuRadio
        self.fg = gr.flow_graph()
        if options.mode == 1 :
            print "Source: real"
            if (options.encoding == "s") :
                print "Source encoding: short"
                src = gr.file_source(gr.sizeof_short, options.filename[0], 1)
                if (options.copy) :
                    print "Imag: copy"
                    imag = src
                else :
                    print "Imag: null"
                    imag = gr.null_source(gr.sizeof_short)
                interleaver = gr.interleave(gr.sizeof_short)
                self.fg.connect(src, (interleaver, 0))
                self.fg.connect(imag, (interleaver, 1))
                tail = interleaver
            elif (options.encoding == "f") :
                print "Source encoding: float"
                src = gr.file_source(gr.sizeof_gr_complex,
                    options.filename[0], 1)
                tail = src
        elif (options.mode == 2) :
            print "Source: complex"
            if len(options.frequency) == 1 :
                if (options.encoding == "s") :
                    print "Source encoding: short"
                    src = gr.file_source(gr.sizeof_short,
                            options.filename[0], 1)
                elif (options.encoding == "f") :
                    print "Source encoding: float"
                    src = gr.file_source(gr.sizeof_gr_complex,
                            options.filename[0], 1)
                else :
                    parser.error("Invalid encoding type for complex data!")
                tail = src
                    
            elif (len(options.frequency) == 2) :
                src0 = gr.file_source(gr.sizeof_gr_complex,
                        options.filename[0], 1)
                src1 = gr.file_source(gr.sizeof_gr_complex,
                        options.filename[1], 1)
                interleaver = gr.interleave(gr.sizeof_gr_complex)
                self.fg.connect(src0, (interleaver, 0))
                self.fg.connect(src1, (interleaver, 1))
                tail = interleaver
            else :
                parser.error(
                        "Invalid number of source (> 2) with complex input!")
        else :
            parser.error("Invalid mode!")

# Interpolation
        dac_freq = options.clockrate
        interp = int(dac_freq / options.samplingrate)
        if interp == 0 :
            parser.error("Invalid sampling rate!")
        if options.mode == 2 :
            print "Input sampling rate: %s complex samples/s" % \
                num_to_str(options.samplingrate)
        else :
            print "Input sampling rate: %s samples/s" % \
                num_to_str(options.samplingrate)
        print "Interpolation rate: int(%s / %s) = %sx" % \
            (num_to_str(dac_freq), num_to_str(options.samplingrate), interp)
        if interp > 512 :
            factor = gcd(dac_freq / 512, options.samplingrate)
            num = int((dac_freq / 512) / factor)
            den = int(options.samplingrate / factor)
            print "Resampling by %i / %i" % (num, den)
            resampler = blks.rational_resampler_ccc(self.fg, num, den)
            self.fg.connect(tail, resampler)
            tail = resampler
            interp = 512
            options.samplingrate = dac_freq / 512

# AGC
        if options.agc :
            agc = gr.agc_cc()
            self.fg.connect(tail, agc)
            tail = agc
            
# USRP
        if options.usrp :
            nchan = len(options.frequency)
            if len(options.frequency) == 1 :
                if options.mode == 1 :
                    mux = 0x00000098
                elif options.mode == 2 :
                    mux = 0x00000098
                else :
                    parser.error("Unsupported mode for USRP mux!")
            elif len(options.frequency) == 2 :
                if options.mode == 1 :
                    mux = 0x0000ba98
                elif options.mode == 2 :
                    mux = 0x0000ba98
                else :
                    parser.error("Unsupported mode for USRP mux!")
            else :
                parser.error("Invalid number of frequency [0..2]!")
#            if options.tx == "A" :
#                mux = 0x00000098
#            else :
#                mux = 0x00009800
            print "Nb channels: ", nchan
            print "Mux: 0x%x" % mux
            if options.encoding == 's' :
                dst = usrp.sink_s(0, interp, nchan, mux)
            elif options.encoding == 'f' :
                dst = usrp.sink_c(0, interp, nchan, mux)
            else :
                parser.error("Unsupported data encoding for USRP!")
            
            dst.set_verbose(1)

            for i in range(len(options.frequency)) :
                if options.gain is None :
                    print "Setting gain to %f" % dst.pga_max()
                    dst.set_pga(i << 1, dst.pga_max())
                else :
                    print "Setting gain to %f" % options.gain
                    dst.set_pga(i << 1, options.gain)

                tune = false
                for dboard in dst.db:
                    if (dboard[0].dbid() != -1):
                        device = dboard[0]
                        print "Tuning TX d'board %s to %sHz" % \
                                (device.side_and_name(),
                                num_to_str(options.frequency[i]))
                        device.lo_offset = 38e6
                        (min, max, offset) = device.freq_range()
                        print " Frequency"
                        print "  Min:    %sHz" % num_to_str(min)
                        print "  Max:    %sHz" % num_to_str(max)
                        print "  Offset: %sHz" % num_to_str(offset)
#device.set_gain(device.gain_range()[1])
                        device.set_enable(True)
                        tune = \
                            dst.tune(device._which, device,
                                    options.frequency[i] * 128e6 / dac_freq)
                        if tune:
                            print "  Baseband frequency: %sHz" % \
                                num_to_str(tune.baseband_freq)
                            print "  DXC frequency: %sHz" % \
                                num_to_str(tune.dxc_freq)
                            print "  Residual Freqency: %sHz" % \
                                num_to_str(tune.residual_freq)
                            print "  Inverted: ", \
                                tune.inverted
                            mux = usrp.determine_tx_mux_value(dst,
                                    (device._which, 0))
                            dst.set_mux(mux)
                            break
                        else:
                            print "  Failed!"
                if not tune:
                    print "  Failed!"
                    raise SystemExit

# int nunderruns ()

            print "USRP"
            print " Rx halfband: ", dst.has_rx_halfband()
            print " Tx halfband: ", dst.has_tx_halfband()
            print " Nb DDC: ", dst.nddc()
            print " Nb DUC: ", dst.nduc()
#dst._write_9862(0, 14, 224)
            
            print " DAC frequency: %s samples/s" % num_to_str(dst.dac_freq())
            print " Fpga decimation rate: %s -> %s samples/s" % \
                (num_to_str(dst.interp_rate()),
                 num_to_str(dac_freq / dst.interp_rate()))
            print " Nb channels:",
            if hasattr(dst, "nchannels()") :
                print dst.nchannels()
            else:
                print "N/A"
            print " Mux:",
            if hasattr(dst, "mux()") :
                print "0x%x" % dst.mux()
            else :
                print "N/A"
            print " FPGA master clock frequency:",
            if hasattr(dst, "fpga_master_clock_freq()") :
                print "%sHz" % num_to_str(dst.fpga_master_clock_freq())
            else :
                print "N/A"
            print " Converter rate:",
            if hasattr(dst, "converter_rate()") :
                print "%s" % num_to_str(dst.converter_rate())
            else :
                print "N/A"
            print " DAC rate:",
            if hasattr(dst, "dac_rate()") :
                print "%s sample/s" % num_to_str(dst.dac_rate())
            else :
                print "N/A"
            print " Interp rate: %sx" % num_to_str(dst.interp_rate())
            print " DUC frequency 0: %sHz" % num_to_str(dst.tx_freq(0))
            print " DUC frequency 1: %sHz" % num_to_str(dst.tx_freq(1))
            print " Programmable Gain Amplifier 0: %s dB" % \
                num_to_str(dst.pga(0))
            print " Programmable Gain Amplifier 1: %s dB" % \
                num_to_str(dst.pga(2))

        else :
            dst = gr.null_sink(gr.sizeof_gr_complex)
            
# AGC
        if options.agc :
            agc = gr.agc_cc()
            self.fg.connect(tail, agc)
            tail = agc
            
        self.fg.connect(tail, dst)

# oscilloscope
        if options.osc :
            oscPanel = wxPanel(self, -1)
            if (options.encoding == "s") :
                converter = gr.interleaved_short_to_complex()
                self.fg.connect(tail, converter)
                signal = converter
            elif (options.encoding == "f") :
                signal = tail
            else :
                parser.error("Unsupported data encoding for oscilloscope!")

#block = scope_sink_f(fg, parent, title=label, sample_rate=input_rate)
#return (block, block.win)

            oscWin = scopesink.scope_sink_c(self.fg, oscPanel, "Signal",
                    options.samplingrate)
            self.fg.connect(signal, oscWin)
            mainSizer.Add(oscPanel, 1, wxEXPAND)

# spectrometer
        if options.spectrum :
            ymin = 0
            ymax = 160
            fftPanel = wxPanel(self, -1)
            if (options.encoding == "s") :
                converter = gr.interleaved_short_to_complex()
                self.fg.connect(tail, converter)
                signal = converter
            elif (options.encoding == "f") :
                signal = tail
            else :
                parser.error("Unsupported data encoding for oscilloscope!")

            fftWin = fftsink.fft_sink_c(self.fg, fftPanel,
                    title="Spectrum",
                    fft_size=2048,
                    sample_rate=options.samplingrate,
                    y_per_div=(ymax - ymin) / 8,
                    ref_level=ymax,
                    fft_rate=50,
                    average=True
                    )
            self.fg.connect(signal, fftWin)
            mainSizer.Add(fftPanel, 1, wxEXPAND)

# Events
        EVT_MENU(self, ID_ABOUT, self.OnAbout)
        EVT_MENU(self, ID_EXIT,  self.TimeToQuit)
        EVT_SLIDER(self, ID_GAIN_SLIDER0, self.slideEvent)
        EVT_SLIDER(self, ID_FREQ_SLIDER0, self.slideEvent)
        EVT_SLIDER(self, ID_GAIN_SLIDER1, self.slideEvent)
        EVT_SLIDER(self, ID_FREQ_SLIDER1, self.slideEvent)
        EVT_BUTTON(self, ID_START, self.onClick)
        EVT_BUTTON(self, ID_STOP, self.onClick)

#Layout sizers
        self.SetSizer(mainSizer)
        self.SetAutoLayout(1)
        mainSizer.Fit(self)

        self.fg.start()
Example #21
0
	def __init__(self, N_id_1=134, N_id_2=0, decim=16, frames=1, gain=.08):
		grc_wxgui.top_block_gui.__init__(self, title="LTE DL synchronization signal")
		_icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png"
		self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY))

		##################################################
		# Parameters
		##################################################
		self.N_id_1 = N_id_1
		self.N_id_2 = N_id_2
		self.decim = decim
		self.frames = frames
		self.gain = gain

		##################################################
		# Variables
		##################################################
		self.samp_rate = samp_rate = 30720e3/decim
		self.fft_size = fft_size = 2048/decim
		self.N_re = N_re = 2048/decim

		##################################################
		# Blocks
		##################################################
		self.wxgui_scopesink2_0_2 = scopesink2.scope_sink_c(
			self.GetWin(),
			title="Scope Plot",
			sample_rate=samp_rate,
			v_scale=0,
			v_offset=0,
			t_scale=0,
			ac_couple=False,
			xy_mode=False,
			num_inputs=1,
			trig_mode=gr.gr_TRIG_MODE_AUTO,
			y_axis_label="Counts",
		)
		self.Add(self.wxgui_scopesink2_0_2.win)
		self.wxgui_scopesink2_0 = scopesink2.scope_sink_c(
			self.GetWin(),
			title="Scope Plot",
			sample_rate=samp_rate,
			v_scale=0,
			v_offset=0,
			t_scale=0,
			ac_couple=False,
			xy_mode=False,
			num_inputs=1,
			trig_mode=gr.gr_TRIG_MODE_AUTO,
			y_axis_label="Counts",
		)
		self.Add(self.wxgui_scopesink2_0.win)
		self.gr_vector_to_stream_1_0_0 = gr.vector_to_stream(gr.sizeof_gr_complex*1, fft_size+9)
		self.gr_vector_source_x_0_0_2_0_0 = gr.vector_source_c((gen_pss_td(N_id_2, N_re, 144).get_data()), True, fft_size+9)
		self.gr_vector_source_x_0_0_2_0 = gr.vector_source_c((gen_sss_td(N_id_1, N_id_2, True, N_re).get_data()), True, fft_size+9)
		self.gr_vector_source_x_0_0_0 = gr.vector_source_c((gen_pss_fd(N_id_2, fft_size, False).get_data()), True, fft_size)
		self.gr_vector_source_x_0 = gr.vector_source_c((gen_sss_fd( N_id_1, N_id_2, fft_size).get_sss(True)), True, fft_size)
		self.gr_throttle_0_0 = gr.throttle(gr.sizeof_gr_complex*1, samp_rate)
		self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex*1, samp_rate)
		self.gr_null_sink_1 = gr.null_sink(gr.sizeof_gr_complex*1)
		self.gr_null_sink_0 = gr.null_sink(gr.sizeof_gr_complex*1)
		self.gr_multiply_const_vxx_0_0 = gr.multiply_const_vcc((1, ))
		self.gr_interleave_0_0 = gr.interleave(gr.sizeof_gr_complex*137)
		self.gr_interleave_0 = gr.interleave(gr.sizeof_gr_complex*fft_size)
		self.gr_fft_vxx_1 = gr.fft_vcc(fft_size, False, (window.blackmanharris(1024)), True, 1)
		self.digital_ofdm_cyclic_prefixer_0 = digital.ofdm_cyclic_prefixer(fft_size, fft_size+144/decim)

		##################################################
		# Connections
		##################################################
		self.connect((self.gr_interleave_0, 0), (self.gr_fft_vxx_1, 0))
		self.connect((self.gr_fft_vxx_1, 0), (self.digital_ofdm_cyclic_prefixer_0, 0))
		self.connect((self.gr_vector_source_x_0, 0), (self.gr_interleave_0, 1))
		self.connect((self.gr_vector_source_x_0_0_0, 0), (self.gr_interleave_0, 0))
		self.connect((self.gr_multiply_const_vxx_0_0, 0), (self.gr_null_sink_0, 0))
		self.connect((self.digital_ofdm_cyclic_prefixer_0, 0), (self.gr_null_sink_1, 0))
		self.connect((self.gr_vector_source_x_0_0_2_0, 0), (self.gr_interleave_0_0, 0))
		self.connect((self.gr_vector_source_x_0_0_2_0_0, 0), (self.gr_interleave_0_0, 1))
		self.connect((self.gr_interleave_0_0, 0), (self.gr_vector_to_stream_1_0_0, 0))
		self.connect((self.gr_vector_to_stream_1_0_0, 0), (self.gr_multiply_const_vxx_0_0, 0))
		self.connect((self.digital_ofdm_cyclic_prefixer_0, 0), (self.gr_throttle_0_0, 0))
		self.connect((self.gr_throttle_0_0, 0), (self.wxgui_scopesink2_0, 0))
		self.connect((self.gr_multiply_const_vxx_0_0, 0), (self.gr_throttle_0, 0))
		self.connect((self.gr_throttle_0, 0), (self.wxgui_scopesink2_0_2, 0))
    def __init__(self):
        gr.top_block.__init__(self)

        usage="%prog: [options] tx-freq0 tx-freq1"
        parser = OptionParser (option_class=eng_option, usage=usage)
        parser.add_option("-a", "--args", type="string", default="",
                          help="UHD device address args [default=%default]")
        parser.add_option("", "--spec", type="string", default=None,
	                  help="Subdevice of UHD device where appropriate")
        parser.add_option("-A", "--antenna", type="string", default=None,
                          help="select Rx Antenna where appropriate")
        parser.add_option("-s", "--samp-rate", type="eng_float", default=320e3,
                          help="set sample rate [default=%default]")
        parser.add_option("-g", "--gain", type="eng_float", default=None,
                          help="set gain in dB (default is midpoint)")
        (options, args) = parser.parse_args ()

        if len(args) != 2:
            parser.print_help()
            raise SystemExit
        else:
            freq0 = str_to_num(args[0])
            freq1 = str_to_num(args[1])

        # ----------------------------------------------------------------
        # Set up USRP to transmit on both daughterboards

        d = uhd.find_devices(uhd.device_addr(options.args))
        uhd_type = d[0].get('type')

        stream_args = uhd.stream_args('fc32', channels=range(2))
        self.u = uhd.usrp_sink(device_addr=options.args, stream_args=stream_args)

        # Set up USRP system based on type
        if(uhd_type == "usrp"):
            self.u.set_subdev_spec("A:0 B:0")
            tr0 = uhd.tune_request(freq0)
            tr1 = uhd.tune_request(freq1)

        else:
            if abs(freq0 - freq1) > 5.5e6:
                sys.stderr.write("\nError: When not using two separate d'boards, frequencies must bewithin 5.5MHz of each other.\n")
                raise SystemExit

            self.u.set_subdev_spec("A:0 A:0")

            mid_freq = (freq0 + freq1)/2.0
            tr0 = uhd.tune_request(freq0, rf_freq=mid_freq,
                                   rf_freq_policy=uhd.tune_request.POLICY_MANUAL)

            tr1 = uhd.tune_request(freq1, rf_freq=mid_freq,
                                   rf_freq_policy=uhd.tune_request.POLICY_MANUAL)

        # Use the tune requests to tune each channel
        self.set_freq(tr0, 0)
        self.set_freq(tr1, 1)

        self.usrp_rate  = options.samp_rate

        self.u.set_samp_rate(self.usrp_rate)
        dev_rate = self.u.get_samp_rate()

        # ----------------------------------------------------------------
        # build two signal sources, interleave them, amplify and
        # connect them to usrp

        sig0 = example_signal_0(self.usrp_rate)
        sig1 = example_signal_1(self.usrp_rate)

        intl = gr.interleave(gr.sizeof_gr_complex)
        self.connect(sig0, (intl, 0))
        self.connect(sig1, (intl, 1))

        # Correct for any difference in requested and actual rates
        rrate = self.usrp_rate / dev_rate
        resamp = blks2.pfb_arb_resampler_ccf(rrate)

        # and wire them up
        self.connect(intl, resamp, self.u)

        if options.gain is None:
            # if no gain was specified, use the mid-point in dB
            g = self.u.get_gain_range()
            options.gain = float(g.start()+g.stop())/2.0

        self.set_gain(options.gain, 0)
        self.set_gain(options.gain, 1)

        # Set the subdevice spec
        if(options.spec):
            self.u.set_subdev_spec(options.spec, 0)

        # Set the antenna
        if(options.antenna):
            self.u.set_antenna(options.antenna, 0)
            self.u.set_antenna(options.antenna, 1)
Example #23
0
	def __init__(self,
		sample_rate,
		ber_threshold=0,	# Above which to do search
		ber_smoothing=0,	# Alpha of BER smoother (0.01)
		ber_duration=0,		# Length before trying next combo
		ber_sample_decimation=1,
		settling_period=0,
		pre_lock_duration=0,
		#ber_sample_skip=0
		**kwargs):
		
		use_throttle = False
		base_duration = 1024
		if sample_rate > 0:
			use_throttle = True
			base_duration *= 4	# Has to be high enough for block-delay
		
		if ber_threshold == 0:
			ber_threshold = 512 * 4
		if ber_smoothing == 0:
			ber_smoothing = 0.01
		if ber_duration == 0:
			ber_duration = base_duration * 2 # 1000ms
		if settling_period == 0:
			settling_period = base_duration * 1 # 500ms
		if pre_lock_duration == 0:
			pre_lock_duration = base_duration * 2 #1000ms
		
		print "Creating Auto-FEC:"
		print "\tsample_rate:\t\t", sample_rate
		print "\tber_threshold:\t\t", ber_threshold
		print "\tber_smoothing:\t\t", ber_smoothing
		print "\tber_duration:\t\t", ber_duration
		print "\tber_sample_decimation:\t", ber_sample_decimation
		print "\tsettling_period:\t", settling_period
		print "\tpre_lock_duration:\t", pre_lock_duration
		print ""
		
		self.sample_rate = sample_rate
		self.ber_threshold = ber_threshold
		#self.ber_smoothing = ber_smoothing
		self.ber_duration = ber_duration
		self.settling_period = settling_period
		self.pre_lock_duration = pre_lock_duration
		#self.ber_sample_skip = ber_sample_skip
		
		self.data_lock = threading.Lock()

		gr.hier_block2.__init__(self, "auto_fec",
			gr.io_signature(1, 1, gr.sizeof_gr_complex),			# Post MPSK-receiver complex input
			gr.io_signature3(3, 3, gr.sizeof_char, gr.sizeof_float, gr.sizeof_float))	# Decoded packed bytes, BER metric, lock
		
		self.input_watcher = auto_fec_input_watcher(self)
		default_xform = self.input_watcher.xform_lock
		
		self.gr_conjugate_cc_0 = gr.conjugate_cc()
		self.connect((self, 0), (self.gr_conjugate_cc_0, 0))	# Input
		
		self.blks2_selector_0 = grc_blks2.selector(
			item_size=gr.sizeof_gr_complex*1,
			num_inputs=2,
			num_outputs=1,
			input_index=default_xform.get_conjugation_index(),
			output_index=0,
		)
		self.connect((self.gr_conjugate_cc_0, 0), (self.blks2_selector_0, 0))
		self.connect((self, 0), (self.blks2_selector_0, 1))		# Input
		
		self.gr_multiply_const_vxx_3 = gr.multiply_const_vcc((0.707*(1+1j), ))
		self.connect((self.blks2_selector_0, 0), (self.gr_multiply_const_vxx_3, 0))
		
		self.gr_multiply_const_vxx_2 = gr.multiply_const_vcc((default_xform.get_rotation(), ))	# phase_mult
		self.connect((self.gr_multiply_const_vxx_3, 0), (self.gr_multiply_const_vxx_2, 0))
		
		self.gr_complex_to_float_0_0 = gr.complex_to_float(1)
		self.connect((self.gr_multiply_const_vxx_2, 0), (self.gr_complex_to_float_0_0, 0))
		
		self.gr_interleave_1 = gr.interleave(gr.sizeof_float*1)
		self.connect((self.gr_complex_to_float_0_0, 1), (self.gr_interleave_1, 1))
		self.connect((self.gr_complex_to_float_0_0, 0), (self.gr_interleave_1, 0))
		
		self.gr_multiply_const_vxx_0 = gr.multiply_const_vff((1, ))	# invert
		self.connect((self.gr_interleave_1, 0), (self.gr_multiply_const_vxx_0, 0))
		
		self.baz_delay_2 = baz.delay(gr.sizeof_float*1, default_xform.get_puncture_delay())	# delay_puncture
		self.connect((self.gr_multiply_const_vxx_0, 0), (self.baz_delay_2, 0))
		
		self.depuncture_ff_0 = baz.depuncture_ff((_puncture_matrices[self.input_watcher.puncture_matrix][1]))	# puncture_matrix
		self.connect((self.baz_delay_2, 0), (self.depuncture_ff_0, 0))
		
		self.baz_delay_1 = baz.delay(gr.sizeof_float*1, default_xform.get_viterbi_delay())	# delay_viterbi
		self.connect((self.depuncture_ff_0, 0), (self.baz_delay_1, 0))
		
		self.swap_ff_0 = baz.swap_ff(default_xform.get_viterbi_swap())	# swap_viterbi
		self.connect((self.baz_delay_1, 0), (self.swap_ff_0, 0))
		
		self.gr_decode_ccsds_27_fb_0 = gr.decode_ccsds_27_fb()
		
		if use_throttle:
			print "==> Using throttle at sample rate:", self.sample_rate
			self.gr_throttle_0 = gr.throttle(gr.sizeof_float, self.sample_rate)
			self.connect((self.swap_ff_0, 0), (self.gr_throttle_0, 0))
			self.connect((self.gr_throttle_0, 0), (self.gr_decode_ccsds_27_fb_0, 0))
		else:
			self.connect((self.swap_ff_0, 0), (self.gr_decode_ccsds_27_fb_0, 0))
		
		self.connect((self.gr_decode_ccsds_27_fb_0, 0), (self, 0))	# Output bytes
		
		self.gr_add_const_vxx_1 = gr.add_const_vff((-4096, ))
		self.connect((self.gr_decode_ccsds_27_fb_0, 1), (self.gr_add_const_vxx_1, 0))
		
		self.gr_multiply_const_vxx_1 = gr.multiply_const_vff((-1, ))
		self.connect((self.gr_add_const_vxx_1, 0), (self.gr_multiply_const_vxx_1, 0))
		self.connect((self.gr_multiply_const_vxx_1, 0), (self, 1))	# Output BER
		
		self.gr_single_pole_iir_filter_xx_0 = gr.single_pole_iir_filter_ff(ber_smoothing, 1)
		self.connect((self.gr_multiply_const_vxx_1, 0), (self.gr_single_pole_iir_filter_xx_0, 0))
		
		self.gr_keep_one_in_n_0 = blocks.keep_one_in_n(gr.sizeof_float, ber_sample_decimation)
		self.connect((self.gr_single_pole_iir_filter_xx_0, 0), (self.gr_keep_one_in_n_0, 0))
		
		self.const_source_x_0 = gr.sig_source_f(0, gr.GR_CONST_WAVE, 0, 0, 0)	# Last param is const value
		if use_throttle:
			lock_throttle_rate = self.sample_rate // 16
			print "==> Using lock throttle rate:", lock_throttle_rate
			self.gr_throttle_1 = gr.throttle(gr.sizeof_float, lock_throttle_rate)
			self.connect((self.const_source_x_0, 0), (self.gr_throttle_1, 0))
			self.connect((self.gr_throttle_1, 0), (self, 2))
		else:
			self.connect((self.const_source_x_0, 0), (self, 2))
		
		self.msg_q = gr.msg_queue(2*256)	# message queue that holds at most 2 messages, increase to speed up process
		self.msg_sink = gr.message_sink(gr.sizeof_float, self.msg_q, dont_block=0)	# Block to speed up process
		self.connect((self.gr_keep_one_in_n_0, 0), self.msg_sink)
		
		self.input_watcher.start()
Example #24
0
	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.eq = lte.linear_OFDM_estimator_hier_vcvc(N_rb_dl)
		self.descr = lte.descrambling_vfvf()
		self.demux = lte.pbch_demux_vcvc(N_rb_dl)
		self.daemon = lte.cell_id_daemon(self.eq.eq, self.demux, self.descr)
		self.lte_viterbi_vfvb_0 = lte.viterbi_vfvb()
		self.lte_remove_cp_cvc_1 = lte.remove_cp_cvc(fftlen)
		self.lte_rate_unmatch_vff_0 = lte.rate_unmatch_vff()
		self.lte_qpsk_soft_demod_vcvf_0 = lte.qpsk_soft_demod_vcvf()
		self.lte_pre_decoder_vcvc_0_0 = lte.pre_decoder_vcvc(2, style)
		self.lte_pre_decoder_vcvc_0 = lte.pre_decoder_vcvc(1, style)
		self.lte_mib_unpack_vb_0 = lte.mib_unpack_vb()
		self.lte_layer_demapper_vcvc_0_0 = lte.layer_demapper_vcvc(2, style)
		self.lte_layer_demapper_vcvc_0 = lte.layer_demapper_vcvc(1, style)
		self.lte_hier_sss_sync_cc_0 = lte.hier_sss_sync_cc(self.daemon, 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_crc_calculator_vbvb_0 = lte.crc_calculator_vbvb()
		self.lte_cp_time_freq_sync_cc_0 = lte.cp_time_freq_sync_cc(fftlen)
		self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex*1, samp_rate)
		self.gr_interleave_0 = gr.interleave(gr.sizeof_gr_complex*240)
		self.gr_file_source_0 = gr.file_source(gr.sizeof_gr_complex*1, "/home/demel/Dokumente/Messungen/Messung_LTE_2012-05-23_12:47:32.dat", False)
		self.fft_vxx_0 = fft.fft_vcc(fftlen, True, (window.rectangular(fftlen)), False, 1)
		self.blks2_rational_resampler_xxx_0 = blks2.rational_resampler_ccc(
			interpolation=interp_val,
			decimation=1000,
			taps=None,
			fractional_bw=None,
		)

		##################################################
		# Connections
		##################################################
		self.connect((self.gr_file_source_0, 0), (self.blks2_rational_resampler_xxx_0, 0))
		self.connect((self.blks2_rational_resampler_xxx_0, 0), (self.gr_throttle_0, 0))
		self.connect((self.lte_hier_freq_estimate_cc_0, 0), (self.lte_hier_sss_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_sss_sync_cc_0, 0), (self.lte_remove_cp_cvc_1, 0))
		self.connect((self.fft_vxx_0, 0), (self.lte_extract_occupied_tones_vcvc_0, 0))
		self.connect((self.lte_remove_cp_cvc_1, 0), (self.fft_vxx_0, 0))
		self.connect((self.lte_pre_decoder_vcvc_0, 0), (self.lte_layer_demapper_vcvc_0, 0))
		self.connect((self.lte_pre_decoder_vcvc_0_0, 0), (self.lte_layer_demapper_vcvc_0_0, 0))
		self.connect((self.lte_layer_demapper_vcvc_0_0, 0), (self.gr_interleave_0, 1))
		self.connect((self.demux, 1), (self.lte_pre_decoder_vcvc_0_0, 1))
		self.connect((self.demux, 1), (self.lte_pre_decoder_vcvc_0, 1))
		self.connect((self.demux, 0), (self.lte_pre_decoder_vcvc_0, 0))
		self.connect((self.demux, 2), (self.lte_pre_decoder_vcvc_0_0, 2))
		self.connect((self.demux, 0), (self.lte_pre_decoder_vcvc_0_0, 0))
		self.connect((self.lte_qpsk_soft_demod_vcvf_0, 0), (self.descr, 0))
		self.connect((self.gr_interleave_0, 0), (self.lte_qpsk_soft_demod_vcvf_0, 0))
		self.connect((self.lte_layer_demapper_vcvc_0, 0), (self.gr_interleave_0, 0))
		self.connect((self.descr, 0), (self.lte_rate_unmatch_vff_0, 0))
		self.connect((self.lte_crc_calculator_vbvb_0, 1), (self.lte_mib_unpack_vb_0, 1))
		self.connect((self.lte_crc_calculator_vbvb_0, 0), (self.lte_mib_unpack_vb_0, 0))
		self.connect((self.lte_viterbi_vfvb_0, 0), (self.lte_crc_calculator_vbvb_0, 0))
		self.connect((self.lte_rate_unmatch_vff_0, 0), (self.lte_viterbi_vfvb_0, 0))
		self.connect((self.lte_cp_time_freq_sync_cc_0, 0), (self.lte_hier_pss_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.eq, 0))
		self.connect((self.eq, 0), (self.demux, 0))
		self.connect((self.eq, 1), (self.demux, 1))
		self.connect((self.eq, 2), (self.demux, 2))
Example #25
0
	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_viterbi_vfvb_0 = lte.viterbi_vfvb()
		self.lte_remove_cp_cvc_1 = lte.remove_cp_cvc(fftlen)
		self.lte_rate_unmatch_vff_0 = lte.rate_unmatch_vff()
		self.lte_qpsk_soft_demod_vcvf_0 = lte.qpsk_soft_demod_vcvf()
		self.lte_pre_decoder_vcvc_0_0 = lte.pre_decoder_vcvc(2, style)
		self.lte_pre_decoder_vcvc_0 = lte.pre_decoder_vcvc(1, style)
		self.lte_mib_unpack_vb_0 = lte.mib_unpack_vb()
		self.lte_layer_demapper_vcvc_0_0 = lte.layer_demapper_vcvc(2, style)
		self.lte_layer_demapper_vcvc_0 = lte.layer_demapper_vcvc(1, style)
		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_crc_calculator_vbvb_0 = lte.crc_calculator_vbvb()
		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/4)
		self.gr_interleave_0 = gr.interleave(gr.sizeof_gr_complex*240)
		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)
		self.descr = lte.descrambling_vfvf()
		self.demux = lte.pbch_demux_vcvc(N_rb_dl)

		##################################################
		# Connections
		##################################################
		self.connect((self.lte_cp_time_freq_sync_cc_0, 0), (self.lte_hier_pss_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.gr_throttle_0, 0), (self.lte_cp_time_freq_sync_cc_0, 0))
		self.connect((self.gr_file_source_0_0, 0), (self.gr_throttle_0, 0))
		self.connect((self.fft_vxx_0, 0), (self.lte_extract_occupied_tones_vcvc_0, 0))
		self.connect((self.lte_remove_cp_cvc_1, 0), (self.fft_vxx_0, 0))
		self.connect((self.descr, 0), (self.lte_rate_unmatch_vff_0, 0))
		self.connect((self.lte_qpsk_soft_demod_vcvf_0, 0), (self.descr, 0))
		self.connect((self.demux, 2), (self.lte_pre_decoder_vcvc_0_0, 2))
		self.connect((self.demux, 1), (self.lte_pre_decoder_vcvc_0_0, 1))
		self.connect((self.demux, 0), (self.lte_pre_decoder_vcvc_0_0, 0))
		self.connect((self.demux, 1), (self.lte_pre_decoder_vcvc_0, 1))
		self.connect((self.demux, 0), (self.lte_pre_decoder_vcvc_0, 0))
		self.connect((self.lte_channel_estimator_0, 2), (self.demux, 2))
		self.connect((self.lte_channel_estimator_0, 1), (self.demux, 1))
		self.connect((self.lte_channel_estimator_0, 0), (self.demux, 0))
		self.connect((self.lte_extract_occupied_tones_vcvc_0, 0), (self.lte_channel_estimator_0, 0))
		self.connect((self.lte_rate_unmatch_vff_0, 0), (self.lte_viterbi_vfvb_0, 0))
		self.connect((self.lte_viterbi_vfvb_0, 0), (self.lte_crc_calculator_vbvb_0, 0))
		self.connect((self.lte_crc_calculator_vbvb_0, 0), (self.lte_mib_unpack_vb_0, 0))
		self.connect((self.lte_crc_calculator_vbvb_0, 1), (self.lte_mib_unpack_vb_0, 1))
		self.connect((self.lte_layer_demapper_vcvc_0, 0), (self.gr_interleave_0, 0))
		self.connect((self.gr_interleave_0, 0), (self.lte_qpsk_soft_demod_vcvf_0, 0))
		self.connect((self.lte_layer_demapper_vcvc_0_0, 0), (self.gr_interleave_0, 1))
		self.connect((self.lte_pre_decoder_vcvc_0_0, 0), (self.lte_layer_demapper_vcvc_0_0, 0))
		self.connect((self.lte_pre_decoder_vcvc_0, 0), (self.lte_layer_demapper_vcvc_0, 0))
		self.connect((self.lte_hier_freq_estimate_cc_0, 0), (self.lte_hier_sss_sync_cc_1, 0))
		self.connect((self.lte_hier_sss_sync_cc_1, 0), (self.lte_remove_cp_cvc_1, 0))

		##################################################
		# Asynch Message Connections
		##################################################
		self.msg_connect(self.lte_hier_sss_sync_cc_1, "cell_id", self.demux, "cell_id")
		self.msg_connect(self.lte_hier_sss_sync_cc_1, "cell_id", self.descr, "cell_id")
		self.msg_connect(self.lte_hier_sss_sync_cc_1, "cell_id", self.lte_channel_estimator_0, "cell_id")
Example #26
0
	def __init__(self, freq_corr=0, avg_frames=1, N_id_2=0, N_id_1=134, decim=16):
		grc_wxgui.top_block_gui.__init__(self, title="Sss Corr3 Gui")
		_icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png"
		self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY))

		##################################################
		# Parameters
		##################################################
		self.freq_corr = freq_corr
		self.avg_frames = avg_frames
		self.N_id_2 = N_id_2
		self.N_id_1 = N_id_1
		self.decim = decim

		##################################################
		# Variables
		##################################################
		self.vec_half_frame = vec_half_frame = 30720*5/decim
		self.symbol_start = symbol_start = 144/decim
		self.samp_rate = samp_rate = 30720e3/decim
		self.rot = rot = 0
		self.noise_level = noise_level = 0
		self.fft_size = fft_size = 2048/decim
		self.N_re = N_re = 62

		##################################################
		# Blocks
		##################################################
		_symbol_start_sizer = wx.BoxSizer(wx.VERTICAL)
		self._symbol_start_text_box = forms.text_box(
			parent=self.GetWin(),
			sizer=_symbol_start_sizer,
			value=self.symbol_start,
			callback=self.set_symbol_start,
			label='symbol_start',
			converter=forms.int_converter(),
			proportion=0,
		)
		self._symbol_start_slider = forms.slider(
			parent=self.GetWin(),
			sizer=_symbol_start_sizer,
			value=self.symbol_start,
			callback=self.set_symbol_start,
			minimum=0,
			maximum=144/decim,
			num_steps=144/decim,
			style=wx.SL_HORIZONTAL,
			cast=int,
			proportion=1,
		)
		self.Add(_symbol_start_sizer)
		_rot_sizer = wx.BoxSizer(wx.VERTICAL)
		self._rot_text_box = forms.text_box(
			parent=self.GetWin(),
			sizer=_rot_sizer,
			value=self.rot,
			callback=self.set_rot,
			label='rot',
			converter=forms.float_converter(),
			proportion=0,
		)
		self._rot_slider = forms.slider(
			parent=self.GetWin(),
			sizer=_rot_sizer,
			value=self.rot,
			callback=self.set_rot,
			minimum=0,
			maximum=1,
			num_steps=100,
			style=wx.SL_HORIZONTAL,
			cast=float,
			proportion=1,
		)
		self.Add(_rot_sizer)
		_noise_level_sizer = wx.BoxSizer(wx.VERTICAL)
		self._noise_level_text_box = forms.text_box(
			parent=self.GetWin(),
			sizer=_noise_level_sizer,
			value=self.noise_level,
			callback=self.set_noise_level,
			label='noise_level',
			converter=forms.float_converter(),
			proportion=0,
		)
		self._noise_level_slider = forms.slider(
			parent=self.GetWin(),
			sizer=_noise_level_sizer,
			value=self.noise_level,
			callback=self.set_noise_level,
			minimum=0,
			maximum=10,
			num_steps=100,
			style=wx.SL_HORIZONTAL,
			cast=float,
			proportion=1,
		)
		self.Add(_noise_level_sizer)
		self.wxgui_scopesink2_0_1 = scopesink2.scope_sink_f(
			self.GetWin(),
			title="Scope Plot",
			sample_rate=samp_rate,
			v_scale=0,
			v_offset=0,
			t_scale=0,
			ac_couple=False,
			xy_mode=False,
			num_inputs=1,
			trig_mode=gr.gr_TRIG_MODE_AUTO,
			y_axis_label="Counts",
		)
		self.Add(self.wxgui_scopesink2_0_1.win)
		self.sss_equ_0 = sss_equ(
			N_id_2=0,
		)
		self.sss_corr3_gui_0 = sss_corr3_gui(
			decim=decim,
			N_id_1=N_id_1,
			N_id_2=N_id_2,
			avg_frames=avg_frames,
			slot_0_10=1,
		)
		self.gr_vector_to_stream_1 = gr.vector_to_stream(gr.sizeof_gr_complex*1, fft_size)
		self.gr_vector_to_stream_0 = gr.vector_to_stream(gr.sizeof_gr_complex*1, fft_size)
		self.gr_vector_source_x_0_1 = gr.vector_source_c((gen_sss_fd( N_id_1, N_id_2, fft_size).get_sss(False)), True, fft_size)
		self.gr_vector_source_x_0_0_1 = gr.vector_source_c((gen_pss_fd(N_id_2, fft_size, False).get_data()), True, fft_size)
		self.gr_vector_source_x_0_0 = gr.vector_source_c((gen_pss_fd(N_id_2, fft_size, False).get_data()), True, fft_size)
		self.gr_vector_source_x_0 = gr.vector_source_c((gen_sss_fd( N_id_1, N_id_2, fft_size).get_sss(True)), True, fft_size)
		self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex*1, samp_rate)
		self.gr_stream_to_vector_0_0 = gr.stream_to_vector(gr.sizeof_gr_complex*1, N_re)
		self.gr_stream_to_vector_0 = gr.stream_to_vector(gr.sizeof_gr_complex*1, fft_size)
		self.gr_noise_source_x_0 = gr.noise_source_c(gr.GR_GAUSSIAN, noise_level, 0)
		self.gr_multiply_const_vxx_0 = gr.multiply_const_vcc((0.005*exp(rot*2*numpy.pi*1j), ))
		self.gr_keep_m_in_n_1 = gr.keep_m_in_n(gr.sizeof_gr_complex, fft_size, fft_size+144/decim, symbol_start)
		self.gr_keep_m_in_n_0 = gr.keep_m_in_n(gr.sizeof_gr_complex, N_re, fft_size, (fft_size-N_re)/2)
		self.gr_interleave_0 = gr.interleave(gr.sizeof_gr_complex*fft_size)
		self.gr_file_source_0 = gr.file_source(gr.sizeof_gr_complex*1, "/home/user/git/gr-lte/gr-lte/test/foo_pss0_sss_in.cfile", True)
		self.gr_fft_vxx_1 = gr.fft_vcc(fft_size, False, (window.blackmanharris(1024)), True, 1)
		self.gr_fft_vxx_0 = gr.fft_vcc(fft_size, True, (window.blackmanharris(1024)), True, 1)
		self.gr_deinterleave_0 = gr.deinterleave(gr.sizeof_gr_complex*N_re)
		self.gr_channel_model_0 = gr.channel_model(
			noise_voltage=0.005*noise_level,
			frequency_offset=0.0,
			epsilon=1,
			taps=(0.005*exp(rot*2*numpy.pi*1j), ),
			noise_seed=0,
		)
		self.gr_add_xx_0 = gr.add_vcc(1)
		self.digital_ofdm_cyclic_prefixer_0 = digital.ofdm_cyclic_prefixer(fft_size, fft_size+144/decim)
		self.blks2_selector_0_0 = grc_blks2.selector(
			item_size=gr.sizeof_gr_complex*1,
			num_inputs=2,
			num_outputs=1,
			input_index=1,
			output_index=0,
		)
		self.blks2_selector_0 = grc_blks2.selector(
			item_size=gr.sizeof_gr_complex*1,
			num_inputs=3,
			num_outputs=2,
			input_index=0,
			output_index=1,
		)

		##################################################
		# Connections
		##################################################
		self.connect((self.gr_stream_to_vector_0, 0), (self.gr_fft_vxx_0, 0))
		self.connect((self.gr_stream_to_vector_0_0, 0), (self.gr_deinterleave_0, 0))
		self.connect((self.gr_keep_m_in_n_0, 0), (self.gr_stream_to_vector_0_0, 0))
		self.connect((self.gr_vector_to_stream_0, 0), (self.gr_keep_m_in_n_0, 0))
		self.connect((self.gr_fft_vxx_0, 0), (self.gr_vector_to_stream_0, 0))
		self.connect((self.gr_noise_source_x_0, 0), (self.gr_add_xx_0, 1))
		self.connect((self.gr_add_xx_0, 0), (self.gr_multiply_const_vxx_0, 0))
		self.connect((self.gr_throttle_0, 0), (self.gr_stream_to_vector_0, 0))
		self.connect((self.blks2_selector_0, 0), (self.gr_channel_model_0, 0))
		self.connect((self.blks2_selector_0, 1), (self.gr_add_xx_0, 0))
		self.connect((self.gr_channel_model_0, 0), (self.blks2_selector_0_0, 0))
		self.connect((self.gr_multiply_const_vxx_0, 0), (self.blks2_selector_0_0, 1))
		self.connect((self.gr_keep_m_in_n_1, 0), (self.blks2_selector_0, 2))
		self.connect((self.gr_vector_to_stream_1, 0), (self.blks2_selector_0, 1))
		self.connect((self.gr_fft_vxx_1, 0), (self.digital_ofdm_cyclic_prefixer_0, 0))
		self.connect((self.digital_ofdm_cyclic_prefixer_0, 0), (self.gr_keep_m_in_n_1, 0))
		self.connect((self.gr_file_source_0, 0), (self.blks2_selector_0, 0))
		self.connect((self.gr_fft_vxx_1, 0), (self.gr_vector_to_stream_1, 0))
		self.connect((self.gr_interleave_0, 0), (self.gr_fft_vxx_1, 0))
		self.connect((self.blks2_selector_0_0, 0), (self.gr_throttle_0, 0))
		self.connect((self.gr_vector_source_x_0_0, 0), (self.gr_interleave_0, 1))
		self.connect((self.gr_vector_source_x_0_0_1, 0), (self.gr_interleave_0, 3))
		self.connect((self.gr_vector_source_x_0, 0), (self.gr_interleave_0, 0))
		self.connect((self.gr_vector_source_x_0_1, 0), (self.gr_interleave_0, 2))
		self.connect((self.gr_deinterleave_0, 0), (self.sss_equ_0, 1))
		self.connect((self.gr_deinterleave_0, 1), (self.sss_equ_0, 0))
		self.connect((self.sss_corr3_gui_0, 0), (self.wxgui_scopesink2_0_1, 0))
		self.connect((self.sss_equ_0, 0), (self.sss_corr3_gui_0, 0))