コード例 #1
0
    def __init__(self, samplerate, bits_per_sec, fftlen):
        gr.hier_block2.__init__(
            self,
            "gmsk_sync",
            gr.io_signature(1, 1, gr.sizeof_gr_complex),  # Input signature
            gr.io_signature(1, 1, gr.sizeof_gr_complex))  # Output signature

        #this is just the old square-and-fft method
        #ais.freqest is simply looking for peaks spaced bits-per-sec apart
        self.square = gr.multiply_cc(1)
        self.fftvect = gr.stream_to_vector(gr.sizeof_gr_complex, fftlen)
        self.fft = gr.fft_vcc(fftlen, True, window.rectangular(fftlen), True)
        self.freqest = ais.freqest(int(samplerate), int(bits_per_sec), fftlen)
        self.repeat = gr.repeat(gr.sizeof_float, fftlen)
        self.fm = gr.frequency_modulator_fc(-1.0 / (float(samplerate) /
                                                    (2 * pi)))
        self.mix = gr.multiply_cc(1)

        self.connect(self, (self.square, 0))
        self.connect(self, (self.square, 1))
        #this is the feedforward branch
        self.connect(self, (self.mix, 0))
        #this is the feedback branch
        self.connect(self.square, self.fftvect, self.fft, self.freqest,
                     self.repeat, self.fm, (self.mix, 1))
        #and this is the output
        self.connect(self.mix, self)
コード例 #2
0
ファイル: viterbi_vfvb.py プロジェクト: armuk/gr-lte
    def __init__(self, ):
#    """
#    docstring
#	"""
        gr.hier_block2.__init__(self, "viterbi_vfvb",
                gr.io_signature(1,1, gr.sizeof_float*120), # sizeof (<+float+>)),  # Input signature
				gr.io_signature(1,1, gr.sizeof_char*40 )) #sizeof (<+float+>))) # Output signature

        #print "\nlte_viterbi_vfvb START"
        
        #tpp=gr.tag_propagation_policy()
        #################################
        # Define blocks
        # Repeat input vector one time to get viterbi decoder state right (tail-biting stuff)
        self.rpt  = gr.repeat(gr.sizeof_float*120,2)
        # viterbi decoder requires stream as input
        self.vtos = gr.vector_to_stream(1*gr.sizeof_float,120)
        
	
        # Correct FSM instantiation: k=num_input_bits, n=num_output_bits, Tuple[dim(k*n)] (decimal notation)
        self.fsm  = trellis.fsm(1,3,[91,121,117])

        # Values for viterbi decoder        
        K = 80  # steps for one coding block
        SO = 0  # initial state
        SK = -1 # final state (in this case unknown, therefore -1)
        D = 3   # dimensionality
        # D = 3 follows from the fact that 1 {0,1} input symbol of the encoder produces 3 {0,1} output symbols.
        # (packed into one byte {0,1,...,7} )
        # with NRZ coding follows: 
        # 0 -->  1
        # 1 --> -1
        # This leads to the following constellation input
        #               |  0  |  1   | 2    | 3     |  4   |  5    |  6    |  7     |
        constellation = [1,1,1,1,1,-1,1,-1,1,1,-1,-1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1]
        # print "len(constellation)/D = " + str(len(constellation)/D) + "\tfsm.O = " + str(self.fsm.O())
	    
	    # Viterbi_combined input: FSM, K, SO, SK, D, TABLE, TYPE
	    # FSM    = Finite State Machine
	    # K      = number of output symbols produced by the FSM
	    # SO     = initial state of the FSM
	    # SK     = final state of the FSM (unknown in this example)
	    # D      = dimensionality
	    # TABLE  = constellation of the input symbols
        self.vit  = trellis.viterbi_combined_fb(self.fsm,K,SO,SK,D,constellation,200)	

        # stream output of viterbi decoder to vector
        self.stov2 = gr.stream_to_vector(1*gr.sizeof_char,80)
        # second half of the viterbi output carries desired information. (tail-biting stuff)
        my_map=range(40)
        for i in my_map:
            my_map[i]=i+40
        self.map = lte.vector_resize_vbvb(my_map,80,40)

        self.connect(self,self.rpt,self.vtos,self.vit,self.stov2,self.map,self)
コード例 #3
0
ファイル: qa_repeat.py プロジェクト: monikaomsharma/sandhi
    def test_001_float(self):
	src_data = [n*1.0 for n in range(100)];
	dst_data = []
	for n in range(100):
	    dst_data += [1.0*n, 1.0*n, 1.0*n]

	src = gr.vector_source_f(src_data)
	rpt = gr.repeat(gr.sizeof_float, 3)
	dst = gr.vector_sink_f()
	self.tb.connect(src, rpt, dst)
	self.tb.run()
	self.assertFloatTuplesAlmostEqual(dst_data, dst.data(), 6)
