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))
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))
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))
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))