def __init__(self,
                 max_freq_offset=10,
                 guard=0.125,
                 mode=3,
                 snr=10,
                 tmcc_print=False):
        gr.hier_block2.__init__(
            # self, "ISDB-T RF Channel Decoding",
            self,
            "isdbt_rf_channel_decoding",
            gr.io_signature(1, 1, gr.sizeof_gr_complex * 1),
            gr.io_signaturev(2, 2, [
                gr.sizeof_gr_complex * 13 * 96 * 2**(mode - 1),
                gr.sizeof_gr_complex * (13 * 108 * 2**(mode - 1) + 1)
            ]),
        )

        ##################################################
        # Parameters
        ##################################################
        self.max_freq_offset = max_freq_offset
        self.guard = guard
        self.mode = mode
        self.snr = snr
        self.tmcc_print = tmcc_print

        ##################################################
        # Variables
        ##################################################
        self.total_carriers = total_carriers = 2**(10 + mode)
        self.data_carriers = data_carriers = 13 * 96 * 2**(mode - 1)
        self.active_carriers = active_carriers = 13 * 108 * 2**(mode - 1) + 1

        ##################################################
        # Blocks
        ##################################################
        self.isdbt_tmcc_decoder_0 = isdbt.tmcc_decoder(mode, tmcc_print)
        self.isdbt_sync_and_channel_estimaton_0 = isdbt.sync_and_channel_estimaton(
            total_carriers, active_carriers, max_freq_offset)
        self.isdbt_ofdm_sym_acquisition_0 = isdbt.ofdm_sym_acquisition(
            total_carriers, int(guard * total_carriers), snr)
        self.fft_vxx_0 = fft.fft_vcc(total_carriers, True,
                                     (window.rectangular(total_carriers)),
                                     True, 1)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.fft_vxx_0, 0),
                     (self.isdbt_sync_and_channel_estimaton_0, 0))
        self.connect((self.isdbt_ofdm_sym_acquisition_0, 0),
                     (self.fft_vxx_0, 0))
        self.connect((self.isdbt_sync_and_channel_estimaton_0, 0),
                     (self.isdbt_tmcc_decoder_0, 0))
        self.connect((self.isdbt_sync_and_channel_estimaton_0, 1), (self, 1))
        self.connect((self.isdbt_tmcc_decoder_0, 0), (self, 0))
        self.connect((self, 0), (self.isdbt_ofdm_sym_acquisition_0, 0))
    def test_sym0_mode3 (self):
        # set up fg
        total_segments = 13; 
        mode = 3;

        total_data_carriers = total_segments*96*2**(mode-1)
        total_carriers = total_segments*108*2**(mode-1)+1
        tmcc_decoder = isdbt.tmcc_decoder(mode, False)

        # the input are the carrier index in each carrier. The
        # expected result in this case is easy to calculate (see below)
        src_data = range(total_carriers)*2
        
        sym_index = 0
        tag = gr.tag_utils.python_to_tag({'offset':0, 'key':gr.pmt.string_to_symbol("relative_symbol_index"), 'value':gr.pmt.from_long(sym_index)})
        src = blocks.vector_source_c(src_data, False, total_carriers, [tag])
        dst = blocks.vector_sink_c(total_data_carriers)

        self.tb.connect(src,tmcc_decoder)
        self.tb.connect(tmcc_decoder,dst)
        self.tb.run()

        actual_result = dst.data()
        
        # the expected result are all data carriers (indexed as originally when all carriers were present)
        disordered_segments = (11, 9, 7, 5, 3, 1, 0, 2, 4, 6, 8, 10, 12)
        expected_result = range(total_carriers)
        # I remove the CP
        expected_result.remove(total_carriers-1)
        # I remove the SP
        sp_list = [12*i+3*sym_index for i in range((total_carriers-1)/12)]
        expected_result = [item for item in expected_result if item not in sp_list]
        # i then remove the tmcc
        tmcc_list = []
        for segment in range(13):
            tmcc_segment = self.tmcc_dict_mode3[disordered_segments[segment]]
            tmcc_list += [segment*(total_carriers-1)/13+tmcc_segment[i] for i in range(len(tmcc_segment))]
        expected_result = [item for item in expected_result if item not in tmcc_list]
        # I remove the AC
        ac_list = []
        for segment in range(13):
            ac_segment = self.ac_dict_mode3[disordered_segments[segment]]
            ac_list += [segment*(total_carriers-1)/13+ac_segment[i] for i in range(len(ac_segment))]
        expected_result = [item for item in expected_result if item not in ac_list]

        # I finally re-arrange the segments
        reordered_expected_result = []
        for segment in range(13):
            where = disordered_segments.index(segment)
            reordered_expected_result = reordered_expected_result + expected_result[where*total_data_carriers/13:(where+1)*total_data_carriers/13]

        #print "expected: ", reordered_expected_result
        #print "actual: ", actual_result
        #print "diff: ", [ai-bi for ai,bi in zip(reordered_expected_result,actual_result)]

        self.assertFloatTuplesAlmostEqual(reordered_expected_result*2, actual_result)
    def __init__(self, max_freq_offset=10, guard=0.125, mode=3, snr=10, tmcc_print=False):
        gr.hier_block2.__init__(
           # self, "ISDB-T RF Channel Decoding",
            self, "isdbt_rf_channel_decoding",
            gr.io_signature(1, 1, gr.sizeof_gr_complex*1),
            gr.io_signaturev(2, 2, [gr.sizeof_gr_complex*13*96*2**(mode-1), gr.sizeof_gr_complex*(13*108*2**(mode-1)+1)]),
        )

        ##################################################
        # Parameters
        ##################################################
        self.max_freq_offset = max_freq_offset
        self.guard = guard
        self.mode = mode
        self.snr = snr
        self.tmcc_print = tmcc_print

        ##################################################
        # Variables
        ##################################################
        self.total_carriers = total_carriers = 2**(10+mode)
        self.data_carriers = data_carriers = 13*96*2**(mode-1)
        self.active_carriers = active_carriers = 13*108*2**(mode-1)+1

        ##################################################
        # Blocks
        ##################################################
        self.isdbt_tmcc_decoder_0 = isdbt.tmcc_decoder(mode, tmcc_print)
        self.isdbt_sync_and_channel_estimaton_0 = isdbt.sync_and_channel_estimaton(total_carriers, active_carriers, max_freq_offset)
        self.isdbt_ofdm_sym_acquisition_0 = isdbt.ofdm_sym_acquisition(total_carriers, int(guard*total_carriers), snr)
        self.fft_vxx_0 = fft.fft_vcc(total_carriers, True, (window.rectangular(total_carriers)), True, 1)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.fft_vxx_0, 0), (self.isdbt_sync_and_channel_estimaton_0, 0))    
        self.connect((self.isdbt_ofdm_sym_acquisition_0, 0), (self.fft_vxx_0, 0))    
        self.connect((self.isdbt_sync_and_channel_estimaton_0, 0), (self.isdbt_tmcc_decoder_0, 0))
        self.connect((self.isdbt_sync_and_channel_estimaton_0, 1), (self, 1))
        self.connect((self.isdbt_tmcc_decoder_0, 0), (self, 0))    
        self.connect((self, 0), (self.isdbt_ofdm_sym_acquisition_0, 0))    
