예제 #1
0
    def test_003_int(self):
        minimum = 2 ** 12 - 2
        maximum = 2 ** 17 + 5
        seed = 3
        n_items = 10000
        rnd_src = analog.random_uniform_source_i(minimum, maximum, seed)
        head = blocks.head(4, n_items)
        snk = blocks.vector_sink_i(1)
        self.tb.connect(rnd_src, head, snk)
        # set up fg
        self.tb.run()
        # check data
        res = snk.data()
        # plt.hist(res)
        # plt.show()

        self.assertGreaterEqual(np.min(res), minimum)
        self.assertLess(np.max(res), maximum)
예제 #2
0
    def __init__(self):
        gr.top_block.__init__(self, "rrc_filtering_comparison_test")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("rrc_filtering_comparison_test")
        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",
                                     "rrc_filtering_comparison_test")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Variables
        ##################################################
        self.symbol_rate = symbol_rate = 4800
        self.orig_bit_delay = orig_bit_delay = 110
        self.channel_rate = channel_rate = 48000
        self.chan_delay = chan_delay = 55

        ##################################################
        # Blocks
        ##################################################
        self._orig_bit_delay_range = Range(0, 300, 1, 110, 200)
        self._orig_bit_delay_win = RangeWidget(self._orig_bit_delay_range,
                                               self.set_orig_bit_delay,
                                               'Original Bit Delay',
                                               "counter_slider", float)
        self.top_layout.addWidget(self._orig_bit_delay_win)
        self._chan_delay_range = Range(0, 200, 1, 55, 200)
        self._chan_delay_win = RangeWidget(self._chan_delay_range,
                                           self.set_chan_delay,
                                           'Channel Delay', "counter_slider",
                                           float)
        self.top_layout.addWidget(self._chan_delay_win)
        self.root_raised_cosine_filter_0_0_0 = filter.fir_filter_fff(
            1,
            firdes.root_raised_cosine(1, channel_rate, symbol_rate, 0.35,
                                      11 * int(channel_rate / symbol_rate)))
        self.root_raised_cosine_filter_0_0 = filter.fir_filter_fff(
            int(channel_rate / symbol_rate),
            firdes.root_raised_cosine(1, channel_rate, symbol_rate, 0.35,
                                      11 * int(channel_rate / symbol_rate)))
        self.root_raised_cosine_filter_0 = filter.interp_fir_filter_fff(
            int(channel_rate / symbol_rate),
            firdes.root_raised_cosine(int(channel_rate / symbol_rate),
                                      channel_rate, symbol_rate, 0.35,
                                      11 * int(channel_rate / symbol_rate)))
        self.qtgui_time_sink_x_0_1_0 = qtgui.time_sink_f(
            512,  #size
            48000,  #samp_rate
            'Nyquist Filter Test',  #name
            4  #number of inputs
        )
        self.qtgui_time_sink_x_0_1_0.set_update_time(0.5)
        self.qtgui_time_sink_x_0_1_0.set_y_axis(-4, 4)

        self.qtgui_time_sink_x_0_1_0.set_y_label('Level', "")

        self.qtgui_time_sink_x_0_1_0.enable_tags(-1, True)
        self.qtgui_time_sink_x_0_1_0.set_trigger_mode(qtgui.TRIG_MODE_FREE,
                                                      qtgui.TRIG_SLOPE_POS,
                                                      0.0, 0, 0, "")
        self.qtgui_time_sink_x_0_1_0.enable_autoscale(False)
        self.qtgui_time_sink_x_0_1_0.enable_grid(False)
        self.qtgui_time_sink_x_0_1_0.enable_axis_labels(True)
        self.qtgui_time_sink_x_0_1_0.enable_control_panel(True)

        if not True:
            self.qtgui_time_sink_x_0_1_0.disable_legend()

        labels = [
            'Original Bits', 'RC Channel Waveform',
            'RRC Recovered Filtered Waveform', 'Post Bits', '', '', '', '', '',
            ''
        ]
        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(4):
            if len(labels[i]) == 0:
                self.qtgui_time_sink_x_0_1_0.set_line_label(
                    i, "Data {0}".format(i))
            else:
                self.qtgui_time_sink_x_0_1_0.set_line_label(i, labels[i])
            self.qtgui_time_sink_x_0_1_0.set_line_width(i, widths[i])
            self.qtgui_time_sink_x_0_1_0.set_line_color(i, colors[i])
            self.qtgui_time_sink_x_0_1_0.set_line_style(i, styles[i])
            self.qtgui_time_sink_x_0_1_0.set_line_marker(i, markers[i])
            self.qtgui_time_sink_x_0_1_0.set_line_alpha(i, alphas[i])

        self._qtgui_time_sink_x_0_1_0_win = sip.wrapinstance(
            self.qtgui_time_sink_x_0_1_0.pyqwidget(), Qt.QWidget)
        self.top_layout.addWidget(self._qtgui_time_sink_x_0_1_0_win)
        self.p25_dibit_mapper_bf_0 = p25.dibit_mapper_bf(
            dibit_map=([1, 3, -1, -3]), log_level=logging.NOTSET, filename='')
        self.interp_fir_filter_xxx_0_0 = filter.interp_fir_filter_fff(
            10, ((1, )))
        self.interp_fir_filter_xxx_0_0.declare_sample_delay(0)
        self.interp_fir_filter_xxx_0 = filter.interp_fir_filter_fff(
            10, ((1, )))
        self.interp_fir_filter_xxx_0.declare_sample_delay(0)
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_int * 1,
                                                 symbol_rate, True)
        self.blocks_int_to_float_0 = blocks.int_to_float(1, 1)
        self.blocks_float_to_char_0 = blocks.float_to_char(1, 1)
        self.blocks_delay_0_1 = blocks.delay(gr.sizeof_float * 1,
                                             int(orig_bit_delay))
        self.blocks_delay_0_0 = blocks.delay(gr.sizeof_float * 1,
                                             int(chan_delay))
        self.analog_random_uniform_source_x_0 = analog.random_uniform_source_i(
            0, 4, 0)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.analog_random_uniform_source_x_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.blocks_delay_0_0, 0),
                     (self.qtgui_time_sink_x_0_1_0, 1))
        self.connect((self.blocks_delay_0_1, 0),
                     (self.qtgui_time_sink_x_0_1_0, 0))
        self.connect((self.blocks_float_to_char_0, 0),
                     (self.p25_dibit_mapper_bf_0, 0))
        self.connect((self.blocks_int_to_float_0, 0),
                     (self.blocks_float_to_char_0, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.blocks_int_to_float_0, 0))
        self.connect((self.interp_fir_filter_xxx_0, 0),
                     (self.qtgui_time_sink_x_0_1_0, 3))
        self.connect((self.interp_fir_filter_xxx_0_0, 0),
                     (self.blocks_delay_0_1, 0))
        self.connect((self.p25_dibit_mapper_bf_0, 0),
                     (self.interp_fir_filter_xxx_0_0, 0))
        self.connect((self.p25_dibit_mapper_bf_0, 0),
                     (self.root_raised_cosine_filter_0, 0))
        self.connect((self.root_raised_cosine_filter_0, 0),
                     (self.blocks_delay_0_0, 0))
        self.connect((self.root_raised_cosine_filter_0, 0),
                     (self.root_raised_cosine_filter_0_0, 0))
        self.connect((self.root_raised_cosine_filter_0, 0),
                     (self.root_raised_cosine_filter_0_0_0, 0))
        self.connect((self.root_raised_cosine_filter_0_0, 0),
                     (self.interp_fir_filter_xxx_0, 0))
        self.connect((self.root_raised_cosine_filter_0_0_0, 0),
                     (self.qtgui_time_sink_x_0_1_0, 2))
