def __init__(self, syncword="1ACFFC1D"):
        gr.top_block.__init__(self, "Turbo Verification V4")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Turbo Verification V4")
        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", "turbo_verification_v4")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Parameters
        ##################################################
        self.syncword = syncword

        ##################################################
        # Variables
        ##################################################
        self.vcdu_size = vcdu_size = 223 - 10
        self.value = value = [0, 1]
        self.symbol = symbol = [-1, 1]
        self.scramble = scramble = 0
        self.samp_rate = samp_rate = 2e6
        self.reset = reset = vcdu_size
        self.frame_size = frame_size = vcdu_size + 10
        self.Rc = Rc = 0.25

        ##################################################
        # Blocks
        ##################################################
        self.tdd_nullMsgSink_0 = tdd.nullMsgSink(1)
        self.tdd_ferMsgGen_0 = tdd.ferMsgGen(vcdu_size, 'cadu_len', 'vcdu_len')
        self.tdd_ferMsgCount_0 = tdd.ferMsgCount(0, 0, 0)
        self.mapper_prbs_source_b_0 = mapper.prbs_source_b("PRBS31", reset * 8)
        self.mapper_prbs_sink_b_0 = mapper.prbs_sink_b("PRBS31", reset * 8)
        self.digital_map_bb_0_0 = digital.map_bb((-1, 1))
        self.ccsds_synchronizeCADUSoft_0 = ccsds.synchronizeCADUSoft(
            '1ACFFC1D', 1, 7, 2, 7152 + 32, 0, 0, 'syncsoft')
        self.ccsds_recoverCADUSoft_0 = ccsds.recoverCADUSoft(
            7152, 0, 'syncsoft')
        self.ccsds_encodeTurbo_0 = ccsds.encodeTurbo(frame_size, 4, 'cadu_len')
        self.ccsds_decodeTurbo_0 = ccsds.decodeTurbo(223, 1, 4, 1, 0.707, 0)
        self.ccsds_createCADU_0 = ccsds.createCADU(
            int(frame_size / Rc) + 2, '1ACFFC1D', 0, 'xx_len')
        self.blocks_unpack_k_bits_bb_1 = blocks.unpack_k_bits_bb(8)
        self.blocks_unpack_k_bits_bb_0 = blocks.unpack_k_bits_bb(8)
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_char * 1, samp_rate,
                                                 True)
        self.blocks_tag_debug_1 = blocks.tag_debug(gr.sizeof_float * 1, '', "")
        self.blocks_tag_debug_1.set_display(False)
        self.blocks_stream_to_tagged_stream_0_0 = blocks.stream_to_tagged_stream(
            gr.sizeof_char, 1,
            int(frame_size / Rc) + 2, "xx_len")
        self.blocks_stream_to_tagged_stream_0 = blocks.stream_to_tagged_stream(
            gr.sizeof_char, 1, vcdu_size, "vcdu_len")
        self.blocks_pdu_to_tagged_stream_0_1 = blocks.pdu_to_tagged_stream(
            blocks.byte_t, 'packet_len')
        self.blocks_pack_k_bits_bb_0 = blocks.pack_k_bits_bb(8)
        self.blocks_char_to_float_0_0 = blocks.char_to_float(1, 1.0)

        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.ccsds_decodeTurbo_0, 'out'),
                         (self.tdd_ferMsgCount_0, 'in'))
        self.msg_connect((self.ccsds_decodeTurbo_0, 'out'),
                         (self.tdd_nullMsgSink_0, 'in'))
        self.msg_connect((self.ccsds_recoverCADUSoft_0, 'cadu'),
                         (self.ccsds_decodeTurbo_0, 'in'))
        self.msg_connect((self.tdd_ferMsgCount_0, 'out'),
                         (self.blocks_pdu_to_tagged_stream_0_1, 'pdus'))
        self.msg_connect((self.tdd_ferMsgCount_0, 'out'),
                         (self.tdd_nullMsgSink_0, 'in'))
        self.connect((self.blocks_char_to_float_0_0, 0),
                     (self.ccsds_synchronizeCADUSoft_0, 0))
        self.connect((self.blocks_pack_k_bits_bb_0, 0),
                     (self.blocks_stream_to_tagged_stream_0, 0))
        self.connect((self.blocks_pdu_to_tagged_stream_0_1, 0),
                     (self.blocks_unpack_k_bits_bb_1, 0))
        self.connect((self.blocks_stream_to_tagged_stream_0, 0),
                     (self.tdd_ferMsgGen_0, 0))
        self.connect((self.blocks_stream_to_tagged_stream_0_0, 0),
                     (self.ccsds_createCADU_0, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.blocks_pack_k_bits_bb_0, 0))
        self.connect((self.blocks_unpack_k_bits_bb_0, 0),
                     (self.digital_map_bb_0_0, 0))
        self.connect((self.blocks_unpack_k_bits_bb_1, 0),
                     (self.mapper_prbs_sink_b_0, 0))
        self.connect((self.ccsds_createCADU_0, 0),
                     (self.blocks_unpack_k_bits_bb_0, 0))
        self.connect((self.ccsds_encodeTurbo_0, 0),
                     (self.blocks_stream_to_tagged_stream_0_0, 0))
        self.connect((self.ccsds_synchronizeCADUSoft_0, 0),
                     (self.blocks_tag_debug_1, 0))
        self.connect((self.ccsds_synchronizeCADUSoft_0, 0),
                     (self.ccsds_recoverCADUSoft_0, 0))
        self.connect((self.digital_map_bb_0_0, 0),
                     (self.blocks_char_to_float_0_0, 0))
        self.connect((self.mapper_prbs_source_b_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.tdd_ferMsgGen_0, 0), (self.ccsds_encodeTurbo_0, 0))
