Ejemplo n.º 1
0
    def __init__(self):
        gr.top_block.__init__(self, "Top Block")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Top Block")
        try:
            self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
        except:
            pass
        self.top_scroll_layout = Qt.QVBoxLayout()
        self.setLayout(self.top_scroll_layout)
        self.top_scroll = Qt.QScrollArea()
        self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame)
        self.top_scroll_layout.addWidget(self.top_scroll)
        self.top_scroll.setWidgetResizable(True)
        self.top_widget = Qt.QWidget()
        self.top_scroll.setWidget(self.top_widget)
        self.top_layout = Qt.QVBoxLayout(self.top_widget)
        self.top_grid_layout = Qt.QGridLayout()
        self.top_layout.addLayout(self.top_grid_layout)

        self.settings = Qt.QSettings("GNU Radio", "top_block")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 32000
        self.r = r = 10
        self.n = n = 64800
        self.mult = mult = 100
        self.SNR = SNR = 20

        ##################################################
        # Blocks
        ##################################################
        self._SNR_range = Range(-50, 50, 1, 20, 200)
        self._SNR_win = RangeWidget(self._SNR_range, self.set_SNR, "SNR",
                                    "counter_slider", float)
        self.top_layout.addWidget(self._SNR_win)
        self.qtgui_time_sink_x_0_0 = qtgui.time_sink_f(
            16200,  #size
            samp_rate,  #samp_rate
            'LDPC IN',  #name
            1  #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(-mult - 0.1, mult + 0.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(True)
        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(
            10800,  #size
            samp_rate,  #samp_rate
            'LDPC OUT',  #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.1, 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.qtgui_number_sink_0 = qtgui.number_sink(gr.sizeof_float, 0.5,
                                                     qtgui.NUM_GRAPH_NONE, 1)
        self.qtgui_number_sink_0.set_update_time(0.10)
        self.qtgui_number_sink_0.set_title("")

        labels = ['BER', '', '', '', '', '', '', '', '', '']
        units = ['x10-6', '', '', '', '', '', '', '', '', '']
        colors = [("black", "black"), ("black", "black"), ("black", "black"),
                  ("black", "black"), ("black", "black"), ("black", "black"),
                  ("black", "black"), ("black", "black"), ("black", "black"),
                  ("black", "black")]
        factor = [1e6, 1, 1, 1, 1, 1, 1, 1, 1, 1]
        for i in xrange(1):
            self.qtgui_number_sink_0.set_min(i, -1)
            self.qtgui_number_sink_0.set_max(i, 1)
            self.qtgui_number_sink_0.set_color(i, colors[i][0], colors[i][1])
            if len(labels[i]) == 0:
                self.qtgui_number_sink_0.set_label(i, "Data {0}".format(i))
            else:
                self.qtgui_number_sink_0.set_label(i, labels[i])
            self.qtgui_number_sink_0.set_unit(i, units[i])
            self.qtgui_number_sink_0.set_factor(i, factor[i])

        self.qtgui_number_sink_0.enable_autoscale(False)
        self._qtgui_number_sink_0_win = sip.wrapinstance(
            self.qtgui_number_sink_0.pyqwidget(), Qt.QWidget)
        self.top_layout.addWidget(self._qtgui_number_sink_0_win)
        self.mapper_prbs_source_b_0 = mapper.prbs_source_b("PRBS7", 108000)
        self.mapper_prbs_sink_b_0 = mapper.prbs_sink_b("PRBS7", 108000)
        self.mack_sdr_ldpc_encoder_0 = mack_sdr.ldpc_encoder(n, r)
        self.ldpc_dec_soft_0 = ldpc_dec_soft(
            n=n,
            r=r,
        )
        self.blocks_throttle_0 = blocks.throttle(gr.sizeof_float * 1,
                                                 samp_rate, True)
        self.blocks_multiply_const_vxx_0_0 = blocks.multiply_const_vff((2, ))
        self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vff((mult, ))
        self.blocks_char_to_float_0_0 = blocks.char_to_float(1, 1)
        self.blocks_char_to_float_0 = blocks.char_to_float(1, 1)
        self.blocks_add_xx_0 = blocks.add_vff(1)
        self.blocks_add_const_vxx_0 = blocks.add_const_vff((-1, ))
        self.blks2_error_rate_0 = grc_blks2.error_rate(
            type='BER',
            win_size=1000000,
            bits_per_symbol=1,
        )
        self.analog_noise_source_x_0 = analog.noise_source_f(
            analog.GR_GAUSSIAN,
            math.pow(10.0, -(SNR - 1.25) / 20.0) / math.sqrt(2.0) * mult, 0)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.analog_noise_source_x_0, 0),
                     (self.blocks_add_xx_0, 0))
        self.connect((self.blks2_error_rate_0, 0),
                     (self.qtgui_number_sink_0, 0))
        self.connect((self.blocks_add_const_vxx_0, 0),
                     (self.blocks_multiply_const_vxx_0, 0))
        self.connect((self.blocks_add_xx_0, 0), (self.ldpc_dec_soft_0, 0))
        self.connect((self.blocks_add_xx_0, 0),
                     (self.qtgui_time_sink_x_0_0, 0))
        self.connect((self.blocks_char_to_float_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.blocks_char_to_float_0_0, 0),
                     (self.qtgui_time_sink_x_0, 0))
        self.connect((self.blocks_multiply_const_vxx_0, 0),
                     (self.blocks_add_xx_0, 1))
        self.connect((self.blocks_multiply_const_vxx_0_0, 0),
                     (self.blocks_add_const_vxx_0, 0))
        self.connect((self.blocks_throttle_0, 0),
                     (self.blocks_multiply_const_vxx_0_0, 0))
        self.connect((self.ldpc_dec_soft_0, 0), (self.blks2_error_rate_0, 1))
        self.connect((self.ldpc_dec_soft_0, 0),
                     (self.blocks_char_to_float_0_0, 0))
        self.connect((self.ldpc_dec_soft_0, 0), (self.mapper_prbs_sink_b_0, 0))
        self.connect((self.mack_sdr_ldpc_encoder_0, 0),
                     (self.blocks_char_to_float_0, 0))
        self.connect((self.mapper_prbs_source_b_0, 0),
                     (self.blks2_error_rate_0, 0))
        self.connect((self.mapper_prbs_source_b_0, 0),
                     (self.mack_sdr_ldpc_encoder_0, 0))