예제 #3
0
    def __init__(self):
        grc_wxgui.top_block_gui.__init__(self, title="Top Block")

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 32000
        self.amplitude = amplitude = 0

        ##################################################
        # Blocks
        ##################################################
        _amplitude_sizer = wx.BoxSizer(wx.VERTICAL)
        self._amplitude_text_box = forms.text_box(
            parent=self.GetWin(),
            sizer=_amplitude_sizer,
            value=self.amplitude,
            callback=self.set_amplitude,
            label='amplitude',
            converter=forms.float_converter(),
            proportion=0,
        )
        self._amplitude_slider = forms.slider(
            parent=self.GetWin(),
            sizer=_amplitude_sizer,
            value=self.amplitude,
            callback=self.set_amplitude,
            minimum=0,
            maximum=0.6,
            num_steps=100,
            style=wx.SL_HORIZONTAL,
            cast=float,
            proportion=1,
        )
        self.Add(_amplitude_sizer)
        self.wxgui_constellationsink2_0 = constsink_gl.const_sink_c(
            self.GetWin(),
            title='Constellation Plot',
            sample_rate=samp_rate,
            frame_rate=5,
            const_size=2048,
            M=4,
            theta=0,
            loop_bw=6.28 / 100.0,
            fmax=0.06,
            mu=0.5,
            gain_mu=0.005,
            symbol_rate=samp_rate / 4.,
            omega_limit=0.005,
        )
        self.Add(self.wxgui_constellationsink2_0.win)
        self.epy_block_0 = epy_block_0.blk(power_param=1.0)
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1,
                                                 samp_rate, True)
        self.blocks_add_xx_0 = blocks.add_vcc(1)
        self.analog_random_uniform_source_x_0 = analog.random_uniform_source_i(
            0, 4, 0)
        self.analog_noise_source_x_0 = analog.noise_source_c(
            analog.GR_GAUSSIAN, amplitude, 42)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.analog_noise_source_x_0, 0),
                     (self.blocks_add_xx_0, 1))
        self.connect((self.analog_random_uniform_source_x_0, 0),
                     (self.epy_block_0, 0))
        self.connect((self.blocks_add_xx_0, 0), (self.blocks_throttle_0, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.wxgui_constellationsink2_0, 0))
        self.connect((self.epy_block_0, 0), (self.blocks_add_xx_0, 0))