Beispiel #2
0
    def __init__(self):
        gr.top_block.__init__(self, "Cadu Soft")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Cadu Soft")
        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", "cadu_soft")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Variables
        ##################################################
        self.symbol_rate = symbol_rate = 500e3
        self.sps = sps = 4
        self.samp_rate = samp_rate = symbol_rate * sps
        self.p = p = 0.1
        self.ntaps = ntaps = 20 * sps
        self.frame_size = frame_size = 501
        self.SNR = SNR = 10.0
        self.value = value = [0, 1]
        self.taps_2 = taps_2 = firdes.root_raised_cosine(
            1, samp_rate, (samp_rate / sps), 0.35, ntaps)

        self.taps = taps = firdes.root_raised_cosine(sps, samp_rate,
                                                     symbol_rate, 0.35, ntaps)

        self.symbol = symbol = [-1, 1]
        self.scramble = scramble = 0
        self.rs = rs = 0
        self.reset = reset = frame_size
        self.noise_original = noise_original = math.sqrt(
            (1) / math.pow(10, (SNR) / 10.0))
        self.linecode = linecode = 0
        self.intDepth = intDepth = 1

        self.decoder = decoder = fec.cc_decoder.make(
            (8068 - 52), 7, 2, ([79, 109]), 29, 6, fec.CC_TAILBITING, False)

        self.cfo = cfo = 0.00
        self.bn = bn = 2 * math.pi * (p / 100)

        ##################################################
        # Blocks
        ##################################################
        self.tdd_nullMsgSink_0 = tdd.nullMsgSink(1)
        self.qtgui_sink_x_0_0 = qtgui.sink_c(
            1024,  #fftsize
            firdes.WIN_BLACKMAN_hARRIS,  #wintype
            0,  #fc
            samp_rate / sps,  #bw
            "",  #name
            True,  #plotfreq
            True,  #plotwaterfall
            True,  #plottime
            True,  #plotconst
        )
        self.qtgui_sink_x_0_0.set_update_time(1.0 / 10)
        self._qtgui_sink_x_0_0_win = sip.wrapinstance(
            self.qtgui_sink_x_0_0.pyqwidget(), Qt.QWidget)
        self.top_layout.addWidget(self._qtgui_sink_x_0_0_win)

        self.qtgui_sink_x_0_0.enable_rf_freq(False)

        self.pcm_encodeNRZ_0 = pcm.encodeNRZ(linecode)
        self.mapper_prbs_source_b_0 = mapper.prbs_source_b("PRBS31", reset * 8)
        self.mapper_prbs_sink_b_0 = mapper.prbs_sink_b("PRBS31", reset * 8)
        self.fir_filter_xxx_0 = filter.fir_filter_ccc(sps, (taps))
        self.fir_filter_xxx_0.declare_sample_delay(0)
        self.fec_async_decoder_0 = fec.async_decoder(decoder, False, False,
                                                     8016)
        self.channel_phaseError_0 = channel.phaseError(135)
        self.channel_gsPhaseNoise_0 = channel.gsPhaseNoise(
            math.sqrt(samp_rate / 2), ([
                2.800000000000000e-06, -5.866548800000000e-06,
                3.064241879202000e-06
            ]),
            ([1, -2.555230500000000, 2.114073646727000, -0.558843141309031]))
        self.ccsds_synchronizeCADUSoft_0 = ccsds.synchronizeCADUSoft(
            '1ACFFC1D', 1, 7, 0, 52 + 8016, 1, 0, 'sync')
        self.ccsds_recoverCADUSoft_0 = ccsds.recoverCADUSoft(
            8068 - 52, 0, 'sync')
        self.ccsds_createCADU_0 = ccsds.createCADU(frame_size, '1ACFFC1D', 0,
                                                   'packet_len')
        self.ccsds_convEncoder_0 = ccsds.convEncoder(0)
        self.bpsk_bpskPulseshapeRRC_0 = bpsk.bpskPulseshapeRRC(
            sps, 1.0, samp_rate, samp_rate / (sps), 0.35, 40 * sps)
        self.bpsk_bpskPhaseRecovery_0 = bpsk.bpskPhaseRecovery(
            4, bn,
            math.sqrt(2) / 2, 2)
        self.bpsk_bpskIQMap_0 = bpsk.bpskIQMap()
        self.blocks_unpack_k_bits_bb_0 = blocks.unpack_k_bits_bb(8)
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_char * 1, samp_rate,
                                                 True)
        self.blocks_tag_debug_0 = blocks.tag_debug(gr.sizeof_float * 1, '',
                                                   "sync")
        self.blocks_tag_debug_0.set_display(False)
        self.blocks_stream_to_tagged_stream_0 = blocks.stream_to_tagged_stream(
            gr.sizeof_char, 1, frame_size, "packet_len")
        self.blocks_pdu_to_tagged_stream_0 = blocks.pdu_to_tagged_stream(
            blocks.byte_t, 'packet_len')
        self.blocks_pack_k_bits_bb_0 = blocks.pack_k_bits_bb(8)
        self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vcc((-1, ))
        self.blocks_complex_to_real_0 = blocks.complex_to_real(1)
        self.baseband_debug_channel_model_1_0 = baseband.debug_channel_model_1(
            noise_original / math.sqrt(sps), cfo, 1.0, (1.0, ), 0)

        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.ccsds_recoverCADUSoft_0, 'cadu'),
                         (self.fec_async_decoder_0, 'in'))
        self.msg_connect((self.fec_async_decoder_0, 'out'),
                         (self.blocks_pdu_to_tagged_stream_0, 'pdus'))
        self.msg_connect((self.fec_async_decoder_0, 'out'),
                         (self.tdd_nullMsgSink_0, 'in'))
        self.connect((self.baseband_debug_channel_model_1_0, 0),
                     (self.channel_gsPhaseNoise_0, 0))
        self.connect((self.blocks_complex_to_real_0, 0),
                     (self.ccsds_synchronizeCADUSoft_0, 0))
        self.connect((self.blocks_multiply_const_vxx_0, 0),
                     (self.blocks_complex_to_real_0, 0))
        self.connect((self.blocks_pack_k_bits_bb_0, 0),
                     (self.blocks_stream_to_tagged_stream_0, 0))
        self.connect((self.blocks_pdu_to_tagged_stream_0, 0),
                     (self.mapper_prbs_sink_b_0, 0))
        self.connect((self.blocks_stream_to_tagged_stream_0, 0),
                     (self.ccsds_createCADU_0, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.blocks_pack_k_bits_bb_0, 0))
        self.connect((self.blocks_unpack_k_bits_bb_0, 0),
                     (self.ccsds_convEncoder_0, 0))
        self.connect((self.bpsk_bpskIQMap_0, 0),
                     (self.channel_phaseError_0, 0))
        self.connect((self.bpsk_bpskPhaseRecovery_0, 0),
                     (self.blocks_multiply_const_vxx_0, 0))
        self.connect((self.bpsk_bpskPhaseRecovery_0, 0),
                     (self.qtgui_sink_x_0_0, 0))
        self.connect((self.bpsk_bpskPulseshapeRRC_0, 0),
                     (self.bpsk_bpskIQMap_0, 0))
        self.connect((self.ccsds_convEncoder_0, 0), (self.pcm_encodeNRZ_0, 0))
        self.connect((self.ccsds_createCADU_0, 0),
                     (self.blocks_unpack_k_bits_bb_0, 0))
        self.connect((self.ccsds_synchronizeCADUSoft_0, 0),
                     (self.blocks_tag_debug_0, 0))
        self.connect((self.ccsds_synchronizeCADUSoft_0, 0),
                     (self.ccsds_recoverCADUSoft_0, 0))
        self.connect((self.channel_gsPhaseNoise_0, 0),
                     (self.fir_filter_xxx_0, 0))
        self.connect((self.channel_phaseError_0, 0),
                     (self.baseband_debug_channel_model_1_0, 0))
        self.connect((self.fir_filter_xxx_0, 0),
                     (self.bpsk_bpskPhaseRecovery_0, 0))
        self.connect((self.mapper_prbs_source_b_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.pcm_encodeNRZ_0, 0),
                     (self.bpsk_bpskPulseshapeRRC_0, 0))
    def __init__(self, syncword="1ACFFC1D"):
        gr.top_block.__init__(self, "Turbo Verification V2")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Turbo Verification V2")
        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", "turbo_verification_v2")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Parameters
        ##################################################
        self.syncword = syncword

        ##################################################
        # Variables
        ##################################################
        self.symbol_rate = symbol_rate = 500e3
        self.sps = sps = 4
        self.vcdu_size = vcdu_size = 223 - 10
        self.samp_rate = samp_rate = symbol_rate * sps
        self.ntaps = ntaps = 40 * sps
        self.nfilts = nfilts = 32
        self.value = value = [0, 1]
        self.to = to = 0.0

        self.taps = taps = firdes.root_raised_cosine(sps, samp_rate,
                                                     symbol_rate, 0.35, ntaps)

        self.symbol = symbol = [-1, 1]
        self.scramble = scramble = 0
        self.rs = rs = 1
        self.reset = reset = vcdu_size
        self.polyphase_taps = polyphase_taps = firdes.root_raised_cosine(
            sps * nfilts, nfilts, 1.0 / float(sps), 0.35, 20 * sps * nfilts)
        self.parity = parity = 32
        self.linecode = linecode = 1
        self.intDepth = intDepth = 1
        self.frame_size = frame_size = vcdu_size + 10
        self.cfo = cfo = 0.25
        self.SNR = SNR = 2.5
        self.Rc = Rc = 0.5

        ##################################################
        # Blocks
        ##################################################
        self.tdd_ferMsgGen_0 = tdd.ferMsgGen(vcdu_size, 'cadu_len', 'vcdu_len')
        self.tdd_ferMsgCount_0 = tdd.ferMsgCount(0)
        self.qtgui_time_sink_x_0_0 = qtgui.time_sink_f(
            1024,  #size
            samp_rate,  #samp_rate
            "",  #name
            0  #number of inputs
        )
        self.qtgui_time_sink_x_0_0.set_update_time(0.10)
        self.qtgui_time_sink_x_0_0.set_y_axis(-1, 1)

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

        self.qtgui_time_sink_x_0_0.enable_tags(-1, True)
        self.qtgui_time_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE,
                                                    qtgui.TRIG_SLOPE_POS, 0.0,
                                                    0, 0, "")
        self.qtgui_time_sink_x_0_0.enable_autoscale(False)
        self.qtgui_time_sink_x_0_0.enable_grid(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 = ['', '', '', '', '', '', '', '', '', '']
        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_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.top_layout.addWidget(self._qtgui_time_sink_x_0_0_win)
        self.qtgui_time_sink_x_0 = qtgui.time_sink_f(
            1024,  #size
            samp_rate,  #samp_rate
            "",  #name
            0  #number of inputs
        )
        self.qtgui_time_sink_x_0.set_update_time(0.10)
        self.qtgui_time_sink_x_0.set_y_axis(-1, 1)

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

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

        if not True:
            self.qtgui_time_sink_x_0.disable_legend()

        labels = ['', '', '', '', '', '', '', '', '', '']
        widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
        colors = [
            "blue", "red", "green", "black", "cyan", "magenta", "yellow",
            "dark red", "dark green", "blue"
        ]
        styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
        markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
        alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]

        for i in xrange(1):
            if len(labels[i]) == 0:
                self.qtgui_time_sink_x_0.set_line_label(
                    i, "Data {0}".format(i))
            else:
                self.qtgui_time_sink_x_0.set_line_label(i, labels[i])
            self.qtgui_time_sink_x_0.set_line_width(i, widths[i])
            self.qtgui_time_sink_x_0.set_line_color(i, colors[i])
            self.qtgui_time_sink_x_0.set_line_style(i, styles[i])
            self.qtgui_time_sink_x_0.set_line_marker(i, markers[i])
            self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i])

        self._qtgui_time_sink_x_0_win = sip.wrapinstance(
            self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget)
        self.top_layout.addWidget(self._qtgui_time_sink_x_0_win)
        self.mapper_prbs_source_b_0 = mapper.prbs_source_b("PRBS31", reset * 8)
        self.mapper_prbs_sink_b_0 = mapper.prbs_sink_b("PRBS31", reset * 8)
        self.dslwp_frame_spliter_f_0 = dslwp.frame_spliter_f(
            'payload_start', 3576)
        self.dslwp_ccsds_turbo_decode_0 = dslwp.ccsds_turbo_decode(
            223, 1, 2, 1, 0.707, 1)
        self.digital_map_bb_0_0 = digital.map_bb((-1, 1))
        self.digital_map_bb_0 = digital.map_bb((-1, 1))
        self.ccsds_synchronizeCADU_0 = ccsds.synchronizeCADU(
            '1ACFFC1D', 0, "sync")
        self.ccsds_synchronizeCADUSoft_0 = ccsds.synchronizeCADUSoft(
            '1ACFFC1D', 0, 'syncsoft')
        self.ccsds_recoverCADU_1 = ccsds.recoverCADU(
            int(frame_size / Rc) + 1, scramble, 'sync')
        self.ccsds_recoverCADUSoft_0 = ccsds.recoverCADUSoft(
            int(frame_size / Rc) + 1, scramble, 'syncsoft')
        self.ccsds_encodeTurbo_0 = ccsds.encodeTurbo(frame_size, 2, 'cadu_len')
        self.ccsds_createCADU_0 = ccsds.createCADU(
            int(frame_size / Rc) + 1, '1ACFFC1D', scramble, 'xx_len')
        self.blocks_unpack_k_bits_bb_1 = blocks.unpack_k_bits_bb(8)
        self.blocks_unpack_k_bits_bb_0_0 = blocks.unpack_k_bits_bb(8)
        self.blocks_unpack_k_bits_bb_0 = blocks.unpack_k_bits_bb(8)
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_char * 1, samp_rate,
                                                 True)
        self.blocks_tag_debug_1 = blocks.tag_debug(gr.sizeof_float * 1, '',
                                                   "syncsoft")
        self.blocks_tag_debug_1.set_display(False)
        self.blocks_stream_to_tagged_stream_2 = blocks.stream_to_tagged_stream(
            gr.sizeof_float, 1, 3576, "payload_start")
        self.blocks_stream_to_tagged_stream_0_0 = blocks.stream_to_tagged_stream(
            gr.sizeof_char, 1,
            int(frame_size / Rc) + 1, "xx_len")
        self.blocks_stream_to_tagged_stream_0 = blocks.stream_to_tagged_stream(
            gr.sizeof_char, 1, vcdu_size, "vcdu_len")
        self.blocks_pdu_to_tagged_stream_0_1 = blocks.pdu_to_tagged_stream(
            blocks.byte_t, 'packet_len')
        self.blocks_pdu_to_tagged_stream_0_0 = blocks.pdu_to_tagged_stream(
            blocks.byte_t, 'packet_len')
        self.blocks_pack_k_bits_bb_0 = blocks.pack_k_bits_bb(8)
        self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_float * 1)
        self.blocks_char_to_float_0_0 = blocks.char_to_float(1, 1.0)
        self.blocks_char_to_float_0 = blocks.char_to_float(1, 1.0)

        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.ccsds_recoverCADUSoft_0, 'cadu'),
                         (self.dslwp_ccsds_turbo_decode_0, 'in'))
        self.msg_connect((self.ccsds_recoverCADUSoft_0, 'cadu'),
                         (self.qtgui_time_sink_x_0, 'in'))
        self.msg_connect((self.ccsds_recoverCADU_1, 'cadu'),
                         (self.blocks_pdu_to_tagged_stream_0_0, 'pdus'))
        self.msg_connect((self.dslwp_ccsds_turbo_decode_0, 'out'),
                         (self.tdd_ferMsgCount_0, 'in'))
        self.msg_connect((self.dslwp_frame_spliter_f_0, 'out'),
                         (self.qtgui_time_sink_x_0_0, 'in'))
        self.msg_connect((self.tdd_ferMsgCount_0, 'out'),
                         (self.blocks_pdu_to_tagged_stream_0_1, 'pdus'))
        self.connect((self.blocks_char_to_float_0, 0),
                     (self.blocks_stream_to_tagged_stream_2, 0))
        self.connect((self.blocks_char_to_float_0_0, 0),
                     (self.ccsds_synchronizeCADUSoft_0, 0))
        self.connect((self.blocks_pack_k_bits_bb_0, 0),
                     (self.blocks_stream_to_tagged_stream_0, 0))
        self.connect((self.blocks_pdu_to_tagged_stream_0_0, 0),
                     (self.blocks_unpack_k_bits_bb_0_0, 0))
        self.connect((self.blocks_pdu_to_tagged_stream_0_1, 0),
                     (self.blocks_unpack_k_bits_bb_1, 0))
        self.connect((self.blocks_stream_to_tagged_stream_0, 0),
                     (self.tdd_ferMsgGen_0, 0))
        self.connect((self.blocks_stream_to_tagged_stream_0_0, 0),
                     (self.ccsds_createCADU_0, 0))
        self.connect((self.blocks_stream_to_tagged_stream_2, 0),
                     (self.dslwp_frame_spliter_f_0, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.blocks_pack_k_bits_bb_0, 0))
        self.connect((self.blocks_unpack_k_bits_bb_0, 0),
                     (self.ccsds_synchronizeCADU_0, 0))
        self.connect((self.blocks_unpack_k_bits_bb_0, 0),
                     (self.digital_map_bb_0_0, 0))
        self.connect((self.blocks_unpack_k_bits_bb_0_0, 0),
                     (self.digital_map_bb_0, 0))
        self.connect((self.blocks_unpack_k_bits_bb_1, 0),
                     (self.mapper_prbs_sink_b_0, 0))
        self.connect((self.ccsds_createCADU_0, 0),
                     (self.blocks_unpack_k_bits_bb_0, 0))
        self.connect((self.ccsds_encodeTurbo_0, 0),
                     (self.blocks_stream_to_tagged_stream_0_0, 0))
        self.connect((self.ccsds_synchronizeCADUSoft_0, 0),
                     (self.blocks_null_sink_0, 0))
        self.connect((self.ccsds_synchronizeCADUSoft_0, 0),
                     (self.blocks_tag_debug_1, 0))
        self.connect((self.ccsds_synchronizeCADUSoft_0, 0),
                     (self.ccsds_recoverCADUSoft_0, 0))
        self.connect((self.ccsds_synchronizeCADU_0, 0),
                     (self.ccsds_recoverCADU_1, 0))
        self.connect((self.digital_map_bb_0, 0),
                     (self.blocks_char_to_float_0, 0))
        self.connect((self.digital_map_bb_0_0, 0),
                     (self.blocks_char_to_float_0_0, 0))
        self.connect((self.mapper_prbs_source_b_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.tdd_ferMsgGen_0, 0), (self.ccsds_encodeTurbo_0, 0))