Ejemplo n.º 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))
Ejemplo n.º 3
0
    def __init__(self):
        gr.top_block.__init__(self, "Turbo Verification V0")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Turbo Verification V0")
        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_v0")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # 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 = 10
        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.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, 2, 0.707, 1)
        self.digital_map_bb_0 = digital.map_bb((-1, 1))
        self.ccsds_synchronizeCADU_0 = ccsds.synchronizeCADU(
            '1ACFFC1D', 0, "sync")
        self.ccsds_recoverCADU_1 = ccsds.recoverCADU(
            int(frame_size / Rc) + 1, scramble, 'sync')
        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_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_message_debug_0 = blocks.message_debug()
        self.blocks_char_to_float_0 = blocks.char_to_float(1, 0.5)

        ##################################################
        # Connections
        ##################################################
        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.blocks_message_debug_0, 'store'))
        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.dslwp_ccsds_turbo_decode_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_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, 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_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.mapper_prbs_source_b_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.tdd_ferMsgGen_0, 0), (self.ccsds_encodeTurbo_0, 0))
Ejemplo n.º 4
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))
Ejemplo n.º 5
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.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))
Ejemplo n.º 6
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.pilot_symbols = pilot_symbols = ((
            1,
            1,
            1,
            -1,
        ), )
        self.pilot_carriers = pilot_carriers = ((
            -21,
            -7,
            7,
            21,
        ), )
        self.payload_mod = payload_mod = digital.constellation_qpsk()
        self.packet_length_tag_key = packet_length_tag_key = "packet_len"
        self.occupied_carriers = occupied_carriers = (
            range(-26, -21) + range(-20, -7) + range(-6, 0) + range(1, 7) +
            range(8, 21) + range(22, 27), )
        self.length_tag_key = length_tag_key = "frame_len"
        self.header_mod = header_mod = digital.constellation_bpsk()
        self.fft_len = fft_len = 64
        self.sync_word2 = sync_word2 = [
            0j, 0j, 0j, 0j, 0j, 0j, (-1 + 0j), (-1 + 0j), (-1 + 0j), (-1 + 0j),
            (1 + 0j), (1 + 0j), (-1 + 0j), (-1 + 0j), (-1 + 0j), (1 + 0j),
            (-1 + 0j), (1 + 0j), (1 + 0j), (1 + 0j), (1 + 0j), (1 + 0j),
            (-1 + 0j), (-1 + 0j), (-1 + 0j), (-1 + 0j), (-1 + 0j), (1 + 0j),
            (-1 + 0j), (-1 + 0j), (1 + 0j), (-1 + 0j), 0j, (1 + 0j), (-1 + 0j),
            (1 + 0j), (1 + 0j), (1 + 0j), (-1 + 0j), (1 + 0j), (1 + 0j),
            (1 + 0j), (-1 + 0j), (1 + 0j), (1 + 0j), (1 + 0j), (1 + 0j),
            (-1 + 0j), (1 + 0j), (-1 + 0j), (-1 + 0j), (-1 + 0j), (1 + 0j),
            (-1 + 0j), (1 + 0j), (-1 + 0j), (-1 + 0j), (-1 + 0j), (-1 + 0j),
            0j, 0j, 0j, 0j, 0j
        ]
        self.sync_word1 = sync_word1 = [
            0., 0., 0., 0., 0., 0., 0., 1.41421356, 0., -1.41421356, 0.,
            1.41421356, 0., -1.41421356, 0., -1.41421356, 0., -1.41421356, 0.,
            1.41421356, 0., -1.41421356, 0., 1.41421356, 0., -1.41421356, 0.,
            -1.41421356, 0., -1.41421356, 0., -1.41421356, 0., 1.41421356, 0.,
            -1.41421356, 0., 1.41421356, 0., 1.41421356, 0., 1.41421356, 0.,
            -1.41421356, 0., 1.41421356, 0., 1.41421356, 0., 1.41421356, 0.,
            -1.41421356, 0., 1.41421356, 0., 1.41421356, 0., 1.41421356, 0.,
            0., 0., 0., 0., 0.
        ]
        self.sro = sro = 0
        self.samp_rate = samp_rate = 500000
        self.samp_per_sym = samp_per_sym = 2
        self.rolloff = rolloff = 0
        self.pream = pream = (mapper.preamble_generator(32, 511,
                                                        1033)).get_preamble()
        self.payload_equalizer = payload_equalizer = digital.ofdm_equalizer_simpledfe(
            fft_len, payload_mod.base(), occupied_carriers, pilot_carriers,
            pilot_symbols, 1)
        self.packet_len = packet_len = 96
        self.header_formatter = header_formatter = digital.packet_header_ofdm(
            occupied_carriers,
            n_syms=1,
            len_tag_key=packet_length_tag_key,
            frame_len_tag_key=length_tag_key,
            bits_per_header_sym=header_mod.bits_per_symbol(),
            bits_per_payload_sym=payload_mod.bits_per_symbol(),
            scramble_header=False)
        self.header_equalizer = header_equalizer = digital.ofdm_equalizer_simpledfe(
            fft_len, header_mod.base(), occupied_carriers, pilot_carriers,
            pilot_symbols)
        self.hdr_format = hdr_format = digital.header_format_ofdm(
            occupied_carriers,
            1,
            length_tag_key,
        )
        self.frame_width_with_crc32 = frame_width_with_crc32 = 2016 + 32 + 32
        self.frame_width = frame_width = 1024 * 2
        self.cfo = cfo = 1e-2
        self.SNR = SNR = 15

        ##################################################
        # Blocks
        ##################################################
        self._sro_range = Range(-1e-1, 1e-1, 1e-3, 0, 200)
        self._sro_win = RangeWidget(self._sro_range, self.set_sro,
                                    'Sample Rate Offset', "counter_slider",
                                    float)
        self.top_grid_layout.addWidget(self._sro_win)
        self._cfo_range = Range(-1e-1, 1e-1, 1e-3, 1e-2, 200)
        self._cfo_win = RangeWidget(self._cfo_range, self.set_cfo,
                                    'Freq Offset', "counter_slider", float)
        self.top_grid_layout.addWidget(self._cfo_win)
        self.qtgui_time_sink_x_0 = qtgui.time_sink_f(
            1024,  #size
            samp_rate,  #samp_rate
            'Scope Plot',  #name
            1  #number of inputs
        )
        self.qtgui_time_sink_x_0.set_update_time(0.10)
        self.qtgui_time_sink_x_0.set_y_axis(-1, 1)

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

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

        if not True:
            self.qtgui_time_sink_x_0.disable_legend()

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

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

        self._qtgui_time_sink_x_0_win = sip.wrapinstance(
            self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget)
        self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_win)
        self.qtgui_freq_sink_x_0_0 = qtgui.freq_sink_c(
            1024,  #size
            firdes.WIN_BLACKMAN_hARRIS,  #wintype
            0,  #fc
            samp_rate,  #bw
            'Tx Spectrum',  #name
            1  #number of inputs
        )
        self.qtgui_freq_sink_x_0_0.set_update_time(0.10)
        self.qtgui_freq_sink_x_0_0.set_y_axis(-140, 10)
        self.qtgui_freq_sink_x_0_0.set_y_label('Relative Gain', 'dB')
        self.qtgui_freq_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0,
                                                    0, "")
        self.qtgui_freq_sink_x_0_0.enable_autoscale(False)
        self.qtgui_freq_sink_x_0_0.enable_grid(False)
        self.qtgui_freq_sink_x_0_0.set_fft_average(1.0)
        self.qtgui_freq_sink_x_0_0.enable_axis_labels(True)
        self.qtgui_freq_sink_x_0_0.enable_control_panel(False)

        if not True:
            self.qtgui_freq_sink_x_0_0.disable_legend()

        if "complex" == "float" or "complex" == "msg_float":
            self.qtgui_freq_sink_x_0_0.set_plot_pos_half(not True)

        labels = ['Rx Spectrum', '', '', '', '', '', '', '', '', '']
        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_0.set_line_label(
                    i, "Data {0}".format(i))
            else:
                self.qtgui_freq_sink_x_0_0.set_line_label(i, labels[i])
            self.qtgui_freq_sink_x_0_0.set_line_width(i, widths[i])
            self.qtgui_freq_sink_x_0_0.set_line_color(i, colors[i])
            self.qtgui_freq_sink_x_0_0.set_line_alpha(i, alphas[i])

        self._qtgui_freq_sink_x_0_0_win = sip.wrapinstance(
            self.qtgui_freq_sink_x_0_0.pyqwidget(), Qt.QWidget)
        self.top_grid_layout.addWidget(self._qtgui_freq_sink_x_0_0_win)
        self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c(
            1024,  #size
            firdes.WIN_BLACKMAN_hARRIS,  #wintype
            0,  #fc
            samp_rate,  #bw
            'Rx 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(-140, 10)
        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(False)
        self.qtgui_freq_sink_x_0.enable_grid(False)
        self.qtgui_freq_sink_x_0.set_fft_average(1.0)
        self.qtgui_freq_sink_x_0.enable_axis_labels(True)
        self.qtgui_freq_sink_x_0.enable_control_panel(False)

        if not True:
            self.qtgui_freq_sink_x_0.disable_legend()

        if "complex" == "float" or "complex" == "msg_float":
            self.qtgui_freq_sink_x_0.set_plot_pos_half(not True)

        labels = ['Rx Spectrum', '', '', '', '', '', '', '', '', '']
        widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
        colors = [
            "blue", "red", "green", "black", "cyan", "magenta", "yellow",
            "dark red", "dark green", "dark blue"
        ]
        alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
        for i in xrange(1):
            if len(labels[i]) == 0:
                self.qtgui_freq_sink_x_0.set_line_label(
                    i, "Data {0}".format(i))
            else:
                self.qtgui_freq_sink_x_0.set_line_label(i, labels[i])
            self.qtgui_freq_sink_x_0.set_line_width(i, widths[i])
            self.qtgui_freq_sink_x_0.set_line_color(i, colors[i])
            self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i])

        self._qtgui_freq_sink_x_0_win = sip.wrapinstance(
            self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget)
        self.top_grid_layout.addWidget(self._qtgui_freq_sink_x_0_win)
        self.mapper_prbs_source_b_0 = mapper.prbs_source_b(
            "PRBS31", packet_len)
        self.mapper_prbs_sink_b_0 = mapper.prbs_sink_b("PRBS31", packet_len)
        self.digital_ofdm_tx_0 = digital.ofdm_tx(
            fft_len=fft_len,
            cp_len=fft_len / 4,
            packet_length_tag_key=packet_length_tag_key,
            occupied_carriers=occupied_carriers,
            pilot_carriers=pilot_carriers,
            pilot_symbols=pilot_symbols,
            sync_word1=sync_word1,
            sync_word2=sync_word2,
            bps_header=1,
            bps_payload=2,
            rolloff=0,
            debug_log=True,
            scramble_bits=False)
        self.digital_ofdm_rx_0 = digital.ofdm_rx(
            fft_len=fft_len,
            cp_len=fft_len / 4,
            frame_length_tag_key='frame_' + "length",
            packet_length_tag_key="length",
            occupied_carriers=occupied_carriers,
            pilot_carriers=pilot_carriers,
            pilot_symbols=pilot_symbols,
            sync_word1=sync_word1,
            sync_word2=sync_word2,
            bps_header=1,
            bps_payload=2,
            debug_log=False,
            scramble_bits=False)
        self.channels_channel_model_0 = channels.channel_model(
            noise_voltage=0.1,
            frequency_offset=cfo,
            epsilon=1.0 + sro,
            taps=(1.0, ),
            noise_seed=0,
            block_tags=True)
        self.blocks_uchar_to_float_0 = blocks.uchar_to_float()
        self.blocks_throttle_0_0 = blocks.throttle(gr.sizeof_gr_complex * 1,
                                                   samp_rate, True)
        self.blocks_stream_to_tagged_stream_0 = blocks.stream_to_tagged_stream(
            gr.sizeof_char, 1, packet_len, packet_length_tag_key)
        self._SNR_tool_bar = Qt.QToolBar(self)
        self._SNR_tool_bar.addWidget(Qt.QLabel('SNR' + ": "))
        self._SNR_line_edit = Qt.QLineEdit(str(self.SNR))
        self._SNR_tool_bar.addWidget(self._SNR_line_edit)
        self._SNR_line_edit.returnPressed.connect(lambda: self.set_SNR(
            eng_notation.str_to_num(str(self._SNR_line_edit.text().toAscii())))
                                                  )
        self.top_grid_layout.addWidget(self._SNR_tool_bar)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.blocks_stream_to_tagged_stream_0, 0),
                     (self.digital_ofdm_tx_0, 0))
        self.connect((self.blocks_throttle_0_0, 0),
                     (self.channels_channel_model_0, 0))
        self.connect((self.blocks_uchar_to_float_0, 0),
                     (self.qtgui_time_sink_x_0, 0))
        self.connect((self.channels_channel_model_0, 0),
                     (self.digital_ofdm_rx_0, 0))
        self.connect((self.channels_channel_model_0, 0),
                     (self.qtgui_freq_sink_x_0, 0))
        self.connect((self.digital_ofdm_rx_0, 0),
                     (self.blocks_uchar_to_float_0, 0))
        self.connect((self.digital_ofdm_rx_0, 0),
                     (self.mapper_prbs_sink_b_0, 0))
        self.connect((self.digital_ofdm_tx_0, 0),
                     (self.blocks_throttle_0_0, 0))
        self.connect((self.digital_ofdm_tx_0, 0),
                     (self.qtgui_freq_sink_x_0_0, 0))
        self.connect((self.mapper_prbs_source_b_0, 0),
                     (self.blocks_stream_to_tagged_stream_0, 0))
