def __init__(self, ipp1="127.0.0.1", ipp2="127.0.0.1", ipp3="127.0.0.1", ipp4="127.0.0.1", iptx="127.0.0.1", samp_rate=100): gr.top_block.__init__(self, "OFDM Rx") ################################################## # Parameters ################################################## self.ipp1 = ipp1 self.ipp2 = ipp2 self.ipp3 = ipp3 self.ipp4 = ipp4 self.iptx = iptx self.samp_rate = samp_rate ################################################## # 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.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) ################################################## # Blocks ################################################## self.zeromq_pull_source_0_0_0_0_0_0 = zeromq.pull_source(gr.sizeof_gr_complex, 64, "tcp://" + ipp2 + ":55521", 100, True) self.my_number_sync_timestamp_0 = my.number_sync_timestamp() self.fft_vxx_1 = fft.fft_vcc(fft_len, True, (), True, 1) self.digital_ofdm_serializer_vcc_payload = digital.ofdm_serializer_vcc(fft_len, occupied_carriers, length_tag_key, packet_length_tag_key, 1, "", True) self.digital_ofdm_frame_equalizer_vcvc_1 = digital.ofdm_frame_equalizer_vcvc(payload_equalizer.base(), fft_len/4, length_tag_key, True, 0) self.digital_crc32_bb_0 = digital.crc32_bb(True, packet_length_tag_key, True) self.digital_constellation_decoder_cb_1 = digital.constellation_decoder_cb(payload_mod.base()) self.blocks_repack_bits_bb_0 = blocks.repack_bits_bb(payload_mod.bits_per_symbol(), 8, packet_length_tag_key, True, gr.GR_LSB_FIRST) ################################################## # Connections ################################################## self.connect((self.blocks_repack_bits_bb_0, 0), (self.digital_crc32_bb_0, 0)) self.connect((self.digital_constellation_decoder_cb_1, 0), (self.blocks_repack_bits_bb_0, 0)) self.connect((self.digital_crc32_bb_0, 0), (self.my_number_sync_timestamp_0, 0)) self.connect((self.digital_ofdm_frame_equalizer_vcvc_1, 0), (self.digital_ofdm_serializer_vcc_payload, 0)) self.connect((self.digital_ofdm_serializer_vcc_payload, 0), (self.digital_constellation_decoder_cb_1, 0)) self.connect((self.fft_vxx_1, 0), (self.digital_ofdm_frame_equalizer_vcvc_1, 0)) self.connect((self.zeromq_pull_source_0_0_0_0_0_0, 0), (self.fft_vxx_1, 0))
def __init__( self, ipp1="127.0.0.1", ipp2="127.0.0.1", ipp3="127.0.0.1", ipp4="127.0.0.1", iptx="127.0.0.1", samp_rate=1000 ): gr.top_block.__init__(self, "OFDM Rx") ################################################## # Parameters ################################################## self.ipp1 = ipp1 self.ipp2 = ipp2 self.ipp3 = ipp3 self.ipp4 = ipp4 self.iptx = iptx self.samp_rate = samp_rate ################################################## # 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.0, 0.0, 0.0, 0.0, 1.41421356, 0.0, -1.41421356, 0.0, 1.41421356, 0.0, -1.41421356, 0.0, -1.41421356, 0.0, -1.41421356, 0.0, 1.41421356, 0.0, -1.41421356, 0.0, 1.41421356, 0.0, -1.41421356, 0.0, -1.41421356, 0.0, -1.41421356, 0.0, -1.41421356, 0.0, 1.41421356, 0.0, -1.41421356, 0.0, 1.41421356, 0.0, 1.41421356, 0.0, 1.41421356, 0.0, -1.41421356, 0.0, 1.41421356, 0.0, 1.41421356, 0.0, 1.41421356, 0.0, -1.41421356, 0.0, 1.41421356, 0.0, 1.41421356, 0.0, 1.41421356, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ] 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 ) ################################################## # Blocks ################################################## self.zeromq_push_sink_0_0_1_0_0 = zeromq.push_sink(gr.sizeof_char, 1, "tcp://" + ipp3 + ":55530", 100, True) self.zeromq_push_sink_0_0_1_0 = zeromq.push_sink( gr.sizeof_gr_complex, 64, "tcp://" + ipp2 + ":55521", 100, True ) self.zeromq_push_sink_0_0_1 = zeromq.push_sink(gr.sizeof_gr_complex, 64, "tcp://" + ipp2 + ":55520", 100, True) self.zeromq_push_sink_0_0_0 = zeromq.push_sink(gr.sizeof_char, 1, "tcp://" + ipp1 + ":55511", 100, True) self.zeromq_push_sink_0_0 = zeromq.push_sink(gr.sizeof_gr_complex, 1, "tcp://" + ipp1 + ":55510", 100, True) self.zeromq_push_sink_0 = zeromq.push_sink(gr.sizeof_gr_complex, 1, "tcp://" + iptx + ":55500", 100, True) self.zeromq_pull_source_0_0_0_0_0_0 = zeromq.pull_source( gr.sizeof_gr_complex, 64, "tcp://" + ipp2 + ":55521", 100, True ) self.zeromq_pull_source_0_0_0_0_0 = zeromq.pull_source( gr.sizeof_gr_complex, 64, "tcp://" + ipp2 + ":55520", 100, True ) self.zeromq_pull_source_0_0_0_0 = zeromq.pull_source(gr.sizeof_char, 1, "tcp://" + ipp3 + ":55530", 100, True) self.zeromq_pull_source_0_0_0 = zeromq.pull_source(gr.sizeof_char, 1, "tcp://" + ipp1 + ":55511", 100, True) self.zeromq_pull_source_0_0 = zeromq.pull_source(gr.sizeof_gr_complex, 1, "tcp://" + ipp1 + ":55510", 100, True) self.zeromq_pull_source_0 = zeromq.pull_source(gr.sizeof_gr_complex, 1, "tcp://" + iptx + ":55500", 100, True) self.my_random_source_limit_rate_0 = my.random_source_limit_rate(1000) self.my_number_sync_timestamp_0 = my.number_sync_timestamp() self.fft_vxx_1 = fft.fft_vcc(fft_len, True, (), True, 1) self.fft_vxx_0 = fft.fft_vcc(fft_len, True, (()), True, 1) self.digital_packet_headerparser_b_0 = digital.packet_headerparser_b(header_formatter.base()) 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_sync_sc_cfb_0 = digital.ofdm_sync_sc_cfb(fft_len, fft_len / 4, False) self.digital_ofdm_serializer_vcc_payload = digital.ofdm_serializer_vcc( fft_len, occupied_carriers, length_tag_key, packet_length_tag_key, 1, "", True ) self.digital_ofdm_serializer_vcc_header = digital.ofdm_serializer_vcc( fft_len, occupied_carriers, length_tag_key, "", 0, "", True ) self.digital_ofdm_frame_equalizer_vcvc_1 = digital.ofdm_frame_equalizer_vcvc( payload_equalizer.base(), fft_len / 4, length_tag_key, True, 0 ) self.digital_ofdm_frame_equalizer_vcvc_0 = digital.ofdm_frame_equalizer_vcvc( header_equalizer.base(), fft_len / 4, length_tag_key, True, 1 ) self.digital_ofdm_chanest_vcvc_0 = digital.ofdm_chanest_vcvc((sync_word1), (sync_word2), 1, 0, 3, False) self.digital_header_payload_demux_0 = digital.header_payload_demux( 3, fft_len, fft_len / 4, length_tag_key, "", True, gr.sizeof_gr_complex, "rx_time", samp_rate, () ) self.digital_crc32_bb_0 = digital.crc32_bb(True, packet_length_tag_key, True) self.digital_constellation_decoder_cb_1 = digital.constellation_decoder_cb(payload_mod.base()) self.digital_constellation_decoder_cb_0 = digital.constellation_decoder_cb(header_mod.base()) self.channels_channel_model_0 = channels.channel_model( noise_voltage=0.1, frequency_offset=0 * 1.0 / fft_len, epsilon=1.0, taps=(1.0,), noise_seed=0, block_tags=True, ) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1, samp_rate, True) self.blocks_tag_debug_1 = blocks.tag_debug(gr.sizeof_char * 1, "Rx Bytes", "") self.blocks_tag_debug_1.set_display(True) self.blocks_stream_to_tagged_stream_0 = blocks.stream_to_tagged_stream( gr.sizeof_char, 1, packet_len, packet_length_tag_key ) self.blocks_repack_bits_bb_0 = blocks.repack_bits_bb( payload_mod.bits_per_symbol(), 8, packet_length_tag_key, True, gr.GR_LSB_FIRST ) self.blocks_multiply_xx_0 = blocks.multiply_vcc(1) self.blocks_delay_0 = blocks.delay(gr.sizeof_gr_complex * 1, fft_len + fft_len / 4) self.analog_frequency_modulator_fc_0 = analog.frequency_modulator_fc(-2.0 / fft_len) ################################################## # Connections ################################################## self.msg_connect( (self.digital_packet_headerparser_b_0, "header_data"), (self.digital_header_payload_demux_0, "header_data") ) self.connect((self.analog_frequency_modulator_fc_0, 0), (self.blocks_multiply_xx_0, 0)) self.connect((self.blocks_delay_0, 0), (self.blocks_multiply_xx_0, 1)) self.connect((self.blocks_multiply_xx_0, 0), (self.zeromq_push_sink_0_0, 0)) self.connect((self.blocks_repack_bits_bb_0, 0), (self.digital_crc32_bb_0, 0)) self.connect((self.blocks_stream_to_tagged_stream_0, 0), (self.digital_ofdm_tx_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.zeromq_push_sink_0, 0)) self.connect((self.channels_channel_model_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.digital_constellation_decoder_cb_0, 0), (self.zeromq_push_sink_0_0_1_0_0, 0)) self.connect((self.digital_constellation_decoder_cb_1, 0), (self.blocks_repack_bits_bb_0, 0)) self.connect((self.digital_crc32_bb_0, 0), (self.blocks_tag_debug_1, 0)) self.connect((self.digital_crc32_bb_0, 0), (self.my_number_sync_timestamp_0, 0)) self.connect((self.digital_header_payload_demux_0, 0), (self.zeromq_push_sink_0_0_1, 0)) self.connect((self.digital_header_payload_demux_0, 1), (self.zeromq_push_sink_0_0_1_0, 0)) self.connect((self.digital_ofdm_chanest_vcvc_0, 0), (self.digital_ofdm_frame_equalizer_vcvc_0, 0)) self.connect((self.digital_ofdm_frame_equalizer_vcvc_0, 0), (self.digital_ofdm_serializer_vcc_header, 0)) self.connect((self.digital_ofdm_frame_equalizer_vcvc_1, 0), (self.digital_ofdm_serializer_vcc_payload, 0)) self.connect((self.digital_ofdm_serializer_vcc_header, 0), (self.digital_constellation_decoder_cb_0, 0)) self.connect((self.digital_ofdm_serializer_vcc_payload, 0), (self.digital_constellation_decoder_cb_1, 0)) self.connect((self.digital_ofdm_sync_sc_cfb_0, 0), (self.analog_frequency_modulator_fc_0, 0)) self.connect((self.digital_ofdm_sync_sc_cfb_0, 1), (self.zeromq_push_sink_0_0_0, 0)) self.connect((self.digital_ofdm_tx_0, 0), (self.channels_channel_model_0, 0)) self.connect((self.fft_vxx_0, 0), (self.digital_ofdm_chanest_vcvc_0, 0)) self.connect((self.fft_vxx_1, 0), (self.digital_ofdm_frame_equalizer_vcvc_1, 0)) self.connect((self.my_random_source_limit_rate_0, 0), (self.blocks_stream_to_tagged_stream_0, 0)) self.connect((self.zeromq_pull_source_0, 0), (self.blocks_delay_0, 0)) self.connect((self.zeromq_pull_source_0, 0), (self.digital_ofdm_sync_sc_cfb_0, 0)) self.connect((self.zeromq_pull_source_0_0, 0), (self.digital_header_payload_demux_0, 0)) self.connect((self.zeromq_pull_source_0_0_0, 0), (self.digital_header_payload_demux_0, 1)) self.connect((self.zeromq_pull_source_0_0_0_0, 0), (self.digital_packet_headerparser_b_0, 0)) self.connect((self.zeromq_pull_source_0_0_0_0_0, 0), (self.fft_vxx_0, 0)) self.connect((self.zeromq_pull_source_0_0_0_0_0_0, 0), (self.fft_vxx_1, 0))
def __init__( self, ipp1="127.0.0.1", ipp2="127.0.0.1", ipp3="127.0.0.1", ipp4="127.0.0.1", iptx="127.0.0.1", samp_rate=10000 ): gr.top_block.__init__(self, "OFDM Rx") ################################################## # Parameters ################################################## self.ipp1 = ipp1 self.ipp2 = ipp2 self.ipp3 = ipp3 self.ipp4 = ipp4 self.iptx = iptx self.samp_rate = samp_rate ################################################## # 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.0, 0.0, 0.0, 0.0, 1.41421356, 0.0, -1.41421356, 0.0, 1.41421356, 0.0, -1.41421356, 0.0, -1.41421356, 0.0, -1.41421356, 0.0, 1.41421356, 0.0, -1.41421356, 0.0, 1.41421356, 0.0, -1.41421356, 0.0, -1.41421356, 0.0, -1.41421356, 0.0, -1.41421356, 0.0, 1.41421356, 0.0, -1.41421356, 0.0, 1.41421356, 0.0, 1.41421356, 0.0, 1.41421356, 0.0, -1.41421356, 0.0, 1.41421356, 0.0, 1.41421356, 0.0, 1.41421356, 0.0, -1.41421356, 0.0, 1.41421356, 0.0, 1.41421356, 0.0, 1.41421356, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ] 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 ) ################################################## # Blocks ################################################## self.zeromq_push_sink_0 = zeromq.push_sink(gr.sizeof_gr_complex, 1, "tcp://" + iptx + ":55500", 100, True) self.my_random_source_limit_rate_0 = my.random_source_limit_rate(10000000) self.my_number_sync_timestamp_0 = my.number_sync_timestamp() 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.channels_channel_model_0 = channels.channel_model( noise_voltage=0.0, frequency_offset=0.0, epsilon=1.0, taps=(1.0,), noise_seed=0, block_tags=False ) self.blocks_stream_to_tagged_stream_0 = blocks.stream_to_tagged_stream( gr.sizeof_char, 1, packet_len, packet_length_tag_key ) (self.blocks_stream_to_tagged_stream_0).set_max_output_buffer(1) ################################################## # Connections ################################################## self.connect((self.blocks_stream_to_tagged_stream_0, 0), (self.digital_ofdm_tx_0, 0)) self.connect((self.blocks_stream_to_tagged_stream_0, 0), (self.my_number_sync_timestamp_0, 0)) self.connect((self.channels_channel_model_0, 0), (self.zeromq_push_sink_0, 0)) self.connect((self.digital_ofdm_tx_0, 0), (self.channels_channel_model_0, 0)) self.connect((self.my_random_source_limit_rate_0, 0), (self.blocks_stream_to_tagged_stream_0, 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 ################################################## # Blocks ################################################## self.qtgui_histogram_sink_x_0 = qtgui.histogram_sink_f( 100000, 16, 0, 16, "", 1 ) self.qtgui_histogram_sink_x_0.set_update_time(0) self.qtgui_histogram_sink_x_0.enable_autoscale(True) self.qtgui_histogram_sink_x_0.enable_accumulate(True) self.qtgui_histogram_sink_x_0.enable_grid(False) if not True: self.qtgui_histogram_sink_x_0.disable_legend() labels = ["", "", "", "", "", "", "", "", "", ""] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "dark blue"] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_histogram_sink_x_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_histogram_sink_x_0.set_line_label(i, labels[i]) self.qtgui_histogram_sink_x_0.set_line_width(i, widths[i]) self.qtgui_histogram_sink_x_0.set_line_color(i, colors[i]) self.qtgui_histogram_sink_x_0.set_line_style(i, styles[i]) self.qtgui_histogram_sink_x_0.set_line_marker(i, markers[i]) self.qtgui_histogram_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_histogram_sink_x_0_win = sip.wrapinstance(self.qtgui_histogram_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_histogram_sink_x_0_win) self.my_random_source_limit_rate_0 = my.random_source_limit_rate(100000) self.my_number_sync_timestamp_0 = my.number_sync_timestamp() self.blocks_char_to_float_0 = blocks.char_to_float(1, 1) ################################################## # Connections ################################################## self.connect((self.blocks_char_to_float_0, 0), (self.qtgui_histogram_sink_x_0, 0)) self.connect((self.my_random_source_limit_rate_0, 0), (self.blocks_char_to_float_0, 0)) self.connect((self.my_random_source_limit_rate_0, 0), (self.my_number_sync_timestamp_0, 0))