Beispiel #4
0
    def __init__(self, syncword='1ACFFC1D'):
        gr.top_block.__init__(self, "Turbo Bert")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Turbo Bert")
        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", "turbo_bert")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Parameters
        ##################################################
        self.syncword = syncword

        ##################################################
        # Variables
        ##################################################
        self.vcdu_size = vcdu_size = 223
        self.symbol_rate = symbol_rate = 2e6
        self.sps = sps = 4
        self.EbNo = EbNo = 10
        self.value = value = [0, 1]
        self.symbol = symbol = [-1, 1]
        self.sigma = sigma = math.sqrt(1.0 / (2 * math.pow(10.0, EbNo / 10.0)))
        self.scramble = scramble = 0
        self.samp_rate = samp_rate = symbol_rate * sps
        self.reset = reset = vcdu_size
        self.ntaps = ntaps = 10 * sps
        self.frame_size = frame_size = vcdu_size
        self.Rm = Rm = 1
        self.Rc = Rc = 0.25

        ##################################################
        # Blocks
        ##################################################
        self.root_raised_cosine_filter_0_0 = filter.fir_filter_ccf(
            sps,
            firdes.root_raised_cosine(1, samp_rate, symbol_rate, 0.35, ntaps))
        self.root_raised_cosine_filter_0 = filter.interp_fir_filter_fff(
            sps,
            firdes.root_raised_cosine(1, samp_rate, symbol_rate, 0.35, ntaps))
        self.mapper_prbs_source_b_0 = mapper.prbs_source_b("PRBS31", reset * 8)
        self.mapper_prbs_sink_b_0 = mapper.prbs_sink_b("PRBS31", reset * 8)
        self.digital_map_bb_0_0 = digital.map_bb((-1, 1))
        self.ccsds_synchronizeCADUSoft_0 = ccsds.synchronizeCADUSoft(
            '1ACFFC1D', 1, 7, 0, 7152 + 32, 0, 0, 'syncsoft')
        self.ccsds_recoverCADUSoft_0 = ccsds.recoverCADUSoft(
            7152, 0, 'syncsoft')
        self.ccsds_encodeTurbo_0 = ccsds.encodeTurbo(frame_size, 4, "vcdu_len")
        self.ccsds_decodeTurbo_0 = ccsds.decodeTurbo(223, 1, 4, 1, sigma, 0)
        self.ccsds_createCADU_0 = ccsds.createCADU(
            int(frame_size / Rc) + 2, "1ACFFC1D", 0, 'xx_len')
        self.blocks_unpack_k_bits_bb_1 = blocks.unpack_k_bits_bb(8)
        self.blocks_unpack_k_bits_bb_0 = blocks.unpack_k_bits_bb(8)
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_char * 1, samp_rate,
                                                 True)
        self.blocks_stream_to_tagged_stream_0_0 = blocks.stream_to_tagged_stream(
            gr.sizeof_char, 1,
            int(frame_size / Rc) + 2, "xx_len")
        self.blocks_stream_to_tagged_stream_0 = blocks.stream_to_tagged_stream(
            gr.sizeof_char, 1, vcdu_size, "vcdu_len")
        self.blocks_pdu_to_tagged_stream_0_1 = blocks.pdu_to_tagged_stream(
            blocks.byte_t, 'packet_len')
        self.blocks_pack_k_bits_bb_0 = blocks.pack_k_bits_bb(8)
        self.blocks_null_source_0 = blocks.null_source(gr.sizeof_float * 1)
        self.blocks_float_to_complex_0 = blocks.float_to_complex(1)
        self.blocks_complex_to_real_0 = blocks.complex_to_real(1)
        self.blocks_char_to_float_0_0 = blocks.char_to_float(1, 1.0)
        self.blocks_add_xx_0 = blocks.add_vcc(1)
        self.analog_noise_source_x_0 = analog.noise_source_c(
            analog.GR_GAUSSIAN,
            (math.sqrt(2) /
             math.sqrt(2 * Rm * Rc * math.pow(10.0, EbNo / 10.0))) /
            math.sqrt(sps), 0)

        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.ccsds_decodeTurbo_0, 'out'),
                         (self.blocks_pdu_to_tagged_stream_0_1, 'pdus'))
        self.msg_connect((self.ccsds_recoverCADUSoft_0, 'cadu'),
                         (self.ccsds_decodeTurbo_0, 'in'))
        self.connect((self.analog_noise_source_x_0, 0),
                     (self.blocks_add_xx_0, 1))
        self.connect((self.blocks_add_xx_0, 0),
                     (self.root_raised_cosine_filter_0_0, 0))
        self.connect((self.blocks_char_to_float_0_0, 0),
                     (self.root_raised_cosine_filter_0, 0))
        self.connect((self.blocks_complex_to_real_0, 0),
                     (self.ccsds_synchronizeCADUSoft_0, 0))
        self.connect((self.blocks_float_to_complex_0, 0),
                     (self.blocks_add_xx_0, 0))
        self.connect((self.blocks_null_source_0, 0),
                     (self.blocks_float_to_complex_0, 1))
        self.connect((self.blocks_pack_k_bits_bb_0, 0),
                     (self.blocks_stream_to_tagged_stream_0, 0))
        self.connect((self.blocks_pdu_to_tagged_stream_0_1, 0),
                     (self.blocks_unpack_k_bits_bb_1, 0))
        self.connect((self.blocks_stream_to_tagged_stream_0, 0),
                     (self.ccsds_encodeTurbo_0, 0))
        self.connect((self.blocks_stream_to_tagged_stream_0_0, 0),
                     (self.ccsds_createCADU_0, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.blocks_pack_k_bits_bb_0, 0))
        self.connect((self.blocks_unpack_k_bits_bb_0, 0),
                     (self.digital_map_bb_0_0, 0))
        self.connect((self.blocks_unpack_k_bits_bb_1, 0),
                     (self.mapper_prbs_sink_b_0, 0))
        self.connect((self.ccsds_createCADU_0, 0),
                     (self.blocks_unpack_k_bits_bb_0, 0))
        self.connect((self.ccsds_encodeTurbo_0, 0),
                     (self.blocks_stream_to_tagged_stream_0_0, 0))
        self.connect((self.ccsds_synchronizeCADUSoft_0, 0),
                     (self.ccsds_recoverCADUSoft_0, 0))
        self.connect((self.digital_map_bb_0_0, 0),
                     (self.blocks_char_to_float_0_0, 0))
        self.connect((self.mapper_prbs_source_b_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.root_raised_cosine_filter_0, 0),
                     (self.blocks_float_to_complex_0, 0))
        self.connect((self.root_raised_cosine_filter_0_0, 0),
                     (self.blocks_complex_to_real_0, 0))
