def test_001_t(self): self.degree = 5 self.length = 2**self.degree - 1 expected_result = (self.length - 1) * [-1.0 / self.length] + [1] # send a maximum length sequence with period 31 src_real = digital.glfsr_source_f(self.degree, True, 0, 1) src_imag = gr.null_source(gr.sizeof_float * 1) f2c = gr.float_to_complex(1) mls_correlator = channelsounder_swig.mls_correlator(self.degree, mask=0, seed=1) # keep only the samples of the first two autocorrelation periods head = gr.head(gr.sizeof_gr_complex, 2 * self.length) dest = gr.vector_sink_c(1) self.tb.connect(src_real, (f2c, 0)) self.tb.connect(src_imag, (f2c, 1)) self.tb.connect(f2c, mls_correlator) self.tb.connect(mls_correlator, head, dest) # set up fg self.tb.run() # check data result_data = dest.data() # discard the first period, since it is tainted by the zeros inserted # by set_history() result_data = result_data[self.length:] self.assertFloatTuplesAlmostEqual(expected_result, result_data, 6)
def test_001_t (self): self.degree = 5 self.length = 2**self.degree - 1 expected_result = (self.length - 1)*[-1.0/self.length]+[1] # send a maximum length sequence with period 31 src_real = digital.glfsr_source_f(self.degree, True, 0, 1) src_imag = blocks.null_source(gr.sizeof_float*1) f2c = blocks.float_to_complex(1) mls_correlator = channelsounder_swig.mls_correlator(self.degree, mask = 0, seed = 1) # keep only the samples of the first two autocorrelation periods head = blocks.head(gr.sizeof_gr_complex, 2*self.length) dest = blocks.vector_sink_c(1) self.tb.connect( src_real, (f2c, 0)) self.tb.connect( src_imag, (f2c, 1)) self.tb.connect( f2c, mls_correlator ) self.tb.connect( mls_correlator, head, dest ) # set up fg self.tb.run () # check data result_data = dest.data() # discard the first period, since it is tainted by the zeros inserted # by set_history() result_data = result_data[self.length:] self.assertFloatTuplesAlmostEqual (expected_result, result_data, 6)
def __init__(self, alpha=0.5, center_freq=3560e6, degree=8, gain=31.5, samp_rate=24e6): gr.top_block.__init__(self, "Spread Spectrum Tx") ################################################## # Parameters ################################################## self.alpha = alpha self.center_freq = center_freq self.degree = degree self.gain = gain self.samp_rate = samp_rate ################################################## # Blocks ################################################## self.uhd_usrp_sink_0 = uhd.usrp_sink( ",".join(("", "")), uhd.stream_args( cpu_format="fc32", args='', channels=list(range(0, 1)), ), '', ) self.uhd_usrp_sink_0.set_clock_source('external', 0) self.uhd_usrp_sink_0.set_center_freq(center_freq, 0) self.uhd_usrp_sink_0.set_gain(gain, 0) self.uhd_usrp_sink_0.set_antenna('TX/RX', 0) self.uhd_usrp_sink_0.set_samp_rate(samp_rate) self.uhd_usrp_sink_0.set_time_unknown_pps(uhd.time_spec()) self.root_raised_cosine_filter_0 = filter.interp_fir_filter_fff( 1, firdes.root_raised_cosine(1, samp_rate, samp_rate, 0.5, 64)) self.digital_glfsr_source_x_0 = digital.glfsr_source_f( degree, True, 0, 1) self.blocks_null_source_0 = blocks.null_source(gr.sizeof_float * 1) self.blocks_multiply_const_vxx_0 = blocks.multiply_const_cc(10) self.blocks_float_to_complex_0 = blocks.float_to_complex(1) ################################################## # Connections ################################################## self.connect((self.blocks_float_to_complex_0, 0), (self.blocks_multiply_const_vxx_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.uhd_usrp_sink_0, 0)) self.connect((self.blocks_null_source_0, 0), (self.blocks_float_to_complex_0, 1)) self.connect((self.digital_glfsr_source_x_0, 0), (self.root_raised_cosine_filter_0, 0)) self.connect((self.root_raised_cosine_filter_0, 0), (self.blocks_float_to_complex_0, 0))
def test_001_correlate(self): degree = 10 length = 2**degree-1 src = digital.glfsr_source_f(degree) head = blocks.head(gr.sizeof_float, length*length) f2c = blocks.float_to_complex() corr = digital.pn_correlator_cc(degree) dst = blocks.vector_sink_c() self.tb.connect(src, head, f2c, corr, dst) self.tb.run() data = dst.data() self.assertEqual(data[-1], (1.0+0j))
def test_005_correlation_f(self): for degree in range(1,11): # Higher degrees take too long to correlate src = digital.glfsr_source_f(degree, False) dst = blocks.vector_sink_f() del self.tb # Discard existing top block self.tb = gr.top_block() self.tb.connect(src, dst) self.tb.run() actual_result = dst.data() R = auto_correlate(actual_result) self.assertEqual(R[0], float(len(R))) # Auto-correlation peak at origin for i in range(len(R)-1): self.assertEqual(R[i+1], -1.0) # Auto-correlation minimum everywhere else
def test_004_degree_f(self): self.assertRaises(RuntimeError, lambda: digital.glfsr_source_f(0)) self.assertRaises(RuntimeError, lambda: digital.glfsr_source_f(33))
def test_003_make_f(self): src = digital.glfsr_source_f(16) self.assertEqual(src.mask(), 0x8016) self.assertEqual(src.period(), 2**16-1)
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") ################################################## # Variables ################################################## self.spreading_offon = spreading_offon = 0 self.samp_rate = samp_rate = 5000 self.pn_len = pn_len = 32 self.interpolation = interpolation = 4 ################################################## # Blocks ################################################## self._spreading_offon_chooser = forms.radio_buttons( parent=self.GetWin(), value=self.spreading_offon, callback=self.set_spreading_offon, label='Spreading Off/On', choices=[0, 1], labels=[], style=wx.RA_HORIZONTAL, ) self.Add(self._spreading_offon_chooser) self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=0, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=samp_rate * pn_len * interpolation, fft_size=1024, fft_rate=15, average=True, avg_alpha=None, title='FFT Plot', peak_hold=False, ) self.Add(self.wxgui_fftsink2_0.win) self.rational_resampler_base_xxx_0 = filter.rational_resampler_base_fff( pn_len, 1, ([ 1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, -1, -1, 1, -1, 0 ])) self.digital_glfsr_source_x_0 = digital.glfsr_source_f(15, True, 0, 1) self.blocks_throttle_0 = blocks.throttle( gr.sizeof_gr_complex * 1, samp_rate * pn_len * interpolation, True) self.blocks_repeat_1 = blocks.repeat(gr.sizeof_gr_complex * 1, 4) self.blocks_repeat_0 = blocks.repeat(gr.sizeof_float * 1, 31) self.blocks_float_to_complex_1 = blocks.float_to_complex(1) self.blks2_selector_0 = grc_blks2.selector( item_size=gr.sizeof_float * 1, num_inputs=2, num_outputs=1, input_index=spreading_offon, output_index=0, ) ################################################## # Connections ################################################## self.connect((self.blks2_selector_0, 0), (self.blocks_float_to_complex_1, 0)) self.connect((self.blocks_float_to_complex_1, 0), (self.blocks_repeat_1, 0)) self.connect((self.blocks_repeat_0, 0), (self.blks2_selector_0, 0)) self.connect((self.blocks_repeat_1, 0), (self.blocks_throttle_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.wxgui_fftsink2_0, 0)) self.connect((self.digital_glfsr_source_x_0, 0), (self.blocks_repeat_0, 0)) self.connect((self.digital_glfsr_source_x_0, 0), (self.rational_resampler_base_xxx_0, 0)) self.connect((self.rational_resampler_base_xxx_0, 0), (self.blks2_selector_0, 1))
def __init__(self): gr.top_block.__init__(self, "Tags Lab3") Qt.QWidget.__init__(self) self.setWindowTitle("Tags Lab3") try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass 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) self.settings = Qt.QSettings("GNU Radio", "tags_lab3") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.sequence = sequence = [ 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1 ] self.length_tag_name = length_tag_name = "packet_len" self.src_tag = src_tag = gr.tag_utils.python_to_tag( (0, pmt.intern(length_tag_name), pmt.from_long(len(sequence)), pmt.intern("src"))) self.samp_rate = samp_rate = 200 ################################################## # Blocks ################################################## self.qtgui_time_sink_x_0 = qtgui.time_sink_f( 1024, #size samp_rate, #samp_rate "Pulse", #name 1 #number of inputs ) self.qtgui_time_sink_x_0.set_update_time(0.10) self.qtgui_time_sink_x_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") self.qtgui_time_sink_x_0.enable_tags(-1, True) self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0.enable_autoscale(False) self.qtgui_time_sink_x_0.enable_grid(False) self.qtgui_time_sink_x_0.enable_axis_labels(True) self.qtgui_time_sink_x_0.enable_control_panel(False) if not True: self.qtgui_time_sink_x_0.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue" ] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_time_sink_x_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_win = sip.wrapinstance( self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_time_sink_x_0_win) self.digital_glfsr_source_x_0 = digital.glfsr_source_f(31, True, 0, 1) self.blocks_vector_source_x_0 = blocks.vector_source_f( sequence, True, 1, [src_tag]) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_float * 1, samp_rate, True) self.blocks_tagged_stream_to_pdu_0 = blocks.tagged_stream_to_pdu( blocks.float_t, length_tag_name) self.blocks_tagged_stream_mux_0 = blocks.tagged_stream_mux( gr.sizeof_float * 1, length_tag_name, 0) self.blocks_stream_to_tagged_stream_0 = blocks.stream_to_tagged_stream( gr.sizeof_float, 1, 80, length_tag_name) ################################################## # Connections ################################################## self.connect((self.blocks_stream_to_tagged_stream_0, 0), (self.blocks_tagged_stream_mux_0, 1)) self.connect((self.blocks_tagged_stream_mux_0, 0), (self.blocks_tagged_stream_to_pdu_0, 0)) self.connect((self.blocks_tagged_stream_mux_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.qtgui_time_sink_x_0, 0)) self.connect((self.blocks_vector_source_x_0, 0), (self.blocks_tagged_stream_mux_0, 0)) self.connect((self.digital_glfsr_source_x_0, 0), (self.blocks_stream_to_tagged_stream_0, 0))
def __init__(self): gr.top_block.__init__(self, "Example: Simple Transmit and Receive") Qt.QWidget.__init__(self) self.setWindowTitle("Example: Simple Transmit and Receive") qtgui.util.check_set_qss() try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass 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) self.settings = Qt.QSettings("GNU Radio", "pluto_simple_tx_rx") try: if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): self.restoreGeometry(self.settings.value("geometry").toByteArray()) else: self.restoreGeometry(self.settings.value("geometry")) except: pass ################################################## # Variables ################################################## self.samp_rate = samp_rate = int(2.2e6) self.freq = freq = int(2e9) ################################################## # Blocks ################################################## self.qtgui_time_sink_x_2 = qtgui.time_sink_c( 100, #size samp_rate, #samp_rate "", #name 1 #number of inputs ) self.qtgui_time_sink_x_2.set_update_time(0.10) self.qtgui_time_sink_x_2.set_y_axis(-1, 1) self.qtgui_time_sink_x_2.set_y_label('Amplitude', "") self.qtgui_time_sink_x_2.enable_tags(True) self.qtgui_time_sink_x_2.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_2.enable_autoscale(False) self.qtgui_time_sink_x_2.enable_grid(False) self.qtgui_time_sink_x_2.enable_axis_labels(True) self.qtgui_time_sink_x_2.enable_control_panel(False) self.qtgui_time_sink_x_2.enable_stem_plot(False) labels = ['Signal 1', 'Signal 2', 'Signal 3', 'Signal 4', 'Signal 5', 'Signal 6', 'Signal 7', 'Signal 8', 'Signal 9', 'Signal 10'] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ['blue', 'red', 'green', 'black', 'cyan', 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] for i in range(2): if len(labels[i]) == 0: if (i % 2 == 0): self.qtgui_time_sink_x_2.set_line_label(i, "Re{{Data {0}}}".format(i/2)) else: self.qtgui_time_sink_x_2.set_line_label(i, "Im{{Data {0}}}".format(i/2)) else: self.qtgui_time_sink_x_2.set_line_label(i, labels[i]) self.qtgui_time_sink_x_2.set_line_width(i, widths[i]) self.qtgui_time_sink_x_2.set_line_color(i, colors[i]) self.qtgui_time_sink_x_2.set_line_style(i, styles[i]) self.qtgui_time_sink_x_2.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_2.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_2_win = sip.wrapinstance(self.qtgui_time_sink_x_2.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_time_sink_x_2_win, 1, 1, 1, 1) for r in range(1, 2): self.top_grid_layout.setRowStretch(r, 1) for c in range(1, 2): self.top_grid_layout.setColumnStretch(c, 1) self.qtgui_time_sink_x_1 = qtgui.time_sink_f( 100, #size samp_rate, #samp_rate "", #name 1 #number of inputs ) self.qtgui_time_sink_x_1.set_update_time(0.10) self.qtgui_time_sink_x_1.set_y_axis(-1, 1) self.qtgui_time_sink_x_1.set_y_label('Amplitude', "") self.qtgui_time_sink_x_1.enable_tags(True) self.qtgui_time_sink_x_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_1.enable_autoscale(False) self.qtgui_time_sink_x_1.enable_grid(False) self.qtgui_time_sink_x_1.enable_axis_labels(True) self.qtgui_time_sink_x_1.enable_control_panel(False) self.qtgui_time_sink_x_1.enable_stem_plot(False) labels = ['Signal 1', 'Signal 2', 'Signal 3', 'Signal 4', 'Signal 5', 'Signal 6', 'Signal 7', 'Signal 8', 'Signal 9', 'Signal 10'] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ['blue', 'red', 'green', 'black', 'cyan', 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] for i in range(1): if len(labels[i]) == 0: self.qtgui_time_sink_x_1.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_1.set_line_label(i, labels[i]) self.qtgui_time_sink_x_1.set_line_width(i, widths[i]) self.qtgui_time_sink_x_1.set_line_color(i, colors[i]) self.qtgui_time_sink_x_1.set_line_style(i, styles[i]) self.qtgui_time_sink_x_1.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_1.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_1_win = sip.wrapinstance(self.qtgui_time_sink_x_1.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_time_sink_x_1_win, 1, 0, 1, 1) for r in range(1, 2): self.top_grid_layout.setRowStretch(r, 1) for c in range(0, 1): self.top_grid_layout.setColumnStretch(c, 1) self.qtgui_time_sink_x_0_0 = qtgui.time_sink_c( 80, #size samp_rate, #samp_rate 'Tx Signal, Time Domain', #name 1 #number of inputs ) self.qtgui_time_sink_x_0_0.set_update_time(0.1) self.qtgui_time_sink_x_0_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0_0.set_y_label('Amplitude', "") self.qtgui_time_sink_x_0_0.enable_tags(True) self.qtgui_time_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0_0.enable_autoscale(False) self.qtgui_time_sink_x_0_0.enable_grid(True) self.qtgui_time_sink_x_0_0.enable_axis_labels(True) self.qtgui_time_sink_x_0_0.enable_control_panel(False) self.qtgui_time_sink_x_0_0.enable_stem_plot(False) labels = ['Signal 1', 'Signal 2', 'Signal 3', 'Signal 4', 'Signal 5', 'Signal 6', 'Signal 7', 'Signal 8', 'Signal 9', 'Signal 10'] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ['blue', 'red', 'green', 'black', 'cyan', 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] for i in range(2): if len(labels[i]) == 0: if (i % 2 == 0): self.qtgui_time_sink_x_0_0.set_line_label(i, "Re{{Data {0}}}".format(i/2)) else: self.qtgui_time_sink_x_0_0.set_line_label(i, "Im{{Data {0}}}".format(i/2)) else: self.qtgui_time_sink_x_0_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_0_win, 0, 0, 1, 1) for r in range(0, 1): self.top_grid_layout.setRowStretch(r, 1) for c in range(0, 1): self.top_grid_layout.setColumnStretch(c, 1) self.qtgui_time_sink_x_0 = qtgui.time_sink_c( 100, #size samp_rate, #samp_rate 'Rx Signal, Time Domain', #name 1 #number of inputs ) self.qtgui_time_sink_x_0.set_update_time(0.1) self.qtgui_time_sink_x_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") self.qtgui_time_sink_x_0.enable_tags(True) self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0.enable_autoscale(False) self.qtgui_time_sink_x_0.enable_grid(True) self.qtgui_time_sink_x_0.enable_axis_labels(True) self.qtgui_time_sink_x_0.enable_control_panel(False) self.qtgui_time_sink_x_0.enable_stem_plot(False) labels = ['Signal 1', 'Signal 2', 'Signal 3', 'Signal 4', 'Signal 5', 'Signal 6', 'Signal 7', 'Signal 8', 'Signal 9', 'Signal 10'] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ['blue', 'red', 'green', 'black', 'cyan', 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] for i in range(2): if len(labels[i]) == 0: if (i % 2 == 0): self.qtgui_time_sink_x_0.set_line_label(i, "Re{{Data {0}}}".format(i/2)) else: self.qtgui_time_sink_x_0.set_line_label(i, "Im{{Data {0}}}".format(i/2)) else: self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_win, 0, 1, 1, 1) for r in range(0, 1): self.top_grid_layout.setRowStretch(r, 1) for c in range(1, 2): self.top_grid_layout.setColumnStretch(c, 1) self.iio_pluto_source_0 = iio.pluto_source('ip:192.168.2.1', 1200000000, samp_rate, 20000000, 32768, True, True, True, 'fast_attack', 90, '', True) self.iio_pluto_sink_0 = iio.pluto_sink('ip:192.168.2.1', 1200000000, samp_rate, 2000000, 32768, False, 20.0, '', True) self.digital_pn_correlator_cc_1 = digital.pn_correlator_cc(5, 0, 1) self.digital_glfsr_source_x_0 = digital.glfsr_source_f(5, True, 0, 1) self.blocks_float_to_complex_0 = blocks.float_to_complex(1) self.analog_const_source_x_0 = analog.sig_source_f(0, analog.GR_CONST_WAVE, 0, 0, 0) ################################################## # Connections ################################################## self.connect((self.analog_const_source_x_0, 0), (self.blocks_float_to_complex_0, 1)) self.connect((self.blocks_float_to_complex_0, 0), (self.iio_pluto_sink_0, 0)) self.connect((self.blocks_float_to_complex_0, 0), (self.qtgui_time_sink_x_0_0, 0)) self.connect((self.digital_glfsr_source_x_0, 0), (self.blocks_float_to_complex_0, 0)) self.connect((self.digital_glfsr_source_x_0, 0), (self.qtgui_time_sink_x_1, 0)) self.connect((self.digital_pn_correlator_cc_1, 0), (self.qtgui_time_sink_x_2, 0)) self.connect((self.iio_pluto_source_0, 0), (self.digital_pn_correlator_cc_1, 0)) self.connect((self.iio_pluto_source_0, 0), (self.qtgui_time_sink_x_0, 0))
def __init__(self): gr.top_block.__init__(self, "Power spectral density and average power") Qt.QWidget.__init__(self) self.setWindowTitle("Power spectral density and average power") try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass 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) self.settings = Qt.QSettings( "GNU Radio", "power_spectral_density_and_average_power") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.sr = sr = 32000 self.samp_rate = samp_rate = 512000 self.interpolation = interpolation = 16 self.glfsrSourceDegree = glfsrSourceDegree = 22 ################################################## # Blocks ################################################## self.qtgui_time_sink_x_0 = qtgui.time_sink_f( 1024, #size samp_rate, #samp_rate "", #name 1 #number of inputs ) self.qtgui_time_sink_x_0.set_update_time(0.10) self.qtgui_time_sink_x_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") self.qtgui_time_sink_x_0.enable_tags(-1, True) self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0.enable_autoscale(False) self.qtgui_time_sink_x_0.enable_grid(False) self.qtgui_time_sink_x_0.enable_axis_labels(True) self.qtgui_time_sink_x_0.enable_control_panel(False) if not True: self.qtgui_time_sink_x_0.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue" ] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_time_sink_x_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_win = sip.wrapinstance( self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_win, 0, 0, 1, 1) self.qtgui_number_sink_0 = qtgui.number_sink(gr.sizeof_float, 0, qtgui.NUM_GRAPH_VERT, 1) self.qtgui_number_sink_0.set_update_time(0.10) self.qtgui_number_sink_0.set_title("Average Power") labels = ['', '', '', '', '', '', '', '', '', ''] units = ['', '', '', '', '', '', '', '', '', ''] colors = [("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black")] factor = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] for i in xrange(1): self.qtgui_number_sink_0.set_min(i, -1) self.qtgui_number_sink_0.set_max(i, 1) self.qtgui_number_sink_0.set_color(i, colors[i][0], colors[i][1]) if len(labels[i]) == 0: self.qtgui_number_sink_0.set_label(i, "Data {0}".format(i)) else: self.qtgui_number_sink_0.set_label(i, labels[i]) self.qtgui_number_sink_0.set_unit(i, units[i]) self.qtgui_number_sink_0.set_factor(i, factor[i]) self.qtgui_number_sink_0.enable_autoscale(True) self._qtgui_number_sink_0_win = sip.wrapinstance( self.qtgui_number_sink_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_number_sink_0_win, 0, 1, 2, 1) self.qtgui_freq_sink_x_0 = qtgui.freq_sink_f( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc samp_rate, #bw "", #name 1 #number of inputs ) self.qtgui_freq_sink_x_0.set_update_time(0.10) self.qtgui_freq_sink_x_0.set_y_axis(-140, 10) self.qtgui_freq_sink_x_0.set_y_label('Power', 'dB') self.qtgui_freq_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") self.qtgui_freq_sink_x_0.enable_autoscale(False) self.qtgui_freq_sink_x_0.enable_grid(False) self.qtgui_freq_sink_x_0.set_fft_average(1.0) self.qtgui_freq_sink_x_0.enable_axis_labels(True) self.qtgui_freq_sink_x_0.enable_control_panel(False) if not True: self.qtgui_freq_sink_x_0.disable_legend() if "float" == "float" or "float" == "msg_float": self.qtgui_freq_sink_x_0.set_plot_pos_half(not True) labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "dark blue" ] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_freq_sink_x_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_0.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_0.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_0.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_0_win = sip.wrapinstance( self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_freq_sink_x_0_win, 1, 0, 1, 1) self.low_pass_filter_1 = filter.fir_filter_fff( 1, firdes.low_pass(1, samp_rate, 10, 10, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_0 = filter.fir_filter_fff( 1, firdes.low_pass(1, samp_rate, 64000, 3200, firdes.WIN_HAMMING, 6.76)) self.interp_fir_filter_xxx_0 = filter.interp_fir_filter_fff( interpolation, ((1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0))) self.interp_fir_filter_xxx_0.declare_sample_delay(0) self.digital_glfsr_source_x_0 = digital.glfsr_source_f( glfsrSourceDegree, True, 0, 1) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_float * 1, sr, True) self.blocks_multiply_xx_0 = blocks.multiply_vff(1) ################################################## # Connections ################################################## self.connect((self.blocks_multiply_xx_0, 0), (self.low_pass_filter_1, 0)) self.connect((self.blocks_throttle_0, 0), (self.interp_fir_filter_xxx_0, 0)) self.connect((self.digital_glfsr_source_x_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.interp_fir_filter_xxx_0, 0), (self.low_pass_filter_0, 0)) self.connect((self.low_pass_filter_0, 0), (self.blocks_multiply_xx_0, 0)) self.connect((self.low_pass_filter_0, 0), (self.blocks_multiply_xx_0, 1)) self.connect((self.low_pass_filter_0, 0), (self.qtgui_freq_sink_x_0, 0)) self.connect((self.low_pass_filter_0, 0), (self.qtgui_time_sink_x_0, 0)) self.connect((self.low_pass_filter_1, 0), (self.qtgui_number_sink_0, 0))
def __init__(self): gr.top_block.__init__(self, "Top Block") Qt.QWidget.__init__(self) self.setWindowTitle("Top Block") try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass 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) self.settings = Qt.QSettings("GNU Radio", "top_block") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.sps = sps = 16 self.samp_rate = samp_rate = 512000 self.ptype = ptype = 'rect' self.pparms = pparms = [10, 0] self.fL_div_by_FB = fL_div_by_FB = 0.5 self.FB = FB = 32000 self.A_noise = A_noise = 0.35 ################################################## # Blocks ################################################## self._fL_div_by_FB_range = Range(0, 8, 0.5, 0.5, 200) self._fL_div_by_FB_win = RangeWidget(self._fL_div_by_FB_range, self.set_fL_div_by_FB, "fL_div_by_FB", "counter_slider", float) self.top_layout.addWidget(self._fL_div_by_FB_win) self._A_noise_range = Range(0.01, 5, 0.01, 0.35, 200) self._A_noise_win = RangeWidget(self._A_noise_range, self.set_A_noise, "A_noise", "counter_slider", float) self.top_layout.addWidget(self._A_noise_win) self.qtgui_time_sink_x_0 = qtgui.time_sink_f( 1024, #size samp_rate, #samp_rate "", #name 1 #number of inputs ) self.qtgui_time_sink_x_0.set_update_time(0.10) self.qtgui_time_sink_x_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0.set_y_label("Amplitude", "") self.qtgui_time_sink_x_0.enable_tags(-1, True) self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0.enable_autoscale(True) self.qtgui_time_sink_x_0.enable_grid(True) self.qtgui_time_sink_x_0.enable_control_panel(False) if not True: self.qtgui_time_sink_x_0.disable_legend() labels = ["", "", "", "", "", "", "", "", "", ""] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue" ] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_time_sink_x_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_win = sip.wrapinstance( self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_time_sink_x_0_win) self.qtgui_number_sink_0_0 = qtgui.number_sink(gr.sizeof_float, 0, qtgui.NUM_GRAPH_HORIZ, 1) self.qtgui_number_sink_0_0.set_update_time(0.10) self.qtgui_number_sink_0_0.set_title("Noise Power") labels = ["", "", "", "", "", "", "", "", "", ""] units = ["", "", "", "", "", "", "", "", "", ""] colors = [("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black")] factor = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] for i in xrange(1): self.qtgui_number_sink_0_0.set_min(i, 0) self.qtgui_number_sink_0_0.set_max(i, 2) self.qtgui_number_sink_0_0.set_color(i, colors[i][0], colors[i][1]) if len(labels[i]) == 0: self.qtgui_number_sink_0_0.set_label(i, "Data {0}".format(i)) else: self.qtgui_number_sink_0_0.set_label(i, labels[i]) self.qtgui_number_sink_0_0.set_unit(i, units[i]) self.qtgui_number_sink_0_0.set_factor(i, factor[i]) self.qtgui_number_sink_0_0.enable_autoscale(False) self._qtgui_number_sink_0_0_win = sip.wrapinstance( self.qtgui_number_sink_0_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_number_sink_0_0_win) self.qtgui_number_sink_0 = qtgui.number_sink(gr.sizeof_float, 0, qtgui.NUM_GRAPH_HORIZ, 1) self.qtgui_number_sink_0.set_update_time(0.10) self.qtgui_number_sink_0.set_title("SNR in dB") labels = ["", "", "", "", "", "", "", "", "", ""] units = ["", "", "", "", "", "", "", "", "", ""] colors = [("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black")] factor = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] for i in xrange(1): self.qtgui_number_sink_0.set_min(i, -10) self.qtgui_number_sink_0.set_max(i, 50) self.qtgui_number_sink_0.set_color(i, colors[i][0], colors[i][1]) if len(labels[i]) == 0: self.qtgui_number_sink_0.set_label(i, "Data {0}".format(i)) else: self.qtgui_number_sink_0.set_label(i, labels[i]) self.qtgui_number_sink_0.set_unit(i, units[i]) self.qtgui_number_sink_0.set_factor(i, factor[i]) self.qtgui_number_sink_0.enable_autoscale(False) self._qtgui_number_sink_0_win = sip.wrapinstance( self.qtgui_number_sink_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_number_sink_0_win) self.qtgui_freq_sink_x_0 = qtgui.freq_sink_f( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc samp_rate, #bw "", #name 1 #number of inputs ) self.qtgui_freq_sink_x_0.set_update_time(0.10) self.qtgui_freq_sink_x_0.set_y_axis(-140, 10) self.qtgui_freq_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") self.qtgui_freq_sink_x_0.enable_autoscale(True) self.qtgui_freq_sink_x_0.enable_grid(True) self.qtgui_freq_sink_x_0.set_fft_average(1.0) self.qtgui_freq_sink_x_0.enable_control_panel(False) if not True: self.qtgui_freq_sink_x_0.disable_legend() if "float" == "float" or "float" == "msg_float": self.qtgui_freq_sink_x_0.set_plot_pos_half(not True) labels = ["", "", "", "", "", "", "", "", "", ""] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "dark blue" ] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_freq_sink_x_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_0.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_0.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_0.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_0_win = sip.wrapinstance( self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_freq_sink_x_0_win) self.low_pass_filter_0_1 = filter.fir_filter_fff( 1, firdes.low_pass(1, samp_rate, fL_div_by_FB * FB, 3200, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_0_0_0 = filter.fir_filter_fff( 1, firdes.low_pass(1, samp_rate, 10, 10, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_0_0 = filter.fir_filter_fff( 1, firdes.low_pass(1, samp_rate, 10, 10, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_0 = filter.fir_filter_fff( 1, firdes.low_pass(1, samp_rate, fL_div_by_FB * FB, 3200, firdes.WIN_HAMMING, 6.76)) self.interp_fir_filter_xxx_0 = filter.interp_fir_filter_fff( 16, (pampt(sps, ptype, pparms))) self.interp_fir_filter_xxx_0.declare_sample_delay(0) self.digital_glfsr_source_x_0 = digital.glfsr_source_f(22, True, 0, 1) self.blocks_wavfile_sink_0 = blocks.wavfile_sink( "/home/vishal-srivastav/Documents/Communication_Lab_ECEN_5002/Lab5/power_x002_rec_20_FBby2.wav", 1, samp_rate, 16) self.blocks_throttle_0_0 = blocks.throttle(gr.sizeof_float * 1, FB, True) self.blocks_nlog10_ff_0 = blocks.nlog10_ff(10, 1, 0) self.blocks_multiply_xx_0_0 = blocks.multiply_vff(1) self.blocks_multiply_xx_0 = blocks.multiply_vff(1) self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vff((0.6, )) self.blocks_divide_xx_0 = blocks.divide_ff(1) self.blocks_add_xx_1 = blocks.add_vff(1) self.analog_noise_source_x_0 = analog.noise_source_f( analog.GR_GAUSSIAN, A_noise, 0) ################################################## # Connections ################################################## self.connect((self.analog_noise_source_x_0, 0), (self.low_pass_filter_0_1, 0)) self.connect((self.blocks_add_xx_1, 0), (self.blocks_multiply_const_vxx_0, 0)) self.connect((self.blocks_add_xx_1, 0), (self.qtgui_freq_sink_x_0, 0)) self.connect((self.blocks_add_xx_1, 0), (self.qtgui_time_sink_x_0, 0)) self.connect((self.blocks_divide_xx_0, 0), (self.blocks_nlog10_ff_0, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.blocks_wavfile_sink_0, 0)) self.connect((self.blocks_multiply_xx_0, 0), (self.low_pass_filter_0_0, 0)) self.connect((self.blocks_multiply_xx_0_0, 0), (self.low_pass_filter_0_0_0, 0)) self.connect((self.blocks_nlog10_ff_0, 0), (self.qtgui_number_sink_0, 0)) self.connect((self.blocks_throttle_0_0, 0), (self.interp_fir_filter_xxx_0, 0)) self.connect((self.digital_glfsr_source_x_0, 0), (self.blocks_throttle_0_0, 0)) self.connect((self.interp_fir_filter_xxx_0, 0), (self.low_pass_filter_0, 0)) self.connect((self.low_pass_filter_0, 0), (self.blocks_add_xx_1, 0)) self.connect((self.low_pass_filter_0, 0), (self.blocks_multiply_xx_0, 0)) self.connect((self.low_pass_filter_0, 0), (self.blocks_multiply_xx_0, 1)) self.connect((self.low_pass_filter_0_0, 0), (self.blocks_divide_xx_0, 0)) self.connect((self.low_pass_filter_0_0_0, 0), (self.blocks_divide_xx_0, 1)) self.connect((self.low_pass_filter_0_0_0, 0), (self.qtgui_number_sink_0_0, 0)) self.connect((self.low_pass_filter_0_1, 0), (self.blocks_add_xx_1, 1)) self.connect((self.low_pass_filter_0_1, 0), (self.blocks_multiply_xx_0_0, 0)) self.connect((self.low_pass_filter_0_1, 0), (self.blocks_multiply_xx_0_0, 1))