Ejemplo n.º 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.vcdu_size = vcdu_size = 100
        self.symbol_rate = symbol_rate = 500e3
        self.sps = sps = 4
        self.samp_rate = samp_rate = symbol_rate * sps
        self.ntaps = ntaps = 40 * sps
        self.nfilts = nfilts = 32
        self.frame_size = frame_size = vcdu_size + 10
        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 = 1
        self.rs = rs = 1
        self.reset = reset = frame_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.cfo = cfo = 0.25
        self.SNR = SNR = 10

        ##################################################
        # Blocks
        ##################################################
        self.tdd_ferMsgGen_0 = tdd.ferMsgGen(vcdu_size, 'cadu_len', 'vcdu_len')
        self.tdd_ferMsgCount_0 = tdd.ferMsgCount(1)
        self.mapper_prbs_source_b_0 = mapper.prbs_source_b("PRBS31", reset)
        self.ccsds_synchronizeCADU_0 = ccsds.synchronizeCADU(
            '1ACFFC1D', 0, "sync")
        self.ccsds_recoverCADU_1 = ccsds.recoverCADU(
            frame_size + intDepth * parity, scramble, 'sync')
        self.ccsds_encodeRS_0 = ccsds.encodeRS(rs, frame_size, intDepth,
                                               'rshh', 'cadu_len')
        self.ccsds_decodeRS_0 = ccsds.decodeRS(rs, intDepth, 0, 0)
        self.ccsds_createCADU_0 = ccsds.createCADU(
            frame_size + intDepth * parity, '1ACFFC1D', scramble, 'rshh')
        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, vcdu_size, "vcdu_len")
        self.blocks_pack_k_bits_bb_0 = blocks.pack_k_bits_bb(8)
        self.blocks_message_debug_0 = blocks.message_debug()

        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.ccsds_decodeRS_0, 'vcdu'),
                         (self.tdd_ferMsgCount_0, 'in'))
        self.msg_connect((self.ccsds_recoverCADU_1, 'cadu'),
                         (self.ccsds_decodeRS_0, 'cadu'))
        self.msg_connect((self.tdd_ferMsgCount_0, 'out'),
                         (self.blocks_message_debug_0, 'store'))
        self.connect((self.blocks_pack_k_bits_bb_0, 0),
                     (self.blocks_stream_to_tagged_stream_0, 0))
        self.connect((self.blocks_stream_to_tagged_stream_0, 0),
                     (self.tdd_ferMsgGen_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.ccsds_createCADU_0, 0),
                     (self.blocks_unpack_k_bits_bb_0, 0))
        self.connect((self.ccsds_encodeRS_0, 0), (self.ccsds_createCADU_0, 0))
        self.connect((self.ccsds_synchronizeCADU_0, 0),
                     (self.ccsds_recoverCADU_1, 0))
        self.connect((self.mapper_prbs_source_b_0, 0),
                     (self.blocks_throttle_0, 0))
        self.connect((self.tdd_ferMsgGen_0, 0), (self.ccsds_encodeRS_0, 0))