Exemple #4
0
    def test_sym3_mode1(self):
        # set up fg
        total_segments = 13
        mode = 1

        total_data_carriers = total_segments * 96 * 2**(mode - 1)
        total_carriers = total_segments * 108 * 2**(mode - 1) + 1
        tmcc_decoder = isdbt.tmcc_decoder(mode, False)

        # the input are the carrier index in each carrier. The
        # expected result in this case is easy to calculate (see below)
        src_data = list(range(total_carriers)) * 2

        sym_index = 3
        tag = gr.tag_utils.python_to_tag({
            'offset':
            0,
            'key':
            gr.pmt.string_to_symbol("relative_symbol_index"),
            'value':
            gr.pmt.from_long(sym_index)
        })
        src = blocks.vector_source_c(src_data, False, total_carriers, [tag])
        dst = blocks.vector_sink_c(total_data_carriers)

        self.tb.connect(src, tmcc_decoder)
        self.tb.connect(tmcc_decoder, dst)
        self.tb.run()

        actual_result = dst.data()

        # the expected result are all data carriers (indexed as originally when all carriers were present)
        disordered_segments = (11, 9, 7, 5, 3, 1, 0, 2, 4, 6, 8, 10, 12)
        expected_result = list(range(total_carriers))
        # I remove the CP
        expected_result.remove(total_carriers - 1)
        # I remove the SP
        sp_list = [
            12 * i + 3 * sym_index for i in range((total_carriers - 1) // 12)
        ]
        expected_result = [
            item for item in expected_result if item not in sp_list
        ]
        # i then remove the tmcc
        tmcc_list = []
        for segment in range(13):
            tmcc_segment = self.tmcc_dict_mode1[disordered_segments[segment]]
            tmcc_list += [
                segment * (total_carriers - 1) / 13 + tmcc_segment[i]
                for i in range(len(tmcc_segment))
            ]
        expected_result = [
            item for item in expected_result if item not in tmcc_list
        ]
        # I remove the AC
        ac_list = []
        for segment in range(13):
            ac_segment = self.ac_dict_mode1[disordered_segments[segment]]
            ac_list += [
                segment * (total_carriers - 1) / 13 + ac_segment[i]
                for i in range(len(ac_segment))
            ]
        expected_result = [
            item for item in expected_result if item not in ac_list
        ]

        # I finally re-arrange the segments
        reordered_expected_result = []
        for segment in range(13):
            where = disordered_segments.index(segment)
            reordered_expected_result = reordered_expected_result + expected_result[
                int(where * total_data_carriers /
                    13):int((where + 1) * total_data_carriers / 13)]

        self.assertFloatTuplesAlmostEqual(reordered_expected_result * 2,
                                          actual_result)
Exemple #5
0
    def __init__(self):
        gr.top_block.__init__(self, "Receptor_FullSeg")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Receptor_FullSeg")
        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", "fullseg")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Variables
        ##################################################
        self.mode = mode = 3
        self.total_carriers = total_carriers = 2**(10 + mode)
        self.samp_usrp = samp_usrp = 7.69231e6
        self.samp_rate = samp_rate = 8e6 * 64 / 63
        self.inter = inter = 1664
        self.guard = guard = 1 / 16.0
        self.decim = decim = 1575
        self.data_carriers = data_carriers = 13 * 96 * 2**(mode - 1)
        self.center_freq = center_freq = 575.143e6
        self.active_carriers = active_carriers = 13 * 108 * 2**(mode - 1) + 1
        self.C = C = 0
        self.B = B = 12
        self.A = A = 1

        ##################################################
        # Blocks
        ##################################################
        self._mode_options = (
            3,
            2,
            1,
        )
        self._mode_labels = (
            '3 (8k)',
            '2 (4k)',
            '1 (2k)',
        )
        self._mode_tool_bar = Qt.QToolBar(self)
        self._mode_tool_bar.addWidget(Qt.QLabel('Mode' + ": "))
        self._mode_combo_box = Qt.QComboBox()
        self._mode_tool_bar.addWidget(self._mode_combo_box)
        for label in self._mode_labels:
            self._mode_combo_box.addItem(label)
        self._mode_callback = lambda i: Qt.QMetaObject.invokeMethod(
            self._mode_combo_box, "setCurrentIndex",
            Qt.Q_ARG("int", self._mode_options.index(i)))
        self._mode_callback(self.mode)
        self._mode_combo_box.currentIndexChanged.connect(
            lambda i: self.set_mode(self._mode_options[i]))
        self.top_layout.addWidget(self._mode_tool_bar)
        self._guard_options = (
            1 / 4.0,
            1 / 8.0,
            1 / 16.0,
            1 / 32.0,
        )
        self._guard_labels = (
            '1/4',
            '1/8',
            '1/16',
            '1/32',
        )
        self._guard_tool_bar = Qt.QToolBar(self)
        self._guard_tool_bar.addWidget(Qt.QLabel('Guard Interval' + ": "))
        self._guard_combo_box = Qt.QComboBox()
        self._guard_tool_bar.addWidget(self._guard_combo_box)
        for label in self._guard_labels:
            self._guard_combo_box.addItem(label)
        self._guard_callback = lambda i: Qt.QMetaObject.invokeMethod(
            self._guard_combo_box, "setCurrentIndex",
            Qt.Q_ARG("int", self._guard_options.index(i)))
        self._guard_callback(self.guard)
        self._guard_combo_box.currentIndexChanged.connect(
            lambda i: self.set_guard(self._guard_options[i]))
        self.top_layout.addWidget(self._guard_tool_bar)
        self._center_freq_tool_bar = Qt.QToolBar(self)
        self._center_freq_tool_bar.addWidget(Qt.QLabel('Frecuency' + ": "))
        self._center_freq_line_edit = Qt.QLineEdit(str(self.center_freq))
        self._center_freq_tool_bar.addWidget(self._center_freq_line_edit)
        self._center_freq_line_edit.returnPressed.connect(
            lambda: self.set_center_freq(
                eng_notation.str_to_num(
                    str(self._center_freq_line_edit.text().toAscii()))))
        self.top_layout.addWidget(self._center_freq_tool_bar)
        self.Tabber = Qt.QTabWidget()
        self.Tabber_widget_0 = Qt.QWidget()
        self.Tabber_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom,
                                             self.Tabber_widget_0)
        self.Tabber_grid_layout_0 = Qt.QGridLayout()
        self.Tabber_layout_0.addLayout(self.Tabber_grid_layout_0)
        self.Tabber.addTab(self.Tabber_widget_0, 'Spectrum')
        self.Tabber_widget_1 = Qt.QWidget()
        self.Tabber_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom,
                                             self.Tabber_widget_1)
        self.Tabber_grid_layout_1 = Qt.QGridLayout()
        self.Tabber_layout_1.addLayout(self.Tabber_grid_layout_1)
        self.Tabber.addTab(self.Tabber_widget_1, 'Constellation')
        self.Tabber_widget_2 = Qt.QWidget()
        self.Tabber_layout_2 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom,
                                             self.Tabber_widget_2)
        self.Tabber_grid_layout_2 = Qt.QGridLayout()
        self.Tabber_layout_2.addLayout(self.Tabber_grid_layout_2)
        self.Tabber.addTab(self.Tabber_widget_2, 'Van de Beek')
        self.Tabber_widget_3 = Qt.QWidget()
        self.Tabber_layout_3 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom,
                                             self.Tabber_widget_3)
        self.Tabber_grid_layout_3 = Qt.QGridLayout()
        self.Tabber_layout_3.addLayout(self.Tabber_grid_layout_3)
        self.Tabber.addTab(self.Tabber_widget_3, 'Measurements')
        self.top_grid_layout.addWidget(self.Tabber, 0, 0, 0, 0)
        self.qtgui_time_sink_x_0 = qtgui.time_sink_f(
            (int(total_carriers * (1 + guard))),  #size
            samp_rate,  #samp_rate
            'ML OFDM Synchronization',  #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(-0.02, 0.0015)

        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(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.Tabber_grid_layout_2.addWidget(self._qtgui_time_sink_x_0_win, 0,
                                            1, 1, 1)
        self.qtgui_number_sink_0_1 = qtgui.number_sink(gr.sizeof_float, 0,
                                                       qtgui.NUM_GRAPH_VERT, 1)
        self.qtgui_number_sink_0_1.set_update_time(0.10)
        self.qtgui_number_sink_0_1.set_title("Modulation Error Rate B")

        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_1.set_min(i, 0)
            self.qtgui_number_sink_0_1.set_max(i, 50)
            self.qtgui_number_sink_0_1.set_color(i, colors[i][0], colors[i][1])
            if len(labels[i]) == 0:
                self.qtgui_number_sink_0_1.set_label(i, "Data {0}".format(i))
            else:
                self.qtgui_number_sink_0_1.set_label(i, labels[i])
            self.qtgui_number_sink_0_1.set_unit(i, units[i])
            self.qtgui_number_sink_0_1.set_factor(i, factor[i])

        self.qtgui_number_sink_0_1.enable_autoscale(False)
        self._qtgui_number_sink_0_1_win = sip.wrapinstance(
            self.qtgui_number_sink_0_1.pyqwidget(), Qt.QWidget)
        self.Tabber_grid_layout_3.addWidget(self._qtgui_number_sink_0_1_win, 1,
                                            1, 1, 1)
        self.qtgui_number_sink_0_0_1_0 = qtgui.number_sink(
            gr.sizeof_float, 0, qtgui.NUM_GRAPH_VERT, 1)
        self.qtgui_number_sink_0_0_1_0.set_update_time(0.10)
        self.qtgui_number_sink_0_0_1_0.set_title("BER Viterbi")

        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_1_0.set_min(i, 0)
            self.qtgui_number_sink_0_0_1_0.set_max(i, 1)
            self.qtgui_number_sink_0_0_1_0.set_color(i, colors[i][0],
                                                     colors[i][1])
            if len(labels[i]) == 0:
                self.qtgui_number_sink_0_0_1_0.set_label(
                    i, "Data {0}".format(i))
            else:
                self.qtgui_number_sink_0_0_1_0.set_label(i, labels[i])
            self.qtgui_number_sink_0_0_1_0.set_unit(i, units[i])
            self.qtgui_number_sink_0_0_1_0.set_factor(i, factor[i])

        self.qtgui_number_sink_0_0_1_0.enable_autoscale(False)
        self._qtgui_number_sink_0_0_1_0_win = sip.wrapinstance(
            self.qtgui_number_sink_0_0_1_0.pyqwidget(), Qt.QWidget)
        self.Tabber_grid_layout_3.addWidget(
            self._qtgui_number_sink_0_0_1_0_win, 0, 2, 1, 1)
        self.qtgui_number_sink_0_0_1 = qtgui.number_sink(
            gr.sizeof_float, 0, qtgui.NUM_GRAPH_VERT, 1)
        self.qtgui_number_sink_0_0_1.set_update_time(0.10)
        self.qtgui_number_sink_0_0_1.set_title("BER Viterbi")

        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_1.set_min(i, 0)
            self.qtgui_number_sink_0_0_1.set_max(i, 1)
            self.qtgui_number_sink_0_0_1.set_color(i, colors[i][0],
                                                   colors[i][1])
            if len(labels[i]) == 0:
                self.qtgui_number_sink_0_0_1.set_label(i, "Data {0}".format(i))
            else:
                self.qtgui_number_sink_0_0_1.set_label(i, labels[i])
            self.qtgui_number_sink_0_0_1.set_unit(i, units[i])
            self.qtgui_number_sink_0_0_1.set_factor(i, factor[i])

        self.qtgui_number_sink_0_0_1.enable_autoscale(False)
        self._qtgui_number_sink_0_0_1_win = sip.wrapinstance(
            self.qtgui_number_sink_0_0_1.pyqwidget(), Qt.QWidget)
        self.Tabber_grid_layout_3.addWidget(self._qtgui_number_sink_0_0_1_win,
                                            1, 2, 1, 1)
        self.qtgui_number_sink_0_0_0_0_0 = qtgui.number_sink(
            gr.sizeof_float, 0, qtgui.NUM_GRAPH_VERT, 1)
        self.qtgui_number_sink_0_0_0_0_0.set_update_time(0.10)
        self.qtgui_number_sink_0_0_0_0_0.set_title("BER Reed Solomon")

        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_0_0_0.set_min(i, 0)
            self.qtgui_number_sink_0_0_0_0_0.set_max(i, 1)
            self.qtgui_number_sink_0_0_0_0_0.set_color(i, colors[i][0],
                                                       colors[i][1])
            if len(labels[i]) == 0:
                self.qtgui_number_sink_0_0_0_0_0.set_label(
                    i, "Data {0}".format(i))
            else:
                self.qtgui_number_sink_0_0_0_0_0.set_label(i, labels[i])
            self.qtgui_number_sink_0_0_0_0_0.set_unit(i, units[i])
            self.qtgui_number_sink_0_0_0_0_0.set_factor(i, factor[i])

        self.qtgui_number_sink_0_0_0_0_0.enable_autoscale(False)
        self._qtgui_number_sink_0_0_0_0_0_win = sip.wrapinstance(
            self.qtgui_number_sink_0_0_0_0_0.pyqwidget(), Qt.QWidget)
        self.Tabber_grid_layout_3.addWidget(
            self._qtgui_number_sink_0_0_0_0_0_win, 0, 3, 1, 1)
        self.qtgui_number_sink_0_0_0_0 = qtgui.number_sink(
            gr.sizeof_float, 0, qtgui.NUM_GRAPH_VERT, 1)
        self.qtgui_number_sink_0_0_0_0.set_update_time(0.10)
        self.qtgui_number_sink_0_0_0_0.set_title("BER Reed Solomon")

        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_0_0.set_min(i, 0)
            self.qtgui_number_sink_0_0_0_0.set_max(i, 1)
            self.qtgui_number_sink_0_0_0_0.set_color(i, colors[i][0],
                                                     colors[i][1])
            if len(labels[i]) == 0:
                self.qtgui_number_sink_0_0_0_0.set_label(
                    i, "Data {0}".format(i))
            else:
                self.qtgui_number_sink_0_0_0_0.set_label(i, labels[i])
            self.qtgui_number_sink_0_0_0_0.set_unit(i, units[i])
            self.qtgui_number_sink_0_0_0_0.set_factor(i, factor[i])

        self.qtgui_number_sink_0_0_0_0.enable_autoscale(False)
        self._qtgui_number_sink_0_0_0_0_win = sip.wrapinstance(
            self.qtgui_number_sink_0_0_0_0.pyqwidget(), Qt.QWidget)
        self.Tabber_grid_layout_3.addWidget(
            self._qtgui_number_sink_0_0_0_0_win, 1, 3, 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("Modulation Error Rate A")

        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, 0)
            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.Tabber_grid_layout_3.addWidget(self._qtgui_number_sink_0_win, 0,
                                            1, 1, 1)
        self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c(
            1024,  #size
            firdes.WIN_RECTANGULAR,  #wintype
            center_freq,  #fc
            samp_rate,  #bw
            "Incoming spectrum",  #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(10, -140)
        self.qtgui_freq_sink_x_0.set_y_label('Relative Gain', '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(True)
        self.qtgui_freq_sink_x_0.enable_grid(False)
        self.qtgui_freq_sink_x_0.set_fft_average(0.2)
        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 "complex" == "float" or "complex" == "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.Tabber_grid_layout_0.addWidget(self._qtgui_freq_sink_x_0_win, 0,
                                            0, 1, 1)
        self.qtgui_const_sink_x_0_1_0 = qtgui.const_sink_c(
            0 * 96 * 2**(mode - 1),  #size
            'Constellation',  #name
            1  #number of inputs
        )
        self.qtgui_const_sink_x_0_1_0.set_update_time(0.10)
        self.qtgui_const_sink_x_0_1_0.set_y_axis(-2, 2)
        self.qtgui_const_sink_x_0_1_0.set_x_axis(-2, 2)
        self.qtgui_const_sink_x_0_1_0.set_trigger_mode(qtgui.TRIG_MODE_FREE,
                                                       qtgui.TRIG_SLOPE_POS,
                                                       0.0, 0, "")
        self.qtgui_const_sink_x_0_1_0.enable_autoscale(False)
        self.qtgui_const_sink_x_0_1_0.enable_grid(False)
        self.qtgui_const_sink_x_0_1_0.enable_axis_labels(True)

        if not True:
            self.qtgui_const_sink_x_0_1_0.disable_legend()

        labels = ['', '', '', '', '', '', '', '', '', '']
        widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
        colors = [
            "blue", "red", "red", "red", "red", "red", "red", "red", "red",
            "red"
        ]
        styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        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_const_sink_x_0_1_0.set_line_label(
                    i, "Data {0}".format(i))
            else:
                self.qtgui_const_sink_x_0_1_0.set_line_label(i, labels[i])
            self.qtgui_const_sink_x_0_1_0.set_line_width(i, widths[i])
            self.qtgui_const_sink_x_0_1_0.set_line_color(i, colors[i])
            self.qtgui_const_sink_x_0_1_0.set_line_style(i, styles[i])
            self.qtgui_const_sink_x_0_1_0.set_line_marker(i, markers[i])
            self.qtgui_const_sink_x_0_1_0.set_line_alpha(i, alphas[i])

        self._qtgui_const_sink_x_0_1_0_win = sip.wrapinstance(
            self.qtgui_const_sink_x_0_1_0.pyqwidget(), Qt.QWidget)
        self.Tabber_grid_layout_1.addWidget(self._qtgui_const_sink_x_0_1_0_win,
                                            2, 0, 2, 2)
        self.qtgui_const_sink_x_0_1 = qtgui.const_sink_c(
            12 * 96 * 2**(mode - 1),  #size
            'Constellation_Layer_B',  #name
            1  #number of inputs
        )
        self.qtgui_const_sink_x_0_1.set_update_time(0.10)
        self.qtgui_const_sink_x_0_1.set_y_axis(-2, 2)
        self.qtgui_const_sink_x_0_1.set_x_axis(-2, 2)
        self.qtgui_const_sink_x_0_1.set_trigger_mode(qtgui.TRIG_MODE_FREE,
                                                     qtgui.TRIG_SLOPE_POS, 0.0,
                                                     0, "")
        self.qtgui_const_sink_x_0_1.enable_autoscale(False)
        self.qtgui_const_sink_x_0_1.enable_grid(False)
        self.qtgui_const_sink_x_0_1.enable_axis_labels(True)

        if not True:
            self.qtgui_const_sink_x_0_1.disable_legend()

        labels = ['', '', '', '', '', '', '', '', '', '']
        widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
        colors = [
            "blue", "red", "red", "red", "red", "red", "red", "red", "red",
            "red"
        ]
        styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        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_const_sink_x_0_1.set_line_label(
                    i, "Data {0}".format(i))
            else:
                self.qtgui_const_sink_x_0_1.set_line_label(i, labels[i])
            self.qtgui_const_sink_x_0_1.set_line_width(i, widths[i])
            self.qtgui_const_sink_x_0_1.set_line_color(i, colors[i])
            self.qtgui_const_sink_x_0_1.set_line_style(i, styles[i])
            self.qtgui_const_sink_x_0_1.set_line_marker(i, markers[i])
            self.qtgui_const_sink_x_0_1.set_line_alpha(i, alphas[i])

        self._qtgui_const_sink_x_0_1_win = sip.wrapinstance(
            self.qtgui_const_sink_x_0_1.pyqwidget(), Qt.QWidget)
        self.Tabber_grid_layout_1.addWidget(self._qtgui_const_sink_x_0_1_win,
                                            0, 2, 1, 1)
        self.qtgui_const_sink_x_0_0 = qtgui.const_sink_c(
            data_carriers,  #size
            'Constellation_Layer_All',  #name
            1  #number of inputs
        )
        self.qtgui_const_sink_x_0_0.set_update_time(0.10)
        self.qtgui_const_sink_x_0_0.set_y_axis(-2, 2)
        self.qtgui_const_sink_x_0_0.set_x_axis(-2, 2)
        self.qtgui_const_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE,
                                                     qtgui.TRIG_SLOPE_POS, 0.0,
                                                     0, "")
        self.qtgui_const_sink_x_0_0.enable_autoscale(False)
        self.qtgui_const_sink_x_0_0.enable_grid(False)
        self.qtgui_const_sink_x_0_0.enable_axis_labels(True)

        if not True:
            self.qtgui_const_sink_x_0_0.disable_legend()

        labels = ['', '', '', '', '', '', '', '', '', '']
        widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
        colors = [
            "blue", "red", "red", "red", "red", "red", "red", "red", "red",
            "red"
        ]
        styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        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_const_sink_x_0_0.set_line_label(
                    i, "Data {0}".format(i))
            else:
                self.qtgui_const_sink_x_0_0.set_line_label(i, labels[i])
            self.qtgui_const_sink_x_0_0.set_line_width(i, widths[i])
            self.qtgui_const_sink_x_0_0.set_line_color(i, colors[i])
            self.qtgui_const_sink_x_0_0.set_line_style(i, styles[i])
            self.qtgui_const_sink_x_0_0.set_line_marker(i, markers[i])
            self.qtgui_const_sink_x_0_0.set_line_alpha(i, alphas[i])

        self._qtgui_const_sink_x_0_0_win = sip.wrapinstance(
            self.qtgui_const_sink_x_0_0.pyqwidget(), Qt.QWidget)
        self.Tabber_grid_layout_1.addWidget(self._qtgui_const_sink_x_0_0_win,
                                            2, 2, 1, 1)
        self.qtgui_const_sink_x_0 = qtgui.const_sink_c(
            1 * 96 * 2**(mode - 1),  #size
            'Constellation_Layer_A',  #name
            1  #number of inputs
        )
        self.qtgui_const_sink_x_0.set_update_time(0.10)
        self.qtgui_const_sink_x_0.set_y_axis(-2, 2)
        self.qtgui_const_sink_x_0.set_x_axis(-2, 2)
        self.qtgui_const_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE,
                                                   qtgui.TRIG_SLOPE_POS, 0.0,
                                                   0, "")
        self.qtgui_const_sink_x_0.enable_autoscale(False)
        self.qtgui_const_sink_x_0.enable_grid(False)
        self.qtgui_const_sink_x_0.enable_axis_labels(True)

        if not True:
            self.qtgui_const_sink_x_0.disable_legend()

        labels = ['', '', '', '', '', '', '', '', '', '']
        widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
        colors = [
            "blue", "red", "red", "red", "red", "red", "red", "red", "red",
            "red"
        ]
        styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        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_const_sink_x_0.set_line_label(
                    i, "Data {0}".format(i))
            else:
                self.qtgui_const_sink_x_0.set_line_label(i, labels[i])
            self.qtgui_const_sink_x_0.set_line_width(i, widths[i])
            self.qtgui_const_sink_x_0.set_line_color(i, colors[i])
            self.qtgui_const_sink_x_0.set_line_style(i, styles[i])
            self.qtgui_const_sink_x_0.set_line_marker(i, markers[i])
            self.qtgui_const_sink_x_0.set_line_alpha(i, alphas[i])

        self._qtgui_const_sink_x_0_win = sip.wrapinstance(
            self.qtgui_const_sink_x_0.pyqwidget(), Qt.QWidget)
        self.Tabber_grid_layout_1.addWidget(self._qtgui_const_sink_x_0_win, 0,
                                            0, 1, 1)
        self.low_pass_filter_0_0 = filter.fir_filter_ccf(
            1,
            firdes.low_pass(1, samp_rate, 6e6 / 2.0, 0.5e6, firdes.WIN_HAMMING,
                            6.76))
        self.isdbt_tmcc_decoder_0 = isdbt.tmcc_decoder(3, True)
        self.isdbt_time_deinterleaver_0 = isdbt.time_deinterleaver(
            3, 1, 4, 12, 2, 0, 0)
        self.isdbt_sync_and_channel_estimation_0 = isdbt.sync_and_channel_estimation(
            8192, 5617, 200)
        self.isdbt_symbol_demapper_0 = isdbt.symbol_demapper(
            3, 1, 4, 12, 64, 0, 64)
        self.isdbt_subset_of_carriers_0_0_0 = isdbt.subset_of_carriers(
            data_carriers, 0, 0)
        self.isdbt_subset_of_carriers_0_0 = isdbt.subset_of_carriers(
            data_carriers, 0, A * 96 * 2**(mode - 1) - 1)
        self.isdbt_subset_of_carriers_0 = isdbt.subset_of_carriers(
            data_carriers, 384, 4991)
        self.isdbt_ofdm_sym_acquisition_0 = isdbt.ofdm_sym_acquisition(
            total_carriers, int(guard * total_carriers), 10)
        self.isdbt_frequency_deinterleaver_0 = isdbt.frequency_deinterleaver(
            True, 3)
        self.isdbt_channel_decoding_0_0 = isdbt.isdbt_channel_decoding(
            layer_segments=1,
            mode=3,
            constellation_size=4,
            rate=1,
        )
        self.isdbt_channel_decoding_0 = isdbt.isdbt_channel_decoding(
            layer_segments=12,
            mode=3,
            constellation_size=64,
            rate=2,
        )
        self.fft_vxx_0 = fft.fft_vcc(total_carriers, True,
                                     (window.rectangular(total_carriers)),
                                     True, 1)
        self.blocks_vector_to_stream_0_2_1_0 = blocks.vector_to_stream(
            gr.sizeof_gr_complex * 1, C * 96 * 2**(mode - 1) + 1)
        self.blocks_vector_to_stream_0_2_1 = blocks.vector_to_stream(
            gr.sizeof_gr_complex * 1, 4608)
        self.blocks_vector_to_stream_0_2_0 = blocks.vector_to_stream(
            gr.sizeof_gr_complex * 1, data_carriers)
        self.blocks_vector_to_stream_0_2 = blocks.vector_to_stream(
            gr.sizeof_gr_complex * 1, A * 96 * 2**(mode - 1))
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1,
                                                 samp_rate, True)
        self.blocks_stream_to_vector_0_0_0 = blocks.stream_to_vector(
            gr.sizeof_char * 1, 188)
        self.blocks_stream_to_vector_0_0 = blocks.stream_to_vector(
            gr.sizeof_char * 1, 188)
        self.blocks_null_sink_0_0_0_0 = blocks.null_sink(gr.sizeof_char * 188)
        self.blocks_null_sink_0_0_0 = blocks.null_sink(gr.sizeof_char * 188)
        self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_char * 384)
        self.blocks_file_source_1_0 = blocks.file_source(
            gr.sizeof_gr_complex * 1,
            '/home/jordy/Descargas/569MHz_recording/569MHz_recording.dat',
            True)
        self.SYNC_0 = SYNC(
            guarda=guard,
            mode=mode,
        )
        self.MER_FULL_SEG_0 = MER_FULL_SEG(
            Modulation_Scheme_A=(1 + 1j, 1 - 1j, -1 + 1j, -1 - 1j) /
            np.sqrt(2),
            Modulation_Scheme_B=(
                7 + 7j, 7 + 5j, 5 + 7j, 5 + 5j, 7 + 1j, 7 + 3j, 5 + 1j, 5 + 3j,
                1 + 7j, 1 + 5j, 3 + 7j, 3 + 5j, 1 + 1j, 1 + 3j, 3 + 1j, 3 + 3j,
                7 - 7j, 7 - 5j, 5 - 7j, 5 - 5j, 7 - 1j, 7 - 3j, 5 - 1j, 5 - 3j,
                1 - 7j, 1 - 5j, 3 - 7j, 3 - 5j, 1 - 1j, 1 - 3j, 3 - 1j, 3 - 3j,
                -7 + 7j, -7 + 5j, -5 + 7j, -5 + 5j, -7 + 1j, -7 + 3j, -5 + 1j,
                -5 + 3j, -1 + 7j, -1 + 5j, -3 + 7j, -3 + 5j, -1 + 1j, -1 + 3j,
                -3 + 1j, -3 + 3j, -7 - 7j, -7 - 5j, -5 - 7j, -5 - 5j, -7 - 1j,
                -7 - 3j, -5 - 1j, -5 - 3j, -1 - 7j, -1 - 5j, -3 - 7j, -3 - 5j,
                -1 - 1j, -1 - 3j, -3 - 1j, -3 - 3j) / np.sqrt(42),
            Modulation_Scheme_C=(3 + 3j, 3 + 1j, 1 + 3j, 1 + 1j, 3 - 3j, 3 -
                                 1j, 1 - 3j, 1 - 1j, -3 + 3j, -3 + 1j, -1 + 3j,
                                 -1 + 1j, -3 - 3j, -3 - 1j, -1 - 3j, -1 - 1j) /
            np.sqrt(10),
            alpha=0.05,
        )

        ##################################################
        # Connections
        ##################################################
        self.connect((self.MER_FULL_SEG_0, 0), (self.qtgui_number_sink_0, 0))
        self.connect((self.MER_FULL_SEG_0, 1), (self.qtgui_number_sink_0_1, 0))
        self.connect((self.SYNC_0, 0), (self.qtgui_time_sink_x_0, 0))
        self.connect((self.blocks_file_source_1_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.blocks_stream_to_vector_0_0, 0),
                     (self.blocks_null_sink_0_0_0, 0))
        self.connect((self.blocks_stream_to_vector_0_0_0, 0),
                     (self.blocks_null_sink_0_0_0_0, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.low_pass_filter_0_0, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.qtgui_freq_sink_x_0, 0))
        self.connect((self.blocks_vector_to_stream_0_2, 0),
                     (self.MER_FULL_SEG_0, 0))
        self.connect((self.blocks_vector_to_stream_0_2, 0),
                     (self.qtgui_const_sink_x_0, 0))
        self.connect((self.blocks_vector_to_stream_0_2_0, 0),
                     (self.qtgui_const_sink_x_0_0, 0))
        self.connect((self.blocks_vector_to_stream_0_2_1, 0),
                     (self.MER_FULL_SEG_0, 1))
        self.connect((self.blocks_vector_to_stream_0_2_1, 0),
                     (self.qtgui_const_sink_x_0_1, 0))
        self.connect((self.blocks_vector_to_stream_0_2_1_0, 0),
                     (self.MER_FULL_SEG_0, 2))
        self.connect((self.blocks_vector_to_stream_0_2_1_0, 0),
                     (self.qtgui_const_sink_x_0_1_0, 0))
        self.connect((self.fft_vxx_0, 0),
                     (self.isdbt_sync_and_channel_estimation_0, 0))
        self.connect((self.isdbt_channel_decoding_0, 0),
                     (self.blocks_stream_to_vector_0_0, 0))
        self.connect((self.isdbt_channel_decoding_0, 1),
                     (self.qtgui_number_sink_0_0_0_0, 0))
        self.connect((self.isdbt_channel_decoding_0, 2),
                     (self.qtgui_number_sink_0_0_1, 0))
        self.connect((self.isdbt_channel_decoding_0_0, 0),
                     (self.blocks_stream_to_vector_0_0_0, 0))
        self.connect((self.isdbt_channel_decoding_0_0, 1),
                     (self.qtgui_number_sink_0_0_0_0_0, 0))
        self.connect((self.isdbt_channel_decoding_0_0, 2),
                     (self.qtgui_number_sink_0_0_1_0, 0))
        self.connect((self.isdbt_frequency_deinterleaver_0, 0),
                     (self.isdbt_time_deinterleaver_0, 0))
        self.connect((self.isdbt_ofdm_sym_acquisition_0, 0),
                     (self.fft_vxx_0, 0))
        self.connect((self.isdbt_subset_of_carriers_0, 0),
                     (self.blocks_vector_to_stream_0_2_1, 0))
        self.connect((self.isdbt_subset_of_carriers_0_0, 0),
                     (self.blocks_vector_to_stream_0_2, 0))
        self.connect((self.isdbt_subset_of_carriers_0_0_0, 0),
                     (self.blocks_vector_to_stream_0_2_1_0, 0))
        self.connect((self.isdbt_symbol_demapper_0, 0),
                     (self.blocks_null_sink_0, 0))
        self.connect((self.isdbt_symbol_demapper_0, 1),
                     (self.isdbt_channel_decoding_0, 0))
        self.connect((self.isdbt_symbol_demapper_0, 0),
                     (self.isdbt_channel_decoding_0_0, 0))
        self.connect((self.isdbt_sync_and_channel_estimation_0, 0),
                     (self.isdbt_tmcc_decoder_0, 0))
        self.connect((self.isdbt_time_deinterleaver_0, 0),
                     (self.blocks_vector_to_stream_0_2_0, 0))
        self.connect((self.isdbt_time_deinterleaver_0, 0),
                     (self.isdbt_subset_of_carriers_0, 0))
        self.connect((self.isdbt_time_deinterleaver_0, 0),
                     (self.isdbt_subset_of_carriers_0_0, 0))
        self.connect((self.isdbt_time_deinterleaver_0, 0),
                     (self.isdbt_subset_of_carriers_0_0_0, 0))
        self.connect((self.isdbt_time_deinterleaver_0, 0),
                     (self.isdbt_symbol_demapper_0, 0))
        self.connect((self.isdbt_tmcc_decoder_0, 0),
                     (self.isdbt_frequency_deinterleaver_0, 0))
        self.connect((self.low_pass_filter_0_0, 0), (self.SYNC_0, 0))
        self.connect((self.low_pass_filter_0_0, 0),
                     (self.isdbt_ofdm_sym_acquisition_0, 0))