Beispiel #5
0
    def __init__(self):
        gr.top_block.__init__(self, "Ldpc Fert")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Ldpc Fert")
        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", "ldpc_fert")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())


        ##################################################
        # Variables
        ##################################################
        self.symbol_rate = symbol_rate = 5000e3
        self.sps = sps = 4
        self.N = N = 8160
        self.K = K = 7136
        self.samp_rate = samp_rate = symbol_rate*sps
        self.ntaps = ntaps = 10*sps
        self.nfilts = nfilts = 32
        self.Rm = Rm = 1
        self.Rc = Rc = K*1.0/N*1.0
        self.EbNo = EbNo = 4.0
        self.voltage_0 = voltage_0 = (math.sqrt(2)/math.sqrt(2*Rm*Rc*math.pow(10.0,EbNo/10.0)))/math.sqrt(sps)
        self.vcdu_size = vcdu_size = 7136
        self.value = value = [0,1]

        self.taps = taps = firdes.root_raised_cosine(sps, samp_rate, symbol_rate, 0.35, ntaps)

        self.symbol = symbol = [-1,1]
        self.sigma = sigma = math.sqrt(1.0/(2*math.pow(10.0,EbNo/10.0)))
        self.scramble = scramble = 0
        self.rs = rs = 1
        self.polyphase_taps = polyphase_taps = firdes.root_raised_cosine(sps*nfilts, nfilts, 1.0/float(sps), 0.35, 20*sps*nfilts)
        self.parity = parity = 32
        self.linecode = linecode = 1
        self.intDepth = intDepth = 1

        self.const = const = digital.constellation_bpsk().base()

        self.const.gen_soft_dec_lut(4)
        self.cadu_size = cadu_size = N/8

        ##################################################
        # Blocks
        ##################################################
        self.tdd_nullMsgSink_0 = tdd.nullMsgSink(1)
        self.tdd_ferMsgGen_0 = tdd.ferMsgGen(882, '', 'pkt_len')
        self.tdd_ferMsgCount_0 = tdd.ferMsgCount(1,0,1)
        self.fir_filter_xxx_0 = filter.fir_filter_ccc(sps, (taps))
        self.fir_filter_xxx_0.declare_sample_delay(0)
        self.ccsds_synchronizeCADUSoft_0 = ccsds.synchronizeCADUSoft('1ACFFC1D',1,7,0,N + 32,0,0,'sync')
        self.ccsds_recoverCADUSoft_0 = ccsds.recoverCADUSoft(N, 1, 'sync')
        self.ccsds_encodeLDPC_0 = ccsds.encodeLDPC('/home/mbkitine/Dropbox/Lulea/GRC/DeepSpace/gr-ccsds/lib/fec/ldpc/gmini/C2.txt',1,'cadu_len',"vcdu_len",0)
        self.ccsds_decodeLDPC_0 = ccsds.decodeLDPC('/home/mbkitine/Dropbox/Lulea/GRC/DeepSpace/gr-ccsds/lib/fec/ldpc/alist/C2_Alist.a',1,20, sigma, 1,1)
        self.ccsds_createCADU_0 = ccsds.createCADU(cadu_size, '1ACFFC1D', 1, 'cadu_len')
        self.bpsk_bpskSoftDecision_0 = bpsk.bpskSoftDecision(10, 2, 1)
        self.bpsk_bpskPulseshapeRRC_0 = bpsk.bpskPulseshapeRRC(sps, 1, samp_rate, symbol_rate, 0.35, ntaps)
        self.bpsk_bpskIQMap_0 = bpsk.bpskIQMap()
        self.blocks_unpack_k_bits_bb_2 = blocks.unpack_k_bits_bb(8)
        self.blocks_unpack_k_bits_bb_0 = blocks.unpack_k_bits_bb(8)
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_char*1, samp_rate,True)
        self.blocks_tag_debug_0 = blocks.tag_debug(gr.sizeof_float*1, '', ""); self.blocks_tag_debug_0.set_display(False)
        self.blocks_stream_to_tagged_stream_0_0 = blocks.stream_to_tagged_stream(gr.sizeof_char, 1, 7136, 'vcdu_len')
        self.blocks_stream_to_tagged_stream_0 = blocks.stream_to_tagged_stream(gr.sizeof_char, 1, 7056, 'pkt_len')
        self.blocks_pack_k_bits_bb_0 = blocks.pack_k_bits_bb(8)
        self.blocks_add_xx_0 = blocks.add_vcc(1)
        self.analog_random_source_x_0 = blocks.vector_source_b(map(int, numpy.random.randint(0, 2, 7056)), True)
        self.analog_noise_source_x_0 = analog.noise_source_c(analog.GR_GAUSSIAN, (math.sqrt(2)/math.sqrt(2*Rm*Rc*math.pow(10.0,EbNo/10.0)))/math.sqrt(sps), 0)



        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.ccsds_decodeLDPC_0, 'out'), (self.tdd_ferMsgCount_0, 'in'))
        self.msg_connect((self.ccsds_recoverCADUSoft_0, 'cadu'), (self.ccsds_decodeLDPC_0, 'in'))
        self.msg_connect((self.tdd_ferMsgCount_0, 'out'), (self.tdd_nullMsgSink_0, 'in'))
        self.connect((self.analog_noise_source_x_0, 0), (self.blocks_add_xx_0, 1))
        self.connect((self.analog_random_source_x_0, 0), (self.blocks_throttle_0, 0))
        self.connect((self.blocks_add_xx_0, 0), (self.fir_filter_xxx_0, 0))
        self.connect((self.blocks_pack_k_bits_bb_0, 0), (self.tdd_ferMsgGen_0, 0))
        self.connect((self.blocks_stream_to_tagged_stream_0, 0), (self.blocks_pack_k_bits_bb_0, 0))
        self.connect((self.blocks_stream_to_tagged_stream_0_0, 0), (self.ccsds_encodeLDPC_0, 0))
        self.connect((self.blocks_throttle_0, 0), (self.blocks_stream_to_tagged_stream_0, 0))
        self.connect((self.blocks_unpack_k_bits_bb_0, 0), (self.bpsk_bpskPulseshapeRRC_0, 0))
        self.connect((self.blocks_unpack_k_bits_bb_2, 0), (self.blocks_stream_to_tagged_stream_0_0, 0))
        self.connect((self.bpsk_bpskIQMap_0, 0), (self.blocks_add_xx_0, 0))
        self.connect((self.bpsk_bpskPulseshapeRRC_0, 0), (self.bpsk_bpskIQMap_0, 0))
        self.connect((self.bpsk_bpskSoftDecision_0, 0), (self.ccsds_synchronizeCADUSoft_0, 0))
        self.connect((self.ccsds_createCADU_0, 0), (self.blocks_unpack_k_bits_bb_0, 0))
        self.connect((self.ccsds_encodeLDPC_0, 0), (self.ccsds_createCADU_0, 0))
        self.connect((self.ccsds_synchronizeCADUSoft_0, 0), (self.blocks_tag_debug_0, 0))
        self.connect((self.ccsds_synchronizeCADUSoft_0, 0), (self.ccsds_recoverCADUSoft_0, 0))
        self.connect((self.fir_filter_xxx_0, 0), (self.bpsk_bpskSoftDecision_0, 0))
        self.connect((self.tdd_ferMsgGen_0, 0), (self.blocks_unpack_k_bits_bb_2, 0))