Ejemplo n.º 8
0
    def __init__(self):
        gr.top_block.__init__(self, "Fer V1")
        Qt.QWidget.__init__(self)
        self.setWindowTitle("Fer V1")
        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", "fer_v1")
        self.restoreGeometry(self.settings.value("geometry").toByteArray())

        ##################################################
        # Variables
        ##################################################
        self.symbol_rate = symbol_rate = 500e3
        self.sps = sps = 4
        self.value = value = [0,1]
        self.symbol = symbol = [-1,1]
        self.scramble = scramble = 1
        self.samp_rate = samp_rate = symbol_rate*sps
        self.rs = rs = 0
        self.reset = reset = 500
        self.linecode = linecode = 0
        self.intDepth = intDepth = 4
        self.frame_size = frame_size = 500
        self.cfo = cfo = 0.0
        self.bn = bn = 0.07
        self.SNR = SNR = 1000

        ##################################################
        # Blocks
        ##################################################
        self.tdd_ferMsgGen_0 = tdd.ferMsgGen(frame_size, 'msg_len', "packet_len")
        self.tdd_ferMsgCount_0 = tdd.ferMsgCount(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.ccsds_synchronizeCADU_0 = ccsds.synchronizeCADU('1ACFFC1D', 0, "sync")
        self.ccsds_recoverCADU_0 = ccsds.recoverCADU(frame_size + 10, scramble, 'sync')
        self.ccsds_createCADU_0 = ccsds.createCADU(frame_size + 10, '1ACFFC1D', scramble, 'frame_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_gate_0 = blocks.tag_gate(gr.sizeof_char * 1, False)
        self.blocks_stream_to_tagged_stream_1 = blocks.stream_to_tagged_stream(gr.sizeof_char, 1, frame_size+10, 'frame_len')
        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)

        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.ccsds_recoverCADU_0, 'cadu'), (self.tdd_ferMsgCount_0, 'in'))
        self.msg_connect((self.tdd_ferMsgCount_0, 'out'), (self.blocks_pdu_to_tagged_stream_0, 'pdus'))
        self.connect((self.blocks_pack_k_bits_bb_0, 0), (self.blocks_throttle_0, 0))
        self.connect((self.blocks_pdu_to_tagged_stream_0, 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_1, 0), (self.ccsds_createCADU_0, 0))
        self.connect((self.blocks_tag_gate_0, 0), (self.blocks_unpack_k_bits_bb_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.ccsds_synchronizeCADU_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_tag_gate_0, 0))
        self.connect((self.ccsds_synchronizeCADU_0, 0), (self.ccsds_recoverCADU_0, 0))
        self.connect((self.mapper_prbs_source_b_0, 0), (self.blocks_pack_k_bits_bb_0, 0))
        self.connect((self.tdd_ferMsgGen_0, 0), (self.blocks_stream_to_tagged_stream_1, 0))