Exemple #6
0
    def __init__(self, fft_size=4096):
        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())

        ##################################################
        # Parameters
        ##################################################
        self.fft_size = fft_size

        ##################################################
        # Variables
        ##################################################
        self.mode = mode = 2
        self.freq = freq = 551e6

        ##################################################
        # Blocks
        ##################################################
        self.qtgui_const_sink_x_0_1_0_0_0_1 = qtgui.const_sink_c(
            4096,  #size
            "Time Denint OUT",  #name
            1  #number of inputs
        )
        self.qtgui_const_sink_x_0_1_0_0_0_1.set_update_time(0.1)
        self.qtgui_const_sink_x_0_1_0_0_0_1.set_y_axis(-2, 2)
        self.qtgui_const_sink_x_0_1_0_0_0_1.set_x_axis(-2, 2)
        self.qtgui_const_sink_x_0_1_0_0_0_1.set_trigger_mode(
            qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "")
        self.qtgui_const_sink_x_0_1_0_0_0_1.enable_autoscale(False)
        self.qtgui_const_sink_x_0_1_0_0_0_1.enable_grid(True)
        self.qtgui_const_sink_x_0_1_0_0_0_1.enable_axis_labels(True)

        if not True:
            self.qtgui_const_sink_x_0_1_0_0_0_1.disable_legend()

        labels = ['', '', '', '', '', '', '', '', '', '']
        widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
        colors = [
            "blue", "red", "red", "red", "red", "red", "red", "red", "red",
            "red"
        ]
        styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        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_const_sink_x_0_1_0_0_0_1.set_line_label(
                    i, "Data {0}".format(i))
            else:
                self.qtgui_const_sink_x_0_1_0_0_0_1.set_line_label(
                    i, labels[i])
            self.qtgui_const_sink_x_0_1_0_0_0_1.set_line_width(i, widths[i])
            self.qtgui_const_sink_x_0_1_0_0_0_1.set_line_color(i, colors[i])
            self.qtgui_const_sink_x_0_1_0_0_0_1.set_line_style(i, styles[i])
            self.qtgui_const_sink_x_0_1_0_0_0_1.set_line_marker(i, markers[i])
            self.qtgui_const_sink_x_0_1_0_0_0_1.set_line_alpha(i, alphas[i])

        self._qtgui_const_sink_x_0_1_0_0_0_1_win = sip.wrapinstance(
            self.qtgui_const_sink_x_0_1_0_0_0_1.pyqwidget(), Qt.QWidget)
        self.top_layout.addWidget(self._qtgui_const_sink_x_0_1_0_0_0_1_win)
        self.isdbt_viterbi_decoder_0_1 = isdbt.viterbi_decoder(64, 0)
        self.isdbt_viterbi_decoder_0_0 = isdbt.viterbi_decoder(64, 0)
        self.isdbt_viterbi_decoder_0 = isdbt.viterbi_decoder(64, 0)
        self.isdbt_tsp_resize_0_0_0 = isdbt.tsp_resize()
        self.isdbt_tsp_resize_0_0 = isdbt.tsp_resize()
        self.isdbt_tsp_resize_0 = isdbt.tsp_resize()
        self.isdbt_tmcc_decoder_0 = isdbt.tmcc_decoder(2, False)
        self.isdbt_time_interleaver_0 = isdbt.time_interleaver(2, 8, True)
        self.isdbt_time_deinterleaver_0 = isdbt.time_deinterleaver(
            2, 1, 8, 6, 8, 6, 8)
        self.isdbt_symbol_demapper_0 = isdbt.symbol_demapper(
            2, 1, 64, 6, 64, 6, 64)
        self.isdbt_reed_solomon_dec_isdbt_0_1 = isdbt.reed_solomon_dec_isdbt()
        self.isdbt_reed_solomon_dec_isdbt_0_0 = isdbt.reed_solomon_dec_isdbt()
        self.isdbt_reed_solomon_dec_isdbt_0 = isdbt.reed_solomon_dec_isdbt()
        self.isdbt_ofdm_synchronization_0 = isdbt.ofdm_synchronization(
            2, 0.125, False)
        self.isdbt_ofdm_frame_structure_0 = isdbt.ofdm_frame_structure(
            2, True, 3, 3, 3, 0, 0, 0, 8, 8, 8, 1, 6, 6)
        self.isdbt_mapper_0_0_0 = isdbt.mapper(2, 6, 6)
        self.isdbt_mapper_0_0 = isdbt.mapper(2, 6, 6)
        self.isdbt_mapper_0 = isdbt.mapper(2, 6, 1)
        self.isdbt_hierarchical_divisor_0 = isdbt.hierarchical_divisor()
        self.isdbt_hierarchical_combination_0 = isdbt.hierarchical_combination(
            2, 1, 6, 6)
        self.isdbt_frequency_deinterleaver_0 = isdbt.frequency_deinterleaver(
            False, 2)
        self.isdbt_frec_interleaver_0 = isdbt.frec_interleaver(2, True)
        self.isdbt_energy_dispersal_0_0_0 = isdbt.energy_dispersal()
        self.isdbt_energy_dispersal_0_0 = isdbt.energy_dispersal()
        self.isdbt_energy_dispersal_0 = isdbt.energy_dispersal()
        self.isdbt_energy_descrambler_0_1 = isdbt.energy_descrambler()
        self.isdbt_energy_descrambler_0_0 = isdbt.energy_descrambler()
        self.isdbt_energy_descrambler_0 = isdbt.energy_descrambler()
        self.isdbt_byte_interleaver_0_0_0 = isdbt.byte_interleaver(2, 0, 6, 6)
        self.isdbt_byte_interleaver_0_0 = isdbt.byte_interleaver(2, 0, 6, 6)
        self.isdbt_byte_interleaver_0 = isdbt.byte_interleaver(2, 0, 6, 1)
        self.isdbt_byte_deinterleaver_0_1 = isdbt.byte_deinterleaver()
        self.isdbt_byte_deinterleaver_0_0 = isdbt.byte_deinterleaver()
        self.isdbt_byte_deinterleaver_0 = isdbt.byte_deinterleaver()
        self.isdbt_bit_deinterleaver_0_1 = isdbt.bit_deinterleaver(2, 6, 64)
        self.isdbt_bit_deinterleaver_0_0 = isdbt.bit_deinterleaver(2, 6, 64)
        self.isdbt_bit_deinterleaver_0 = isdbt.bit_deinterleaver(2, 1, 64)
        self.fft_vxx_0 = fft.fft_vcc(fft_size, False,
                                     (window.blackmanharris(fft_size)), True,
                                     1)
        self.dtv_dvbt_reed_solomon_enc_0_0_0 = dtv.dvbt_reed_solomon_enc(
            2, 8, 0x11d, 255, 239, 8, 51, 1)
        self.dtv_dvbt_reed_solomon_enc_0_0 = dtv.dvbt_reed_solomon_enc(
            2, 8, 0x11d, 255, 239, 8, 51, 1)
        self.dtv_dvbt_reed_solomon_enc_0 = dtv.dvbt_reed_solomon_enc(
            2, 8, 0x11d, 255, 239, 8, 51, 1)
        self.dtv_dvbt_inner_coder_0_0_0 = dtv.dvbt_inner_coder(
            1, 1512, dtv.MOD_64QAM, dtv.ALPHA2, dtv.C1_2)
        self.dtv_dvbt_inner_coder_0_0 = dtv.dvbt_inner_coder(
            1, 1512, dtv.MOD_64QAM, dtv.ALPHA2, dtv.C1_2)
        self.dtv_dvbt_inner_coder_0 = dtv.dvbt_inner_coder(
            1, 1512, dtv.MOD_64QAM, dtv.ALPHA2, dtv.C1_2)
        self.digital_ofdm_cyclic_prefixer_0 = digital.ofdm_cyclic_prefixer(
            4096, 4096 + 512, 0, "")
        self.blocks_vector_to_stream_1_2_0_0_0_0_0 = blocks.vector_to_stream(
            gr.sizeof_gr_complex * 1, 192 * 13)
        self.blocks_vector_to_stream_0_1_0_1_1 = blocks.vector_to_stream(
            gr.sizeof_char * 1, 204)
        self.blocks_vector_to_stream_0_1_0_1_0 = blocks.vector_to_stream(
            gr.sizeof_char * 1, 204)
        self.blocks_vector_to_stream_0_1_0_1 = blocks.vector_to_stream(
            gr.sizeof_char * 1, 204)
        self.blocks_vector_to_stream_0_1_0_0 = blocks.vector_to_stream(
            gr.sizeof_char * 204, 756)
        self.blocks_vector_to_stream_0_1_0 = blocks.vector_to_stream(
            gr.sizeof_char * 204, 756)
        self.blocks_vector_to_stream_0_1 = blocks.vector_to_stream(
            gr.sizeof_char * 204, 126)
        self.blocks_vector_to_stream_0_0_1_0 = blocks.vector_to_stream(
            gr.sizeof_char * 1, 204)
        self.blocks_vector_to_stream_0_0_1 = blocks.vector_to_stream(
            gr.sizeof_char * 1, 204)
        self.blocks_vector_to_stream_0_0_0_0_0 = blocks.vector_to_stream(
            gr.sizeof_char * 1, 1512)
        self.blocks_vector_to_stream_0_0_0_0 = blocks.vector_to_stream(
            gr.sizeof_char * 1, 1512)
        self.blocks_vector_to_stream_0_0_0 = blocks.vector_to_stream(
            gr.sizeof_char * 1, 1512)
        self.blocks_vector_to_stream_0_0 = blocks.vector_to_stream(
            gr.sizeof_char * 1, 204)
        self.blocks_unpacked_to_packed_xx_0_1 = blocks.unpacked_to_packed_bb(
            6, gr.GR_LSB_FIRST)
        self.blocks_unpacked_to_packed_xx_0_0 = blocks.unpacked_to_packed_bb(
            6, gr.GR_LSB_FIRST)
        self.blocks_unpacked_to_packed_xx_0 = blocks.unpacked_to_packed_bb(
            6, gr.GR_LSB_FIRST)
        self.blocks_throttle_0_0 = blocks.throttle(gr.sizeof_gr_complex * 1,
                                                   512 / 63e-6, True)
        self.blocks_tag_debug_0 = blocks.tag_debug(gr.sizeof_char * 204,
                                                   'LayA', "frame_begin")
        self.blocks_tag_debug_0.set_display(True)
        self.blocks_stream_to_vector_0_1 = blocks.stream_to_vector(
            gr.sizeof_gr_complex * 1, 192 * 6)
        self.blocks_stream_to_vector_0_0 = blocks.stream_to_vector(
            gr.sizeof_gr_complex * 1, 192 * 6)
        self.blocks_stream_to_vector_0 = blocks.stream_to_vector(
            gr.sizeof_gr_complex * 1, 192 * 1)
        self.blocks_packed_to_unpacked_xx_0_0_0 = blocks.packed_to_unpacked_bb(
            6, gr.GR_LSB_FIRST)
        self.blocks_packed_to_unpacked_xx_0_0 = blocks.packed_to_unpacked_bb(
            6, gr.GR_LSB_FIRST)
        self.blocks_packed_to_unpacked_xx_0 = blocks.packed_to_unpacked_bb(
            6, gr.GR_LSB_FIRST)
        self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vcc((0.01, ))
        self.blocks_file_source_0 = blocks.file_source(
            gr.sizeof_char * 204 * 2304,
            '/home/habbo/Documents/BTS_Validos/BTS_ISDB_T_3_CAPAS.ts', False)
        self.blocks_file_sink_0_1 = blocks.file_sink(
            gr.sizeof_char * 188,
            '/home/habbo/Documents/PruebasISDBT/Salidas/Layer_C.ts', False)
        self.blocks_file_sink_0_1.set_unbuffered(False)
        self.blocks_file_sink_0_0_0_2 = blocks.file_sink(
            gr.sizeof_char * 1,
            '/home/habbo/Documents/PruebasISDBT/Salidas/fs__VDin_layA.ts',
            False)
        self.blocks_file_sink_0_0_0_2.set_unbuffered(False)
        self.blocks_file_sink_0_0_0_1_0 = blocks.file_sink(
            gr.sizeof_char * 1,
            '/home/habbo/Documents/PruebasISDBT/Salidas/fs__VDin_layC.ts',
            False)
        self.blocks_file_sink_0_0_0_1_0.set_unbuffered(False)
        self.blocks_file_sink_0_0_0_1 = blocks.file_sink(
            gr.sizeof_char * 1,
            '/home/habbo/Documents/PruebasISDBT/Salidas/fs__RSin_layC.ts',
            False)
        self.blocks_file_sink_0_0_0_1.set_unbuffered(False)
        self.blocks_file_sink_0_0_0_0_0 = blocks.file_sink(
            gr.sizeof_char * 1,
            '/home/habbo/Documents/PruebasISDBT/Salidas/fs__VDin_layB.ts',
            False)
        self.blocks_file_sink_0_0_0_0_0.set_unbuffered(False)
        self.blocks_file_sink_0_0_0_0 = blocks.file_sink(
            gr.sizeof_char * 1,
            '/home/habbo/Documents/PruebasISDBT/Salidas/fs__RSin_layB.ts',
            False)
        self.blocks_file_sink_0_0_0_0.set_unbuffered(False)
        self.blocks_file_sink_0_0_0 = blocks.file_sink(
            gr.sizeof_char * 1,
            '/home/habbo/Documents/PruebasISDBT/Salidas/fs__RSin_layA.ts',
            False)
        self.blocks_file_sink_0_0_0.set_unbuffered(False)
        self.blocks_file_sink_0_0 = blocks.file_sink(
            gr.sizeof_char * 188,
            '/home/habbo/Documents/PruebasISDBT/Salidas/Layer_B.ts', False)
        self.blocks_file_sink_0_0.set_unbuffered(False)
        self.blocks_file_sink_0 = blocks.file_sink(
            gr.sizeof_char * 188,
            '/home/habbo/Documents/PruebasISDBT/Salidas/Layer_A.ts', False)
        self.blocks_file_sink_0.set_unbuffered(False)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.blocks_file_source_0, 0),
                     (self.isdbt_hierarchical_divisor_0, 0))
        self.connect((self.blocks_multiply_const_vxx_0, 0),
                     (self.blocks_throttle_0_0, 0))
        self.connect((self.blocks_packed_to_unpacked_xx_0, 0),
                     (self.isdbt_mapper_0, 0))
        self.connect((self.blocks_packed_to_unpacked_xx_0_0, 0),
                     (self.isdbt_mapper_0_0, 0))
        self.connect((self.blocks_packed_to_unpacked_xx_0_0_0, 0),
                     (self.isdbt_mapper_0_0_0, 0))
        self.connect((self.blocks_stream_to_vector_0, 0),
                     (self.isdbt_hierarchical_combination_0, 0))
        self.connect((self.blocks_stream_to_vector_0_0, 0),
                     (self.isdbt_hierarchical_combination_0, 1))
        self.connect((self.blocks_stream_to_vector_0_1, 0),
                     (self.isdbt_hierarchical_combination_0, 2))
        self.connect((self.blocks_throttle_0_0, 0),
                     (self.isdbt_ofdm_synchronization_0, 0))
        self.connect((self.blocks_unpacked_to_packed_xx_0, 0),
                     (self.blocks_file_sink_0_0_0_2, 0))
        self.connect((self.blocks_unpacked_to_packed_xx_0, 0),
                     (self.isdbt_viterbi_decoder_0, 0))
        self.connect((self.blocks_unpacked_to_packed_xx_0_0, 0),
                     (self.blocks_file_sink_0_0_0_0_0, 0))
        self.connect((self.blocks_unpacked_to_packed_xx_0_0, 0),
                     (self.isdbt_viterbi_decoder_0_0, 0))
        self.connect((self.blocks_unpacked_to_packed_xx_0_1, 0),
                     (self.blocks_file_sink_0_0_0_1_0, 0))
        self.connect((self.blocks_unpacked_to_packed_xx_0_1, 0),
                     (self.isdbt_viterbi_decoder_0_1, 0))
        self.connect((self.blocks_vector_to_stream_0_0, 0),
                     (self.dtv_dvbt_inner_coder_0, 0))
        self.connect((self.blocks_vector_to_stream_0_0_0, 0),
                     (self.blocks_packed_to_unpacked_xx_0, 0))
        self.connect((self.blocks_vector_to_stream_0_0_0_0, 0),
                     (self.blocks_packed_to_unpacked_xx_0_0, 0))
        self.connect((self.blocks_vector_to_stream_0_0_0_0_0, 0),
                     (self.blocks_packed_to_unpacked_xx_0_0_0, 0))
        self.connect((self.blocks_vector_to_stream_0_0_1, 0),
                     (self.dtv_dvbt_inner_coder_0_0, 0))
        self.connect((self.blocks_vector_to_stream_0_0_1_0, 0),
                     (self.dtv_dvbt_inner_coder_0_0_0, 0))
        self.connect((self.blocks_vector_to_stream_0_1, 0),
                     (self.isdbt_tsp_resize_0, 0))
        self.connect((self.blocks_vector_to_stream_0_1_0, 0),
                     (self.isdbt_tsp_resize_0_0, 0))
        self.connect((self.blocks_vector_to_stream_0_1_0_0, 0),
                     (self.isdbt_tsp_resize_0_0_0, 0))
        self.connect((self.blocks_vector_to_stream_0_1_0_1, 0),
                     (self.blocks_file_sink_0_0_0, 0))
        self.connect((self.blocks_vector_to_stream_0_1_0_1_0, 0),
                     (self.blocks_file_sink_0_0_0_0, 0))
        self.connect((self.blocks_vector_to_stream_0_1_0_1_1, 0),
                     (self.blocks_file_sink_0_0_0_1, 0))
        self.connect((self.blocks_vector_to_stream_1_2_0_0_0_0_0, 0),
                     (self.qtgui_const_sink_x_0_1_0_0_0_1, 0))
        self.connect((self.digital_ofdm_cyclic_prefixer_0, 0),
                     (self.blocks_multiply_const_vxx_0, 0))
        self.connect((self.dtv_dvbt_inner_coder_0, 0),
                     (self.blocks_vector_to_stream_0_0_0, 0))
        self.connect((self.dtv_dvbt_inner_coder_0_0, 0),
                     (self.blocks_vector_to_stream_0_0_0_0, 0))
        self.connect((self.dtv_dvbt_inner_coder_0_0_0, 0),
                     (self.blocks_vector_to_stream_0_0_0_0_0, 0))
        self.connect((self.dtv_dvbt_reed_solomon_enc_0, 0),
                     (self.isdbt_energy_dispersal_0, 0))
        self.connect((self.dtv_dvbt_reed_solomon_enc_0_0, 0),
                     (self.isdbt_energy_dispersal_0_0, 0))
        self.connect((self.dtv_dvbt_reed_solomon_enc_0_0_0, 0),
                     (self.isdbt_energy_dispersal_0_0_0, 0))
        self.connect((self.fft_vxx_0, 0),
                     (self.digital_ofdm_cyclic_prefixer_0, 0))
        self.connect((self.isdbt_bit_deinterleaver_0, 0),
                     (self.blocks_unpacked_to_packed_xx_0, 0))
        self.connect((self.isdbt_bit_deinterleaver_0_0, 0),
                     (self.blocks_unpacked_to_packed_xx_0_0, 0))
        self.connect((self.isdbt_bit_deinterleaver_0_1, 0),
                     (self.blocks_unpacked_to_packed_xx_0_1, 0))
        self.connect((self.isdbt_byte_deinterleaver_0, 0),
                     (self.blocks_tag_debug_0, 0))
        self.connect((self.isdbt_byte_deinterleaver_0, 0),
                     (self.isdbt_energy_descrambler_0, 0))
        self.connect((self.isdbt_byte_deinterleaver_0_0, 0),
                     (self.isdbt_energy_descrambler_0_0, 0))
        self.connect((self.isdbt_byte_deinterleaver_0_1, 0),
                     (self.isdbt_energy_descrambler_0_1, 0))
        self.connect((self.isdbt_byte_interleaver_0, 0),
                     (self.blocks_vector_to_stream_0_0, 0))
        self.connect((self.isdbt_byte_interleaver_0_0, 0),
                     (self.blocks_vector_to_stream_0_0_1, 0))
        self.connect((self.isdbt_byte_interleaver_0_0_0, 0),
                     (self.blocks_vector_to_stream_0_0_1_0, 0))
        self.connect((self.isdbt_energy_descrambler_0, 0),
                     (self.blocks_vector_to_stream_0_1_0_1, 0))
        self.connect((self.isdbt_energy_descrambler_0, 0),
                     (self.isdbt_reed_solomon_dec_isdbt_0, 0))
        self.connect((self.isdbt_energy_descrambler_0_0, 0),
                     (self.blocks_vector_to_stream_0_1_0_1_0, 0))
        self.connect((self.isdbt_energy_descrambler_0_0, 0),
                     (self.isdbt_reed_solomon_dec_isdbt_0_0, 0))
        self.connect((self.isdbt_energy_descrambler_0_1, 0),
                     (self.blocks_vector_to_stream_0_1_0_1_1, 0))
        self.connect((self.isdbt_energy_descrambler_0_1, 0),
                     (self.isdbt_reed_solomon_dec_isdbt_0_1, 0))
        self.connect((self.isdbt_energy_dispersal_0, 0),
                     (self.isdbt_byte_interleaver_0, 0))
        self.connect((self.isdbt_energy_dispersal_0_0, 0),
                     (self.isdbt_byte_interleaver_0_0, 0))
        self.connect((self.isdbt_energy_dispersal_0_0_0, 0),
                     (self.isdbt_byte_interleaver_0_0_0, 0))
        self.connect((self.isdbt_frec_interleaver_0, 0),
                     (self.isdbt_ofdm_frame_structure_0, 0))
        self.connect((self.isdbt_frequency_deinterleaver_0, 0),
                     (self.isdbt_time_deinterleaver_0, 0))
        self.connect((self.isdbt_hierarchical_combination_0, 0),
                     (self.isdbt_time_interleaver_0, 0))
        self.connect((self.isdbt_hierarchical_divisor_0, 0),
                     (self.blocks_vector_to_stream_0_1, 0))
        self.connect((self.isdbt_hierarchical_divisor_0, 1),
                     (self.blocks_vector_to_stream_0_1_0, 0))
        self.connect((self.isdbt_hierarchical_divisor_0, 2),
                     (self.blocks_vector_to_stream_0_1_0_0, 0))
        self.connect((self.isdbt_mapper_0, 0),
                     (self.blocks_stream_to_vector_0, 0))
        self.connect((self.isdbt_mapper_0_0, 0),
                     (self.blocks_stream_to_vector_0_0, 0))
        self.connect((self.isdbt_mapper_0_0_0, 0),
                     (self.blocks_stream_to_vector_0_1, 0))
        self.connect((self.isdbt_ofdm_frame_structure_0, 0),
                     (self.fft_vxx_0, 0))
        self.connect((self.isdbt_ofdm_synchronization_0, 0),
                     (self.isdbt_tmcc_decoder_0, 0))
        self.connect((self.isdbt_reed_solomon_dec_isdbt_0, 0),
                     (self.blocks_file_sink_0, 0))
        self.connect((self.isdbt_reed_solomon_dec_isdbt_0_0, 0),
                     (self.blocks_file_sink_0_0, 0))
        self.connect((self.isdbt_reed_solomon_dec_isdbt_0_1, 0),
                     (self.blocks_file_sink_0_1, 0))
        self.connect((self.isdbt_symbol_demapper_0, 0),
                     (self.isdbt_bit_deinterleaver_0, 0))
        self.connect((self.isdbt_symbol_demapper_0, 1),
                     (self.isdbt_bit_deinterleaver_0_0, 0))
        self.connect((self.isdbt_symbol_demapper_0, 2),
                     (self.isdbt_bit_deinterleaver_0_1, 0))
        self.connect((self.isdbt_time_deinterleaver_0, 0),
                     (self.blocks_vector_to_stream_1_2_0_0_0_0_0, 0))
        self.connect((self.isdbt_time_deinterleaver_0, 0),
                     (self.isdbt_symbol_demapper_0, 0))
        self.connect((self.isdbt_time_interleaver_0, 0),
                     (self.isdbt_frec_interleaver_0, 0))
        self.connect((self.isdbt_tmcc_decoder_0, 0),
                     (self.isdbt_frequency_deinterleaver_0, 0))
        self.connect((self.isdbt_tsp_resize_0, 0),
                     (self.dtv_dvbt_reed_solomon_enc_0, 0))
        self.connect((self.isdbt_tsp_resize_0_0, 0),
                     (self.dtv_dvbt_reed_solomon_enc_0_0, 0))
        self.connect((self.isdbt_tsp_resize_0_0_0, 0),
                     (self.dtv_dvbt_reed_solomon_enc_0_0_0, 0))
        self.connect((self.isdbt_viterbi_decoder_0, 0),
                     (self.isdbt_byte_deinterleaver_0, 0))
        self.connect((self.isdbt_viterbi_decoder_0_0, 0),
                     (self.isdbt_byte_deinterleaver_0_0, 0))
        self.connect((self.isdbt_viterbi_decoder_0_1, 0),
                     (self.isdbt_byte_deinterleaver_0_1, 0))