예제 #4
0
    def __init__(self):
        gr.top_block.__init__(self, "Top Block")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Top Block")
        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", "top_block")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Variables
        ##################################################
        self.sample_rate = sample_rate = 48000
        self.noise = noise = 0
        self.input_chooser = input_chooser = 1
        self.delay2_0 = delay2_0 = 17
        self.delay2 = delay2 = 5

        ##################################################
        # Blocks
        ##################################################
        self._noise_range = Range(0, 1, 0.01, 0, 200)
        self._noise_win = RangeWidget(self._noise_range, self.set_noise, 'Noise', "counter_slider", float)
        self.top_layout.addWidget(self._noise_win)
        self._input_chooser_options = (0, 1, )
        self._input_chooser_labels = ('Test Symbol stream [3,3,-3,-3]', 'Stochastic Stream', )
        self._input_chooser_tool_bar = Qt.QToolBar(self)
        self._input_chooser_tool_bar.addWidget(Qt.QLabel('Input Selection'+": "))
        self._input_chooser_combo_box = Qt.QComboBox()
        self._input_chooser_tool_bar.addWidget(self._input_chooser_combo_box)
        for label in self._input_chooser_labels: self._input_chooser_combo_box.addItem(label)
        self._input_chooser_callback = lambda i: Qt.QMetaObject.invokeMethod(self._input_chooser_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._input_chooser_options.index(i)))
        self._input_chooser_callback(self.input_chooser)
        self._input_chooser_combo_box.currentIndexChanged.connect(
        	lambda i: self.set_input_chooser(self._input_chooser_options[i]))
        self.top_grid_layout.addWidget(self._input_chooser_tool_bar, 0,0,1,1)
        self._delay2_0_range = Range(0, 100, 1, 17, 200)
        self._delay2_0_win = RangeWidget(self._delay2_0_range, self.set_delay2_0, 'Input delay', "counter_slider", float)
        self.top_layout.addWidget(self._delay2_0_win)
        self._delay2_range = Range(0, 100, 1, 5, 200)
        self._delay2_win = RangeWidget(self._delay2_range, self.set_delay2, 'delay2', "counter_slider", float)
        self.top_layout.addWidget(self._delay2_win)
        self.qtgui_time_sink_x_1 = qtgui.time_sink_c(
        	512, #size
        	48000, #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(-1, 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)

        if not True:
          self.qtgui_time_sink_x_1.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(2):
            if len(labels[i]) == 0:
                if(i % 2 == 0):
                    self.qtgui_time_sink_x_1.set_line_label(i, "Re{{Data {0}}}".format(i/2))
                else:
                    self.qtgui_time_sink_x_1.set_line_label(i, "Im{{Data {0}}}".format(i/2))
            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_layout.addWidget(self._qtgui_time_sink_x_1_win)
        self.qtgui_time_sink_x_0 = qtgui.time_sink_f(
        	1024, #size
        	4800, #samp_rate
        	"", #name
        	3 #number of inputs
        )
        self.qtgui_time_sink_x_0.set_update_time(0.10)
        self.qtgui_time_sink_x_0.set_y_axis(-5, 5)

        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 = ['Chain Fixed', 'Chain Actual', 'Chain Fixed Test', '', '',
                  '', '', '', '', '']
        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, 2, -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(3):
            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.p25_freq_mod_fc_0 = p25.freq_mod_fc(
          sample_rate=48000,
          max_amplitude=4.38895,
          max_deviation=2827,
          sensitivity_adjust=1,
          verbose=False,
          log=False
          )
        self.p25_freq_demod_cf_0 = p25.freq_demod_cf(
          sample_rate=48000,
          max_amplitude=4.38895,
          max_deviation=2827,
          gain_adjust=1.0,
          verbose=False,
          log=False
          )
        self.p25_c4fm_modulator_bf_0 = p25.c4fm_modulator_bf(
            filter_gain=1,
            dibit_map=([1.0/3.0, 1.0, -(1.0/3.0), -1.0]),
            sample_rate=48000,
            symbol_rate=4800,
            span=11,
            verbose=False,
            log=False
          )
        self.p25_c4fm_demodulator_fixed_fb_0 = p25.c4fm_demodulator_fixed_fb(
            filter_gain=3.0,
            dibits=([3, 2, 0, 1]),
            sample_rate=48000,
            symbol_rate=4800,
            delay=int(delay2),
            span=11,
            verbose=False,
            log=False
          )
        self.p25_c4fm_demodulator_fb_0 = p25.c4fm_demodulator_fb(
            filter_gain=3.0,
            dibits=([3, 2, 0, 1]),
            sample_rate=48000,
            symbol_rate=4800,
            span=11,
            verbose=False,
            log=False
          )
        self.blocks_vector_source_x_0 = blocks.vector_source_i((1,1,3,3), True, 1, [])
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_int*1, 240000,True)
        self.blocks_skiphead_0 = blocks.skiphead(gr.sizeof_gr_complex*1, 1024)
        self.blocks_multiply_const_vxx_2 = blocks.multiply_const_vii((1 if input_chooser == 1 else 0, ))
        self.blocks_multiply_const_vxx_1 = blocks.multiply_const_vii((1 if input_chooser == 0 else 0, ))
        self.blocks_int_to_float_0 = blocks.int_to_float(1, 1)
        self.blocks_float_to_char_0 = blocks.float_to_char(1, 1)
        self.blocks_delay_0 = blocks.delay(gr.sizeof_float*1, int(delay2_0))
        self.blocks_ctrlport_monitor_performance_0 = not False or monitor("gr-perf-monitorx")
        self.blocks_char_to_float_0_0_0 = blocks.char_to_float(1, 1)
        self.blocks_char_to_float_0_0 = blocks.char_to_float(1, 1)
        self.blocks_add_xx_2 = blocks.add_vcc(1)
        self.blocks_add_xx_1 = blocks.add_vcc(1)
        self.blocks_add_xx_0 = blocks.add_vii(1)
        self.analog_random_uniform_source_x_0 = analog.random_uniform_source_i(0, 4, 0)
        self.analog_noise_source_x_1 = analog.noise_source_c(analog.GR_GAUSSIAN, 1, 0)
        self.analog_noise_source_x_0 = analog.noise_source_c(analog.GR_GAUSSIAN, float(noise), 0)
        self.analog_const_source_x_0 = analog.sig_source_c(0, analog.GR_CONST_WAVE, 0, 0, 1)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.analog_const_source_x_0, 0), (self.blocks_add_xx_2, 0))
        self.connect((self.analog_noise_source_x_0, 0), (self.blocks_add_xx_1, 1))
        self.connect((self.analog_noise_source_x_1, 0), (self.blocks_add_xx_2, 1))
        self.connect((self.analog_random_uniform_source_x_0, 0), (self.blocks_multiply_const_vxx_2, 0))
        self.connect((self.blocks_add_xx_0, 0), (self.blocks_throttle_0, 0))
        self.connect((self.blocks_add_xx_1, 0), (self.p25_freq_demod_cf_0, 0))
        self.connect((self.blocks_add_xx_2, 0), (self.blocks_skiphead_0, 0))
        self.connect((self.blocks_char_to_float_0_0, 0), (self.qtgui_time_sink_x_0, 1))
        self.connect((self.blocks_char_to_float_0_0_0, 0), (self.qtgui_time_sink_x_0, 2))
        self.connect((self.blocks_delay_0, 0), (self.qtgui_time_sink_x_0, 0))
        self.connect((self.blocks_float_to_char_0, 0), (self.p25_c4fm_modulator_bf_0, 0))
        self.connect((self.blocks_int_to_float_0, 0), (self.blocks_delay_0, 0))
        self.connect((self.blocks_int_to_float_0, 0), (self.blocks_float_to_char_0, 0))
        self.connect((self.blocks_multiply_const_vxx_1, 0), (self.blocks_add_xx_0, 0))
        self.connect((self.blocks_multiply_const_vxx_2, 0), (self.blocks_add_xx_0, 1))
        self.connect((self.blocks_skiphead_0, 0), (self.qtgui_time_sink_x_1, 0))
        self.connect((self.blocks_throttle_0, 0), (self.blocks_int_to_float_0, 0))
        self.connect((self.blocks_vector_source_x_0, 0), (self.blocks_multiply_const_vxx_1, 0))
        self.connect((self.p25_c4fm_demodulator_fb_0, 0), (self.blocks_char_to_float_0_0, 0))
        self.connect((self.p25_c4fm_demodulator_fixed_fb_0, 0), (self.blocks_char_to_float_0_0_0, 0))
        self.connect((self.p25_c4fm_modulator_bf_0, 0), (self.p25_freq_mod_fc_0, 0))
        self.connect((self.p25_freq_demod_cf_0, 0), (self.p25_c4fm_demodulator_fb_0, 0))
        self.connect((self.p25_freq_demod_cf_0, 0), (self.p25_c4fm_demodulator_fixed_fb_0, 0))
        self.connect((self.p25_freq_mod_fc_0, 0), (self.blocks_add_xx_1, 0))