Ejemplo n.º 9
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 = 500e3
        self.sps = sps = 4
        self.samp_rate = samp_rate = symbol_rate * sps
        self.ntaps = ntaps = 40 * sps
        self.nfilts = nfilts = 32
        self.frame_size = frame_size = 200
        self.SNR = SNR = 10
        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 = 1
        self.rs = rs = 0
        self.reset = reset = frame_size
        self.polyphase_taps = polyphase_taps = firdes.root_raised_cosine(
            sps * nfilts, nfilts, 1.0 / float(sps), 0.35, 20 * sps * nfilts)
        self.noise_original = noise_original = math.sqrt(
            (1) / math.pow(10, (SNR) / 10.0))
        self.linecode = linecode = 1
        self.intDepth = intDepth = 4
        self.cfo = cfo = 0.25

        ##################################################
        # Blocks
        ##################################################
        self.mapper_prbs_source_b_0 = mapper.prbs_source_b("PRBS31", reset)
        self.mapper_prbs_sink_b_0 = mapper.prbs_sink_b("PRBS31", reset)
        self.ccsds_synchronizeCADUHard_0 = ccsds.synchronizeCADUHard(
            '1ACFFC1D', 7, 2, 1, 1, (frame_size + 4) * 8, 0)
        self.ccsds_recoverCADU_0 = ccsds.recoverCADU(frame_size, scramble,
                                                     "sync")
        self.ccsds_createCADU_0 = ccsds.createCADU(frame_size, '1ACFFC1D',
                                                   scramble, "packet_len")
        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_gate_0 = blocks.tag_gate(gr.sizeof_char * 1, False)
        self.blocks_tag_debug_1 = blocks.tag_debug(gr.sizeof_char * 1, '', "")
        self.blocks_tag_debug_1.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_0 = blocks.pdu_to_tagged_stream(
            blocks.byte_t, 'length_tag')
        self.blocks_pack_k_bits_bb_0 = blocks.pack_k_bits_bb(8)
        self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_char * 1)

        ##################################################
        # Connections
        ##################################################
        self.msg_connect((self.ccsds_recoverCADU_0, 'cadu'),
                         (self.blocks_pdu_to_tagged_stream_0_0, 'pdus'))
        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_stream_to_tagged_stream_0, 0),
                     (self.ccsds_createCADU_0, 0))
        self.connect((self.blocks_tag_gate_0, 0),
                     (self.ccsds_synchronizeCADUHard_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.blocks_tag_gate_0, 0))
        self.connect((self.blocks_unpack_k_bits_bb_0_0, 0),
                     (self.blocks_null_sink_0, 0))
        self.connect((self.blocks_unpack_k_bits_bb_0_0, 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_synchronizeCADUHard_0, 0),
                     (self.blocks_tag_debug_1, 0))
        self.connect((self.ccsds_synchronizeCADUHard_0, 0),
                     (self.ccsds_recoverCADU_0, 0))
        self.connect((self.mapper_prbs_source_b_0, 0),
                     (self.blocks_throttle_0, 0))