Beispiel #6
0
    def __init__(self, syncword="1ACFFC1D"):
        gr.top_block.__init__(self, "Turbo Verification V4")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Turbo Verification V4")
        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", "turbo_verification_v4")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Parameters
        ##################################################
        self.syncword = syncword

        ##################################################
        # Variables
        ##################################################
        self.vcdu_size = vcdu_size = 223 - 10
        self.value = value = [0, 1]
        self.symbol = symbol = [-1, 1]
        self.scramble = scramble = 0
        self.samp_rate = samp_rate = 2e6
        self.reset = reset = vcdu_size
        self.frame_size = frame_size = vcdu_size + 10
        self.Rc = Rc = 0.25

        ##################################################
        # Blocks
        ##################################################
        self.mapper_prbs_sink_b_0 = mapper.prbs_sink_b("PRBS31", reset * 8)
        self.digital_map_bb_0 = digital.map_bb((-1, 1))
        self.ccsds_synchronizeCADUSoft_0 = ccsds.synchronizeCADUSoft(
            '1ACFFC1D', 1, 7, 2, 7184, 0, 0, 'syncsoft')
        self.ccsds_recoverCADUSoft_0 = ccsds.recoverCADUSoft(
            7184 - 32, 0, 'syncsoft')
        self.ccsds_decodeTurbo_0 = ccsds.decodeTurbo(223, 1, 4, 1, 0.707, 0)
        self.blocks_unpack_k_bits_bb_2 = blocks.unpack_k_bits_bb(8)
        self.blocks_pdu_to_tagged_stream_0 = blocks.pdu_to_tagged_stream(
            blocks.byte_t, 'packet_len')
        self.blocks_null_sink_1 = blocks.null_sink(gr.sizeof_char * 1)
        self.blocks_file_source_0 = blocks.file_source(
            gr.sizeof_char * 1,
            '/home/mbkitine/Dropbox/Lulea/GRC/DeepSpace/gr-ccsds/examples/Turbo/memory/build/turbo_frames.hex',
            True)
        self.blocks_char_to_float_0 = blocks.char_to_float(1, 1)

        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.ccsds_decodeTurbo_0, 'out'),
                         (self.blocks_pdu_to_tagged_stream_0, 'pdus'))
        self.msg_connect((self.ccsds_recoverCADUSoft_0, 'cadu'),
                         (self.ccsds_decodeTurbo_0, 'in'))
        self.connect((self.blocks_char_to_float_0, 0),
                     (self.ccsds_synchronizeCADUSoft_0, 0))
        self.connect((self.blocks_file_source_0, 0),
                     (self.blocks_unpack_k_bits_bb_2, 0))
        self.connect((self.blocks_pdu_to_tagged_stream_0, 0),
                     (self.blocks_null_sink_1, 0))
        self.connect((self.blocks_pdu_to_tagged_stream_0, 0),
                     (self.mapper_prbs_sink_b_0, 0))
        self.connect((self.blocks_unpack_k_bits_bb_2, 0),
                     (self.digital_map_bb_0, 0))
        self.connect((self.ccsds_synchronizeCADUSoft_0, 0),
                     (self.ccsds_recoverCADUSoft_0, 0))
        self.connect((self.digital_map_bb_0, 0),
                     (self.blocks_char_to_float_0, 0))