예제 #5
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.samp_rate = samp_rate = 100000

        ##################################################
        # Blocks
        ##################################################
        self.qtgui_histogram_sink_x_0 = qtgui.histogram_sink_f(
            1024, 100, -100, 100, "", 1)

        self.qtgui_histogram_sink_x_0.set_update_time(0.10)
        self.qtgui_histogram_sink_x_0.enable_autoscale(True)
        self.qtgui_histogram_sink_x_0.enable_accumulate(False)
        self.qtgui_histogram_sink_x_0.enable_grid(False)
        self.qtgui_histogram_sink_x_0.enable_axis_labels(True)

        if not True:
            self.qtgui_histogram_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", "dark 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_histogram_sink_x_0.set_line_label(
                    i, "Data {0}".format(i))
            else:
                self.qtgui_histogram_sink_x_0.set_line_label(i, labels[i])
            self.qtgui_histogram_sink_x_0.set_line_width(i, widths[i])
            self.qtgui_histogram_sink_x_0.set_line_color(i, colors[i])
            self.qtgui_histogram_sink_x_0.set_line_style(i, styles[i])
            self.qtgui_histogram_sink_x_0.set_line_marker(i, markers[i])
            self.qtgui_histogram_sink_x_0.set_line_alpha(i, alphas[i])

        self._qtgui_histogram_sink_x_0_win = sip.wrapinstance(
            self.qtgui_histogram_sink_x_0.pyqwidget(), Qt.QWidget)
        self.top_layout.addWidget(self._qtgui_histogram_sink_x_0_win)

        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_int * 1, samp_rate,
                                                 True)
        self.blocks_int_to_float_0 = blocks.int_to_float(1, 1)
        self.analog_random_uniform_source_x_0 = analog.random_uniform_source_i(
            -100, 100, 0)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.analog_random_uniform_source_x_0, 0),
                     (self.blocks_int_to_float_0, 0))
        self.connect((self.blocks_int_to_float_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.qtgui_histogram_sink_x_0, 0))
    def __init__(self):
        gr.top_block.__init__(self, "p25_demodulator_chain_test")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("p25_demodulator_chain_test")
        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", "p25_demodulator_chain_test")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Variables
        ##################################################
        self.wave_delay = wave_delay = 5
        self.sample_rate = sample_rate = 48000
        self.input_chooser = input_chooser = 1
        self.dibits_delay = dibits_delay = 17
        self.dibit_delay = dibit_delay = 11
        self.adjustment = adjustment = 0.051533333 * 48000 / 4800

        ##################################################
        # Blocks
        ##################################################
        self.tab1 = Qt.QTabWidget()
        self.tab1_widget_0 = Qt.QWidget()
        self.tab1_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom,
                                           self.tab1_widget_0)
        self.tab1_grid_layout_0 = Qt.QGridLayout()
        self.tab1_layout_0.addLayout(self.tab1_grid_layout_0)
        self.tab1.addTab(self.tab1_widget_0, 'Byte to Dibit Mapping')
        self.tab1_widget_1 = Qt.QWidget()
        self.tab1_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom,
                                           self.tab1_widget_1)
        self.tab1_grid_layout_1 = Qt.QGridLayout()
        self.tab1_layout_1.addLayout(self.tab1_grid_layout_1)
        self.tab1.addTab(self.tab1_widget_1, 'Dibit to C4FM Mapping')
        self.tab1_widget_2 = Qt.QWidget()
        self.tab1_layout_2 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom,
                                           self.tab1_widget_2)
        self.tab1_grid_layout_2 = Qt.QGridLayout()
        self.tab1_layout_2.addLayout(self.tab1_grid_layout_2)
        self.tab1.addTab(self.tab1_widget_2, 'Waveform Recovery')
        self.tab1_widget_3 = Qt.QWidget()
        self.tab1_layout_3 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom,
                                           self.tab1_widget_3)
        self.tab1_grid_layout_3 = Qt.QGridLayout()
        self.tab1_layout_3.addLayout(self.tab1_grid_layout_3)
        self.tab1.addTab(self.tab1_widget_3, 'Non-Sliced Dibit Recovery')
        self.tab1_widget_4 = Qt.QWidget()
        self.tab1_layout_4 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom,
                                           self.tab1_widget_4)
        self.tab1_grid_layout_4 = Qt.QGridLayout()
        self.tab1_layout_4.addLayout(self.tab1_grid_layout_4)
        self.tab1.addTab(self.tab1_widget_4, 'Sliced Dibit Recovery')
        self.top_layout.addWidget(self.tab1)
        self._wave_delay_range = Range(0, 200, 1, 5, 200)
        self._wave_delay_win = RangeWidget(self._wave_delay_range,
                                           self.set_wave_delay,
                                           'Waveform Delay', "counter_slider",
                                           float)
        self.tab1_layout_3.addWidget(self._wave_delay_win)
        self._input_chooser_options = (
            0,
            1,
        )
        self._input_chooser_labels = (
            'Test Symbol stream [3,3,-3,-3]',
            'Stochastic Stream',
        )
        self._input_chooser_tool_bar = Qt.QToolBar(self)
        self._input_chooser_tool_bar.addWidget(
            Qt.QLabel('Input Selection' + ": "))
        self._input_chooser_combo_box = Qt.QComboBox()
        self._input_chooser_tool_bar.addWidget(self._input_chooser_combo_box)
        for label in self._input_chooser_labels:
            self._input_chooser_combo_box.addItem(label)
        self._input_chooser_callback = lambda i: Qt.QMetaObject.invokeMethod(
            self._input_chooser_combo_box, "setCurrentIndex",
            Qt.Q_ARG("int", self._input_chooser_options.index(i)))
        self._input_chooser_callback(self.input_chooser)
        self._input_chooser_combo_box.currentIndexChanged.connect(
            lambda i: self.set_input_chooser(self._input_chooser_options[i]))
        self.top_grid_layout.addWidget(self._input_chooser_tool_bar, 0, 0, 1,
                                       1)
        self._dibits_delay_range = Range(0, 200, 1, 17, 200)
        self._dibits_delay_win = RangeWidget(self._dibits_delay_range,
                                             self.set_dibits_delay,
                                             'Dibits Delay', "counter_slider",
                                             float)
        self.tab1_layout_3.addWidget(self._dibits_delay_win)
        self._dibit_delay_range = Range(0, 200, 1, 11, 200)
        self._dibit_delay_win = RangeWidget(self._dibit_delay_range,
                                            self.set_dibit_delay,
                                            'Dibit Delay', "counter_slider",
                                            float)
        self.tab1_layout_1.addWidget(self._dibit_delay_win)
        self.qtgui_time_sink_x_0_0_0_0_0_0 = qtgui.time_sink_f(
            1024,  #size
            48000,  #samp_rate
            "",  #name
            3  #number of inputs
        )
        self.qtgui_time_sink_x_0_0_0_0_0_0.set_update_time(0.0001)
        self.qtgui_time_sink_x_0_0_0_0_0_0.set_y_axis(-4, 4)

        self.qtgui_time_sink_x_0_0_0_0_0_0.set_y_label('Amplitude', "")

        self.qtgui_time_sink_x_0_0_0_0_0_0.enable_tags(-1, False)
        self.qtgui_time_sink_x_0_0_0_0_0_0.set_trigger_mode(
            qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "")
        self.qtgui_time_sink_x_0_0_0_0_0_0.enable_autoscale(False)
        self.qtgui_time_sink_x_0_0_0_0_0_0.enable_grid(False)
        self.qtgui_time_sink_x_0_0_0_0_0_0.enable_axis_labels(True)
        self.qtgui_time_sink_x_0_0_0_0_0_0.enable_control_panel(False)

        if not True:
            self.qtgui_time_sink_x_0_0_0_0_0_0.disable_legend()

        labels = [
            'Original Dibit', 'Recovered Dibit', 'Sliced Dibit', 'Error', '',
            '', '', '', '', ''
        ]
        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(3):
            if len(labels[i]) == 0:
                self.qtgui_time_sink_x_0_0_0_0_0_0.set_line_label(
                    i, "Data {0}".format(i))
            else:
                self.qtgui_time_sink_x_0_0_0_0_0_0.set_line_label(i, labels[i])
            self.qtgui_time_sink_x_0_0_0_0_0_0.set_line_width(i, widths[i])
            self.qtgui_time_sink_x_0_0_0_0_0_0.set_line_color(i, colors[i])
            self.qtgui_time_sink_x_0_0_0_0_0_0.set_line_style(i, styles[i])
            self.qtgui_time_sink_x_0_0_0_0_0_0.set_line_marker(i, markers[i])
            self.qtgui_time_sink_x_0_0_0_0_0_0.set_line_alpha(i, alphas[i])

        self._qtgui_time_sink_x_0_0_0_0_0_0_win = sip.wrapinstance(
            self.qtgui_time_sink_x_0_0_0_0_0_0.pyqwidget(), Qt.QWidget)
        self.tab1_layout_4.addWidget(self._qtgui_time_sink_x_0_0_0_0_0_0_win)
        self.qtgui_time_sink_x_0_0_0_0_0 = qtgui.time_sink_f(
            1024,  #size
            48000,  #samp_rate
            "",  #name
            3  #number of inputs
        )
        self.qtgui_time_sink_x_0_0_0_0_0.set_update_time(0.0001)
        self.qtgui_time_sink_x_0_0_0_0_0.set_y_axis(-4, 4)

        self.qtgui_time_sink_x_0_0_0_0_0.set_y_label('Amplitude', "")

        self.qtgui_time_sink_x_0_0_0_0_0.enable_tags(-1, False)
        self.qtgui_time_sink_x_0_0_0_0_0.set_trigger_mode(
            qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "")
        self.qtgui_time_sink_x_0_0_0_0_0.enable_autoscale(False)
        self.qtgui_time_sink_x_0_0_0_0_0.enable_grid(False)
        self.qtgui_time_sink_x_0_0_0_0_0.enable_axis_labels(True)
        self.qtgui_time_sink_x_0_0_0_0_0.enable_control_panel(False)

        if not True:
            self.qtgui_time_sink_x_0_0_0_0_0.disable_legend()

        labels = [
            'Transmitted Dibit', 'Shaped Waveform', 'Recovered Dibit', 'Error',
            '', '', '', '', '', ''
        ]
        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(3):
            if len(labels[i]) == 0:
                self.qtgui_time_sink_x_0_0_0_0_0.set_line_label(
                    i, "Data {0}".format(i))
            else:
                self.qtgui_time_sink_x_0_0_0_0_0.set_line_label(i, labels[i])
            self.qtgui_time_sink_x_0_0_0_0_0.set_line_width(i, widths[i])
            self.qtgui_time_sink_x_0_0_0_0_0.set_line_color(i, colors[i])
            self.qtgui_time_sink_x_0_0_0_0_0.set_line_style(i, styles[i])
            self.qtgui_time_sink_x_0_0_0_0_0.set_line_marker(i, markers[i])
            self.qtgui_time_sink_x_0_0_0_0_0.set_line_alpha(i, alphas[i])

        self._qtgui_time_sink_x_0_0_0_0_0_win = sip.wrapinstance(
            self.qtgui_time_sink_x_0_0_0_0_0.pyqwidget(), Qt.QWidget)
        self.tab1_layout_3.addWidget(self._qtgui_time_sink_x_0_0_0_0_0_win)
        self.qtgui_time_sink_x_0_0_0 = qtgui.time_sink_f(
            256,  #size
            48000,  #samp_rate
            "",  #name
            2  #number of inputs
        )
        self.qtgui_time_sink_x_0_0_0.set_update_time(0.0001)
        self.qtgui_time_sink_x_0_0_0.set_y_axis(-4, 4)

        self.qtgui_time_sink_x_0_0_0.set_y_label('Amplitude', "")

        self.qtgui_time_sink_x_0_0_0.enable_tags(-1, False)
        self.qtgui_time_sink_x_0_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE,
                                                      qtgui.TRIG_SLOPE_POS,
                                                      0.0, 0, 0, "")
        self.qtgui_time_sink_x_0_0_0.enable_autoscale(False)
        self.qtgui_time_sink_x_0_0_0.enable_grid(False)
        self.qtgui_time_sink_x_0_0_0.enable_axis_labels(True)
        self.qtgui_time_sink_x_0_0_0.enable_control_panel(False)

        if not True:
            self.qtgui_time_sink_x_0_0_0.disable_legend()

        labels = [
            'Original Byte', 'C4FM Waveform', 'Output Block Dibit', '', '', '',
            '', '', '', ''
        ]
        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(2):
            if len(labels[i]) == 0:
                self.qtgui_time_sink_x_0_0_0.set_line_label(
                    i, "Data {0}".format(i))
            else:
                self.qtgui_time_sink_x_0_0_0.set_line_label(i, labels[i])
            self.qtgui_time_sink_x_0_0_0.set_line_width(i, widths[i])
            self.qtgui_time_sink_x_0_0_0.set_line_color(i, colors[i])
            self.qtgui_time_sink_x_0_0_0.set_line_style(i, styles[i])
            self.qtgui_time_sink_x_0_0_0.set_line_marker(i, markers[i])
            self.qtgui_time_sink_x_0_0_0.set_line_alpha(i, alphas[i])

        self._qtgui_time_sink_x_0_0_0_win = sip.wrapinstance(
            self.qtgui_time_sink_x_0_0_0.pyqwidget(), Qt.QWidget)
        self.tab1_layout_1.addWidget(self._qtgui_time_sink_x_0_0_0_win)
        self.qtgui_time_sink_x_0_0 = qtgui.time_sink_f(
            128,  #size
            48000,  #samp_rate
            "",  #name
            2  #number of inputs
        )
        self.qtgui_time_sink_x_0_0.set_update_time(0.0001)
        self.qtgui_time_sink_x_0_0.set_y_axis(-4, 4)

        self.qtgui_time_sink_x_0_0.set_y_label('Amplitude', "")

        self.qtgui_time_sink_x_0_0.enable_tags(-1, False)
        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(False)
        self.qtgui_time_sink_x_0_0.enable_axis_labels(True)
        self.qtgui_time_sink_x_0_0.enable_control_panel(False)

        if not True:
            self.qtgui_time_sink_x_0_0.disable_legend()

        labels = [
            'Original Byte', 'Converted Dibit', 'Output Block Dibit', '', '',
            '', '', '', '', ''
        ]
        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(2):
            if len(labels[i]) == 0:
                self.qtgui_time_sink_x_0_0.set_line_label(
                    i, "Data {0}".format(i))
            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.tab1_layout_0.addWidget(self._qtgui_time_sink_x_0_0_win)
        self.pam_pam_slicer_fb_0 = pam.pam_slicer_fb(slice_levels=([-2, 0, 2]),
                                                     dibits=([-3, -1, 1, 3]))
        self.p25_rx_shaping_filter_ff_0 = p25.rx_shaping_filter_ff(
            filter_gain=3,
            sample_rate=48000,
            symbol_rate=4800,
            span=11,
            verbose=False,
            log=False)
        self.p25_freq_mod_fc_0 = p25.freq_mod_fc(sample_rate=48000,
                                                 max_amplitude=4.38895,
                                                 max_deviation=2827,
                                                 sensitivity_adjust=1,
                                                 verbose=False,
                                                 log=False)
        self.p25_freq_demod_cf_0 = p25.freq_demod_cf(sample_rate=48000,
                                                     max_amplitude=4.38895,
                                                     max_deviation=2827,
                                                     gain_adjust=1.0,
                                                     verbose=False,
                                                     log=False)
        self.p25_dibit_mapper_bf_0 = p25.dibit_mapper_bf(
            dibit_map=([1, 3, -1, -3]), log_level=logging.NOTSET, filename='')
        self.p25_c4fm_modulator_bf_0 = p25.c4fm_modulator_bf(
            filter_gain=1,
            dibit_map=([1.0 / 3.0, 1.0, -(1.0 / 3.0), -1.0]),
            sample_rate=48000,
            symbol_rate=4800,
            span=11,
            verbose=False,
            log=False)
        self.interp_fir_filter_xxx_0_0_1 = filter.interp_fir_filter_fff(
            10, ((1, )))
        self.interp_fir_filter_xxx_0_0_1.declare_sample_delay(0)
        self.interp_fir_filter_xxx_0_0_0_0 = filter.interp_fir_filter_fff(
            10, ((1, )))
        self.interp_fir_filter_xxx_0_0_0_0.declare_sample_delay(0)
        self.interp_fir_filter_xxx_0_0_0 = filter.interp_fir_filter_fff(
            10, ((1, )))
        self.interp_fir_filter_xxx_0_0_0.declare_sample_delay(0)
        self.interp_fir_filter_xxx_0_0 = filter.interp_fir_filter_fff(
            10, ((1, )))
        self.interp_fir_filter_xxx_0_0.declare_sample_delay(0)
        self.interp_fir_filter_xxx_0 = filter.interp_fir_filter_fff(
            10, ((1, )))
        self.interp_fir_filter_xxx_0.declare_sample_delay(0)
        self.fir_filter_xxx_0 = filter.fir_filter_fff(10, ((
            0,
            0,
            0,
            0,
            0,
            1,
        )))
        self.fir_filter_xxx_0.declare_sample_delay(0)
        self.blocks_vector_source_x_0 = blocks.vector_source_i((1, 1, 3, 3),
                                                               True, 1, [])
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_int * 1, 240000,
                                                 True)
        self.blocks_sub_xx_0 = blocks.sub_ff(1)
        self.blocks_multiply_const_vxx_2 = blocks.multiply_const_vii(
            (1 if input_chooser == 1 else 0, ))
        self.blocks_multiply_const_vxx_1 = blocks.multiply_const_vii(
            (1 if input_chooser == 0 else 0, ))
        self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vff((3, ))
        self.blocks_int_to_float_0 = blocks.int_to_float(1, 1)
        self.blocks_float_to_char_0 = blocks.float_to_char(1, 1)
        self.blocks_delay_0_0_0_1 = blocks.delay(gr.sizeof_float * 1,
                                                 int(dibits_delay))
        self.blocks_delay_0_0_0_0 = blocks.delay(gr.sizeof_float * 1,
                                                 int(wave_delay))
        self.blocks_delay_0_0_0 = blocks.delay(gr.sizeof_float * 1,
                                               int(dibits_delay))
        self.blocks_delay_0 = blocks.delay(gr.sizeof_float * 1,
                                           int(dibit_delay))
        self.blocks_char_to_float_1 = blocks.char_to_float(1, 1)
        self.blocks_char_to_float_0 = blocks.char_to_float(1, 1)
        self.blocks_add_xx_0 = blocks.add_vii(1)
        self.analog_random_uniform_source_x_0 = analog.random_uniform_source_i(
            0, 4, 0)
        self._adjustment_range = Range(0, 10, 0.01, 0.051533333 * 48000 / 4800,
                                       200)
        self._adjustment_win = RangeWidget(self._adjustment_range,
                                           self.set_adjustment, 'Sensitivity',
                                           "counter_slider", float)
        self.top_grid_layout.addWidget(self._adjustment_win, 1, 0, 1, 5)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.analog_random_uniform_source_x_0, 0),
                     (self.blocks_multiply_const_vxx_2, 0))
        self.connect((self.blocks_add_xx_0, 0), (self.blocks_throttle_0, 0))
        self.connect((self.blocks_char_to_float_0, 0),
                     (self.interp_fir_filter_xxx_0_0_1, 0))
        self.connect((self.blocks_char_to_float_1, 0),
                     (self.qtgui_time_sink_x_0_0, 0))
        self.connect((self.blocks_delay_0, 0),
                     (self.interp_fir_filter_xxx_0, 0))
        self.connect((self.blocks_delay_0_0_0, 0),
                     (self.interp_fir_filter_xxx_0_0_0, 0))
        self.connect((self.blocks_delay_0_0_0_0, 0),
                     (self.qtgui_time_sink_x_0_0_0_0_0, 1))
        self.connect((self.blocks_delay_0_0_0_1, 0),
                     (self.interp_fir_filter_xxx_0_0_0_0, 0))
        self.connect((self.blocks_float_to_char_0, 0),
                     (self.blocks_char_to_float_1, 0))
        self.connect((self.blocks_float_to_char_0, 0),
                     (self.p25_c4fm_modulator_bf_0, 0))
        self.connect((self.blocks_float_to_char_0, 0),
                     (self.p25_dibit_mapper_bf_0, 0))
        self.connect((self.blocks_int_to_float_0, 0),
                     (self.blocks_float_to_char_0, 0))
        self.connect((self.blocks_multiply_const_vxx_0, 0),
                     (self.qtgui_time_sink_x_0_0_0, 1))
        self.connect((self.blocks_multiply_const_vxx_1, 0),
                     (self.blocks_add_xx_0, 0))
        self.connect((self.blocks_multiply_const_vxx_2, 0),
                     (self.blocks_add_xx_0, 1))
        self.connect((self.blocks_sub_xx_0, 0),
                     (self.qtgui_time_sink_x_0_0_0_0_0_0, 2))
        self.connect((self.blocks_throttle_0, 0),
                     (self.blocks_int_to_float_0, 0))
        self.connect((self.blocks_vector_source_x_0, 0),
                     (self.blocks_multiply_const_vxx_1, 0))
        self.connect((self.fir_filter_xxx_0, 0),
                     (self.interp_fir_filter_xxx_0_0, 0))
        self.connect((self.fir_filter_xxx_0, 0), (self.pam_pam_slicer_fb_0, 0))
        self.connect((self.interp_fir_filter_xxx_0, 0),
                     (self.qtgui_time_sink_x_0_0_0, 0))
        self.connect((self.interp_fir_filter_xxx_0_0, 0),
                     (self.qtgui_time_sink_x_0_0_0_0_0, 2))
        self.connect((self.interp_fir_filter_xxx_0_0_0, 0),
                     (self.qtgui_time_sink_x_0_0_0_0_0, 0))
        self.connect((self.interp_fir_filter_xxx_0_0_0_0, 0),
                     (self.blocks_sub_xx_0, 0))
        self.connect((self.interp_fir_filter_xxx_0_0_0_0, 0),
                     (self.qtgui_time_sink_x_0_0_0_0_0_0, 0))
        self.connect((self.interp_fir_filter_xxx_0_0_1, 0),
                     (self.blocks_sub_xx_0, 1))
        self.connect((self.interp_fir_filter_xxx_0_0_1, 0),
                     (self.qtgui_time_sink_x_0_0_0_0_0_0, 1))
        self.connect((self.p25_c4fm_modulator_bf_0, 0),
                     (self.blocks_multiply_const_vxx_0, 0))
        self.connect((self.p25_c4fm_modulator_bf_0, 0),
                     (self.p25_freq_mod_fc_0, 0))
        self.connect((self.p25_dibit_mapper_bf_0, 0), (self.blocks_delay_0, 0))
        self.connect((self.p25_dibit_mapper_bf_0, 0),
                     (self.blocks_delay_0_0_0, 0))
        self.connect((self.p25_dibit_mapper_bf_0, 0),
                     (self.blocks_delay_0_0_0_1, 0))
        self.connect((self.p25_dibit_mapper_bf_0, 0),
                     (self.qtgui_time_sink_x_0_0, 1))
        self.connect((self.p25_freq_demod_cf_0, 0),
                     (self.p25_rx_shaping_filter_ff_0, 0))
        self.connect((self.p25_freq_mod_fc_0, 0),
                     (self.p25_freq_demod_cf_0, 0))
        self.connect((self.p25_rx_shaping_filter_ff_0, 0),
                     (self.blocks_delay_0_0_0_0, 0))
        self.connect((self.p25_rx_shaping_filter_ff_0, 0),
                     (self.fir_filter_xxx_0, 0))
        self.connect((self.pam_pam_slicer_fb_0, 0),
                     (self.blocks_char_to_float_0, 0))