Ejemplo n.º 10
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))
Ejemplo n.º 11
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))
Ejemplo n.º 12
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 = 1000
        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.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.digital_binary_slicer_fb_0 = digital.binary_slicer_fb()
        self.ccsds_synchronizeCADUArgMax_0 = ccsds.synchronizeCADUArgMax(
            '1ACFFC1D', (frame_size + 4) * 8, 1, 0, 0, 0, 'sync')
        self.ccsds_recoverCADUSoft_0 = ccsds.recoverCADUSoft(
            frame_size * 8, 0, 'sync')
        self.ccsds_createCADU_0 = ccsds.createCADU(frame_size, '1ACFFC1D', 0,
                                                   'packet_len')
        self.bpsk_bpskPulseshapeRRC_0 = bpsk.bpskPulseshapeRRC(
            sps, 1.0, samp_rate, samp_rate / (sps), 0.35, 40 * sps)
        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_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.float_t, '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.blocks_pdu_to_tagged_stream_0, 'pdus'))
        self.msg_connect((self.ccsds_recoverCADUSoft_0, 'cadu'),
                         (self.tdd_nullMsgSink_0, 'in'))
        self.connect((self.baseband_debug_channel_model_1_0, 0),
                     (self.fir_filter_xxx_0, 0))
        self.connect((self.blocks_complex_to_real_0, 0),
                     (self.ccsds_synchronizeCADUArgMax_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.digital_binary_slicer_fb_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.pcm_encodeNRZ_0, 0))
        self.connect((self.bpsk_bpskIQMap_0, 0),
                     (self.baseband_debug_channel_model_1_0, 0))
        self.connect((self.bpsk_bpskPulseshapeRRC_0, 0),
                     (self.bpsk_bpskIQMap_0, 0))
        self.connect((self.ccsds_createCADU_0, 0),
                     (self.blocks_unpack_k_bits_bb_0, 0))
        self.connect((self.ccsds_synchronizeCADUArgMax_0, 0),
                     (self.ccsds_recoverCADUSoft_0, 0))
        self.connect((self.digital_binary_slicer_fb_0, 0),
                     (self.mapper_prbs_sink_b_0, 0))
        self.connect((self.fir_filter_xxx_0, 0),
                     (self.blocks_multiply_const_vxx_0, 0))
        self.connect((self.fir_filter_xxx_0, 0), (self.qtgui_sink_x_0_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))