コード例 #4
0
    def test_001_octet(self):
        src_data = [n*1 for n in range(100)];
        dst_data = []
        for n in range(100):
            dst_data += [n, n, n]

        src = gr.vector_source_b(src_data)
        rpt = gr.repeat(gr.sizeof_char, 3)
        dst = gr.vector_sink_b()
        self.tb.connect(src, rpt, dst)
        self.tb.run()
        self.assertEqual(tuple(dst_data), dst.data())
コード例 #5
0
    def test_001_complex(self):
        src_data = [n*1.0 for n in range(100)];
        dst_data = []
        for n in range(100):
            dst_data += [1.0*n, 1.0*n, 1.0*n]

        src = gr.vector_source_c(src_data)
        rpt = gr.repeat(gr.sizeof_gr_complex, 3)
        dst = gr.vector_sink_c()
        self.tb.connect(src, rpt, dst)
        self.tb.run()
        self.assertComplexTuplesAlmostEqual(dst_data, dst.data(), 6)
コード例 #6
0
ファイル: qa_repeat.py プロジェクト: jinjoh/SDR
    def test_001_float(self):
        src_data = [n * 1.0 for n in range(100)]
        dst_data = []
        for n in range(100):
            dst_data += [1.0 * n, 1.0 * n, 1.0 * n]

        src = gr.vector_source_f(src_data)
        rpt = gr.repeat(gr.sizeof_float, 3)
        dst = gr.vector_sink_f()
        self.tb.connect(src, rpt, dst)
        self.tb.run()
        self.assertFloatTuplesAlmostEqual(dst_data, dst.data(), 6)
コード例 #7
0
    def __init__(self):
        gr.top_block.__init__(self)
        
        self.src = gr.message_source(gr.sizeof_char, msgq_limit)
        src = self.src
        
        b_to_syms = gr.bytes_to_syms()
        
        self.mult = gr.multiply_const_ff(MULTIPLIER)
    
        add = gr.add_const_ff(CENTER_FREQ)
                    
        repeater = gr.repeat(gr.sizeof_float,REPEAT_TIME)
    
        fsk_f = gr.vco_f(AUDIO_RATE, 2*pi,0.5)

	speaker = audio.sink(AUDIO_RATE, "plughw:0,0");
	
        self.connect(src,b_to_syms,self.mult,add,repeater,fsk_f,speaker)