Beispiel #7
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.symbol_rate = symbol_rate = 50e3
        self.sps = sps = 4
        self.samp_rate = samp_rate = symbol_rate * sps
        self.ntaps = ntaps = 10 * sps
        self.N = N = 8160 + 18 - 2
        self.K = K = 7136 + 18
        self.EbNo = EbNo = 3.9
        self.vcdu_size = vcdu_size = 7136
        self.value = value = [0, 1]

        self.taps = taps = firdes.root_raised_cosine(sps, samp_rate,
                                                     symbol_rate, 0.35, ntaps)

        self.symbol = symbol = [-1, 1]
        self.sigma = sigma = math.sqrt(1.0 / (2 * math.pow(10.0, EbNo / 10.0)))
        self.scramble = scramble = 0
        self.cadu_size = cadu_size = N / 8
        self.Rm = Rm = 1
        self.Rc = Rc = K * 1.0 / N * 1.0

        ##################################################
        # Blocks
        ##################################################
        self.root_raised_cosine_filter_0 = filter.interp_fir_filter_fff(
            sps,
            firdes.root_raised_cosine(1, samp_rate, symbol_rate, 0.35, ntaps))
        self.mapper_prbs_source_b_0 = mapper.prbs_source_b("PRBS31", K)
        self.mapper_prbs_sink_b_0 = mapper.prbs_sink_b("PRBS31", K)
        self.fir_filter_xxx_0 = filter.fir_filter_ccc(sps, (taps))
        self.fir_filter_xxx_0.declare_sample_delay(0)
        self.digital_map_bb_0 = digital.map_bb((-1, 1))
        self.ccsds_synchronizeCADUSoft_0 = ccsds.synchronizeCADUSoft(
            '1ACFFC1D', 1, 7, 0, N + 32, 0, 0, 'sync')
        self.ccsds_recoverCADUSoft_0 = ccsds.recoverCADUSoft(N, 1, 'sync')
        self.ccsds_encodeLDPC_0 = ccsds.encodeLDPC(
            '/home/mbkitine/Dropbox/Lulea/GRC/DeepSpace/gr-ccsds/lib/fec/ldpc/gmini/C2.txt',
            0, 'cadu_len', "vcdu_len", 0)
        self.ccsds_decodeLDPC_0 = ccsds.decodeLDPC(
            '/home/mbkitine/Dropbox/Lulea/GRC/DeepSpace/gr-ccsds/lib/fec/ldpc/alist/C2_Alist.a',
            0, 50, sigma, 0, 0)
        self.ccsds_createCADU_0 = ccsds.createCADU(cadu_size, '1ACFFC1D', 1,
                                                   'cadu_len')
        self.blocks_unpack_k_bits_bb_0 = blocks.unpack_k_bits_bb(8)
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_char * 1, samp_rate,
                                                 True)
        self.blocks_stream_to_tagged_stream_0 = blocks.stream_to_tagged_stream(
            gr.sizeof_char, 1, K, "vcdu_len")
        self.blocks_pdu_to_tagged_stream_0_0 = blocks.pdu_to_tagged_stream(
            blocks.byte_t, 'length_tag')
        self.blocks_null_source_0 = blocks.null_source(gr.sizeof_float * 1)
        self.blocks_float_to_complex_0 = blocks.float_to_complex(1)
        self.blocks_complex_to_real_0 = blocks.complex_to_real(1)
        self.blocks_char_to_float_0 = blocks.char_to_float(1, 1)
        self.blocks_add_xx_0 = blocks.add_vcc(1)
        self.analog_noise_source_x_0 = analog.noise_source_c(
            analog.GR_GAUSSIAN,
            (math.sqrt(2) /
             math.sqrt(2 * Rm * Rc * math.pow(10.0, EbNo / 10.0))) /
            math.sqrt(sps), 0)

        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.ccsds_decodeLDPC_0, 'out'),
                         (self.blocks_pdu_to_tagged_stream_0_0, 'pdus'))
        self.msg_connect((self.ccsds_recoverCADUSoft_0, 'cadu'),
                         (self.ccsds_decodeLDPC_0, 'in'))
        self.connect((self.analog_noise_source_x_0, 0),
                     (self.blocks_add_xx_0, 1))
        self.connect((self.blocks_add_xx_0, 0), (self.fir_filter_xxx_0, 0))
        self.connect((self.blocks_char_to_float_0, 0),
                     (self.root_raised_cosine_filter_0, 0))
        self.connect((self.blocks_complex_to_real_0, 0),
                     (self.ccsds_synchronizeCADUSoft_0, 0))
        self.connect((self.blocks_float_to_complex_0, 0),
                     (self.blocks_add_xx_0, 0))
        self.connect((self.blocks_null_source_0, 0),
                     (self.blocks_float_to_complex_0, 1))
        self.connect((self.blocks_pdu_to_tagged_stream_0_0, 0),
                     (self.mapper_prbs_sink_b_0, 0))
        self.connect((self.blocks_stream_to_tagged_stream_0, 0),
                     (self.ccsds_encodeLDPC_0, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.blocks_stream_to_tagged_stream_0, 0))
        self.connect((self.blocks_unpack_k_bits_bb_0, 0),
                     (self.digital_map_bb_0, 0))
        self.connect((self.ccsds_createCADU_0, 0),
                     (self.blocks_unpack_k_bits_bb_0, 0))
        self.connect((self.ccsds_encodeLDPC_0, 0),
                     (self.ccsds_createCADU_0, 0))
        self.connect((self.ccsds_synchronizeCADUSoft_0, 0),
                     (self.ccsds_recoverCADUSoft_0, 0))
        self.connect((self.digital_map_bb_0, 0),
                     (self.blocks_char_to_float_0, 0))
        self.connect((self.fir_filter_xxx_0, 0),
                     (self.blocks_complex_to_real_0, 0))
        self.connect((self.mapper_prbs_source_b_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.root_raised_cosine_filter_0, 0),
                     (self.blocks_float_to_complex_0, 0))