コード例 #8
0
ファイル: gmsk_sync.py プロジェクト: chgans/gr-ais
    def __init__(self, samplerate, bits_per_sec, fftlen):
		gr.hier_block2.__init__(self, "gmsk_sync",
                                gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
                                gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature

		#this is just the old square-and-fft method
		#ais.freqest is simply looking for peaks spaced bits-per-sec apart
		self.square = gr.multiply_cc(1)
		self.fftvect = gr.stream_to_vector(gr.sizeof_gr_complex, fftlen)
		self.fft = gr.fft_vcc(fftlen, True, window.rectangular(fftlen), True)
		self.freqest = ais.freqest(int(samplerate), int(bits_per_sec), fftlen)
		self.repeat = gr.repeat(gr.sizeof_float, fftlen)
		self.fm = gr.frequency_modulator_fc(-1.0/(float(samplerate)/(2*pi)))
		self.mix = gr.multiply_cc(1)

		self.connect(self, (self.square, 0))
		self.connect(self, (self.square, 1))
		#this is the feedforward branch
		self.connect(self, (self.mix, 0))
		#this is the feedback branch
		self.connect(self.square, self.fftvect, self.fft, self.freqest, self.repeat, self.fm, (self.mix, 1))
		#and this is the output
		self.connect(self.mix, self)
コード例 #9
0
    def __init__(self):
        gr.top_block.__init__(self)
        audio_rate =48000 # audio rate changed
	
        self.src = gr.message_source(gr.sizeof_char, msgq_limit)
    
        src = self.src
        
        b_to_syms = gr.bytes_to_syms()
        
        mult = gr.multiply_const_ff(1000)
	
    
        add = gr.add_const_ff(CentreFreq)
                    
        repeater = gr.repeat(gr.sizeof_float,RepeatTime)
    
        fsk_f = gr.vco_f(audio_rate, 2*pi,0.5)   # Sensitivity is rad/sec/volt ( e.g 2*pi*f/sec = 1Khz) and here f = volts (input amplitude of VCO)
    	attenuator = gr.multiply_const_ff(0.05)   # multiply
        speaker = audio.sink(audio_rate, "plughw:0,0");
        dst = gr.wavfile_sink("tx-signal.wav",1, audio_rate, 16)
        
        self.connect(src,b_to_syms,mult,add,repeater,fsk_f,attenuator,speaker)
        self.connect(fsk_f,dst)
コード例 #10
0
    def __init__(self, ):
#    """
#    docstring
#	"""
        gr.hier_block2.__init__(self, "viterbi_vfvb",
                gr.io_signature(1,1, gr.sizeof_float*120), # sizeof (<+float+>)),  # Input signature
				gr.io_signature(1,1, gr.sizeof_char*40 )) #sizeof (<+float+>))) # Output signature

        #print "\nlte_viterbi_vfvb START"
        
        #tpp=gr.tag_propagation_policy()
        #################################
        # Define blocks
        # Repeat input vector one time to get viterbi decoder state right (tail-biting stuff)
        self.rpt  = gr.repeat(gr.sizeof_float*120,2)
        # viterbi decoder requires stream as input
        self.vtos = gr.vector_to_stream(1*gr.sizeof_float,120)
        
	
        # Correct FSM instantiation: k=num_input_bits, n=num_output_bits, Tuple[dim(k*n)] (decimal notation)
        self.fsm  = trellis.fsm(1,3,[91,121,117])
        # print "\nFSM attributes"
        # print "FSM.I()       = " + str(self.fsm.I())  # input states
        # print "FSM.S()       = " + str(self.fsm.S())  # FSM states
        # print "FSM.O()       = " + str(self.fsm.O())  # output states
        # print "FSM.NS()      = " + str(self.fsm.NS()) # next states of the FSM itself
        # print "FSM.OS()      = " + str(self.fsm.OS()) # output states
        # print "FSM.PS()  = " + str(self.fsm.PS()) # previous states (not available in this example?)
        # print "FSM.PI()  = " + str(self.fsm.PI()) # previous input states (not available in this example?)
        # print "FSM.TMi() = " + str(self.fsm.TMi())
        # print "FSM.TMI() = " + str(self.fsm.TMl())


        # Values for viterbi decoder        
        K = 40  # steps for one coding block
        SO = 0  # initial state
        SK = -1 # final state (in this case unknown, therefore -1)
        D = 3   # dimensionality
        # D = 3 follows from the fact that 1 {0,1} input symbol of the encoder produces 3 {0,1} output symbols.
        # (packed into one byte {0,1,...,7} )
        # with NRZ coding follows: 
        # 0 -->  1
        # 1 --> -1
        # This leads to the following constellation input
        #               |  0  |  1   | 2    | 3     |  4   |  5    |  6    |  7     |
        constellation = [1,1,1,1,1,-1,1,-1,1,1,-1,-1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1]
        # print "len(constellation)/D = " + str(len(constellation)/D) + "\tfsm.O = " + str(self.fsm.O())
	    
	    # Viterbi_combined input: FSM, K, SO, SK, D, TABLE, TYPE
	    # FSM    = Finite State Machine
	    # K      = number of output symbols produced by the FSM
	    # SO     = initial state of the FSM
	    # SK     = final state of the FSM (unknown in this example)
	    # D      = dimensionality
	    # TABLE  = constellation of the input symbols
        self.vit  = trellis.viterbi_combined_fb(self.fsm,K,SO,SK,D,constellation,200)	
        # print "\nViterbi_combined_fb attributes"
        # print "K     = " + str(self.vit.K())
        # print "SO    = " + str(self.vit.SO()) # initial state
        # print "SK    = " + str(self.vit.SK()) # final state
        # print "D     = " + str(self.vit.D())
        # print "TYPE  = " + str(self.vit.TYPE())
        # for i in range(len(self.vit.TABLE())/D):
        #     print "TABLE =\t" + str(self.vit.TABLE()[i*D]) + "\t" + str(self.vit.TABLE()[i*D+1]) + "\t" + str(self.vit.TABLE()[i*D+2])

        # stream output of viterbi decoder to vector
        self.stov2 = gr.stream_to_vector(1*gr.sizeof_char,80)
        # second half of the viterbi output carries desired information. (tail-biting stuff)
        my_map=range(40)
        for i in my_map:
            my_map[i]=i+40
        self.map = lte.vector_resize_vbvb(my_map,80,40)

        self.connect(self,self.rpt,self.vtos,self.vit,self.stov2,self.map,self)
コード例 #11
0
ファイル: sss_corr2_gui.py プロジェクト: a4a881d4/gr-lte-1
	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))
コード例 #12
0
ファイル: sss_corr2_gui.py プロジェクト: gmg2719/gr-lte-1
    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))