def test_001(self): src_data = ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) trg_data = (-1, -1, 1, 1, -1, -1, 1, 1, -1, -1) src = blocks.vector_source_i(src_data) trg = blocks.vector_source_s(trg_data) op = blocks.burst_tagger(gr.sizeof_int) snk = blocks.tagged_file_sink(gr.sizeof_int, 1) self.tb.connect(src, (op,0)) self.tb.connect(trg, (op,1)) self.tb.connect(op, snk) self.tb.run() # Tagged file sink gets 2 burst tags at index 2 and index 5. # Creates two new files, each with two integers in them from # src_data at these indexes (3,4) and (7,8). file0 = "file{0}_0_2.00000000.dat".format(snk.unique_id()) file1 = "file{0}_1_6.00000000.dat".format(snk.unique_id()) # Open the files and read in the data, then remove the files # to clean up the directory. outfile0 = open(file0, 'rb') outfile1 = open(file1, 'rb') data0 = outfile0.read(8) data1 = outfile1.read(8) outfile0.close() outfile1.close() os.remove(file0) os.remove(file1) # Convert the 8 bytes from the files into a tuple of 2 ints. idata0 = struct.unpack('ii', data0) idata1 = struct.unpack('ii', data1) self.assertEqual(idata0, (3, 4)) self.assertEqual(idata1, (7, 8))
def test_001(self): src_data = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) trg_data = (-1, -1, 1, 1, -1, -1, 1, 1, -1, -1) src = blocks.vector_source_i(src_data) trg = blocks.vector_source_s(trg_data) op = blocks.burst_tagger(gr.sizeof_int) snk = blocks.tagged_file_sink(gr.sizeof_int, 1) self.tb.connect(src, (op, 0)) self.tb.connect(trg, (op, 1)) self.tb.connect(op, snk) self.tb.run() # Tagged file sink gets 2 burst tags at index 2 and index 5. # Creates two new files, each with two integers in them from # src_data at these indexes (3,4) and (7,8). file0 = "file{0}_0_2.00000000.dat".format(snk.unique_id()) file1 = "file{0}_1_6.00000000.dat".format(snk.unique_id()) # Open the files and read in the data, then remove the files # to clean up the directory. outfile0 = open(file0, 'rb') outfile1 = open(file1, 'rb') data0 = outfile0.read(8) data1 = outfile1.read(8) outfile0.close() outfile1.close() os.remove(file0) os.remove(file1) # Convert the 8 bytes from the files into a tuple of 2 ints. idata0 = struct.unpack('ii', data0) idata1 = struct.unpack('ii', data1) self.assertEqual(idata0, (3, 4)) self.assertEqual(idata1, (7, 8))
def __init__(self, uhd_address, options): gr.top_block.__init__(self) self.uhd_addr = uhd_address self.freq = options.freq self.samp_rate = options.samp_rate self.gain = options.gain self.threshold = options.threshold self.trigger = options.trigger self.uhd_src = uhd.single_usrp_source( device_addr=self.uhd_addr, stream_args=uhd.stream_args('fc32')) self.uhd_src.set_samp_rate(self.samp_rate) self.uhd_src.set_center_freq(self.freq, 0) self.uhd_src.set_gain(self.gain, 0) taps = firdes.low_pass_2(1, 1, 0.4, 0.1, 60) self.chanfilt = filter.fir_filter_ccc(10, taps) self.tagger = blocks.burst_tagger(gr.sizeof_gr_complex) # Dummy signaler to collect a burst on known periods data = 1000 * [0, ] + 1000 * [1, ] self.signal = blocks.vector_source_s(data, True) # Energy detector to get signal burst # use squelch to detect energy self.det = analog.simple_squelch_cc(self.threshold, 0.01) # convert to mag squared (float) self.c2m = blocks.complex_to_mag_squared() # average to debounce self.avg = filter.single_pole_iir_filter_ff(0.01) # rescale signal for conversion to short self.scale = blocks.multiply_const_ff(2**16) # signal input uses shorts self.f2s = blocks.float_to_short() # Use file sink burst tagger to capture bursts self.fsnk = blocks.tagged_file_sink( gr.sizeof_gr_complex, self.samp_rate) ################################################## # Connections ################################################## self.connect((self.uhd_src, 0), (self.tagger, 0)) self.connect((self.tagger, 0), (self.fsnk, 0)) if self.trigger: # Connect a dummy signaler to the burst tagger self.connect((self.signal, 0), (self.tagger, 1)) else: # Connect an energy detector signaler to the burst tagger self.connect(self.uhd_src, self.det) self.connect(self.det, self.c2m, self.avg, self.scale, self.f2s) self.connect(self.f2s, (self.tagger, 1))
def __init__(self, uhd_address, options): gr.top_block.__init__(self) self.uhd_addr = uhd_address self.freq = options.freq self.samp_rate = options.samp_rate self.gain = options.gain self.threshold = options.threshold self.trigger = options.trigger self.uhd_src = uhd.single_usrp_source( device_addr=self.uhd_addr, stream_args=uhd.stream_args('fc32')) self.uhd_src.set_samp_rate(self.samp_rate) self.uhd_src.set_center_freq(self.freq, 0) self.uhd_src.set_gain(self.gain, 0) taps = firdes.low_pass_2(1, 1, 0.4, 0.1, 60) self.chanfilt = filter.fir_filter_ccc(10, taps) self.tagger = blocks.burst_tagger(gr.sizeof_gr_complex) # Dummy signaler to collect a burst on known periods data = 1000*[0,] + 1000*[1,] self.signal = blocks.vector_source_s(data, True) # Energy detector to get signal burst ## use squelch to detect energy self.det = analog.simple_squelch_cc(self.threshold, 0.01) ## convert to mag squared (float) self.c2m = blocks.complex_to_mag_squared() ## average to debounce self.avg = filter.single_pole_iir_filter_ff(0.01) ## rescale signal for conversion to short self.scale = blocks.multiply_const_ff(2**16) ## signal input uses shorts self.f2s = blocks.float_to_short() # Use file sink burst tagger to capture bursts self.fsnk = blocks.tagged_file_sink(gr.sizeof_gr_complex, self.samp_rate) ################################################## # Connections ################################################## self.connect((self.uhd_src, 0), (self.tagger, 0)) self.connect((self.tagger, 0), (self.fsnk, 0)) if self.trigger: # Connect a dummy signaler to the burst tagger self.connect((self.signal, 0), (self.tagger, 1)) else: # Connect an energy detector signaler to the burst tagger self.connect(self.uhd_src, self.det) self.connect(self.det, self.c2m, self.avg, self.scale, self.f2s) self.connect(self.f2s, (self.tagger, 1))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.trigger = trigger = -1 self.samp_rate = samp_rate = 20000000 ################################################## # Blocks ################################################## self.wxgui_waterfallsink2_0 = waterfallsink2.waterfall_sink_c( self.GetWin(), baseband_freq=1.4e9, dynamic_range=100, ref_level=0, ref_scale=2.0, sample_rate=samp_rate, fft_size=8192, fft_rate=25, average=False, avg_alpha=None, title="Waterfall Plot", ) self.Add(self.wxgui_waterfallsink2_0.win) self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + "" ) self.osmosdr_source_0.set_sample_rate(samp_rate) self.osmosdr_source_0.set_center_freq(288e6, 0) self.osmosdr_source_0.set_freq_corr(0, 0) self.osmosdr_source_0.set_dc_offset_mode(0, 0) self.osmosdr_source_0.set_iq_balance_mode(0, 0) self.osmosdr_source_0.set_gain_mode(False, 0) self.osmosdr_source_0.set_gain(10, 0) self.osmosdr_source_0.set_if_gain(24, 0) self.osmosdr_source_0.set_bb_gain(20, 0) self.osmosdr_source_0.set_antenna("", 0) self.osmosdr_source_0.set_bandwidth(4000000, 0) self.blocks_tagged_file_sink_0 = blocks.tagged_file_sink(gr.sizeof_gr_complex*1, samp_rate) self.blocks_burst_tagger_0 = blocks.burst_tagger(gr.sizeof_gr_complex) self.blocks_burst_tagger_0.set_true_tag("burst",True) self.blocks_burst_tagger_0.set_false_tag("burst",False) self.analog_const_source_x_0 = analog.sig_source_s(0, analog.GR_CONST_WAVE, 0, 0, trigger) ################################################## # Connections ################################################## self.connect((self.analog_const_source_x_0, 0), (self.blocks_burst_tagger_0, 1)) self.connect((self.blocks_burst_tagger_0, 0), (self.blocks_tagged_file_sink_0, 0)) self.connect((self.osmosdr_source_0, 0), (self.blocks_burst_tagger_0, 0)) self.connect((self.osmosdr_source_0, 0), (self.wxgui_waterfallsink2_0, 0))
def __init__(self, source_path): gr.top_block.__init__(self, "Top Block") source_directory, source_filename = os.path.split(source_path) source_filename, source_extension = os.path.splitext(source_filename) target_signal, carrier_freq, sampling_rate, start_date, start_time, capture_device = source_filename.split('_') wav_file = (source_extension.upper() == ".WAV") if sampling_rate[-1].upper() == 'M': sampling_rate = float(sampling_rate[:-1]) * 1e6 else: raise RuntimeError('Unsupported sampling rate "%s"' % sampling_rate) start_timestamp = iso8601.datetime.strptime(start_date + ' ' + start_time, '%Y%m%d %H%M%Sz') utc = pytz.utc start_timestamp = utc.localize(start_timestamp) f_ts = open('timestamp.txt', 'w') f_ts.write(start_timestamp.isoformat()) f_ts.close() ################################################## # Variables ################################################## self.samp_rate = samp_rate = sampling_rate self.average_window = average_window = 1000 ################################################## # Blocks ################################################## if wav_file: self.blocks_wavfile_source_0 = blocks.wavfile_source(source_path, False) self.blocks_float_to_complex_0 = blocks.float_to_complex(1) else: self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, source_path, False) self.burst_detector = burst_detector() self.blocks_tagged_file_sink_0 = blocks.tagged_file_sink(gr.sizeof_gr_complex*1, samp_rate) ################################################## # Connections ################################################## if wav_file: self.connect((self.blocks_wavfile_source_0, 0), (self.blocks_float_to_complex_0, 0)) self.connect((self.blocks_wavfile_source_0, 1), (self.blocks_float_to_complex_0, 1)) self.connect((self.blocks_float_to_complex_0, 0), (self.burst_detector, 0)) else: self.connect((self.blocks_file_source_0, 0), (self.burst_detector, 0)) self.connect((self.burst_detector, 0), (self.blocks_tagged_file_sink_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.vec_length = vec_length = int(100e3) self.samp_rate = samp_rate = 2e6 self.folder = folder = "/home/erik/Dev/mini-hackathon/HackaCurtain/data/test/" self.center_freq = center_freq = 433.5e6 ################################################## # Blocks ################################################## self.trigger_trigger_ff_0 = trigger.trigger_ff(0.5, int(200)) self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + "" ) self.osmosdr_source_0.set_sample_rate(samp_rate) self.osmosdr_source_0.set_center_freq(center_freq, 0) self.osmosdr_source_0.set_freq_corr(0, 0) self.osmosdr_source_0.set_dc_offset_mode(0, 0) self.osmosdr_source_0.set_iq_balance_mode(0, 0) self.osmosdr_source_0.set_gain_mode(False, 0) self.osmosdr_source_0.set_gain(20, 0) self.osmosdr_source_0.set_if_gain(30, 0) self.osmosdr_source_0.set_bb_gain(30, 0) self.osmosdr_source_0.set_antenna("", 0) self.osmosdr_source_0.set_bandwidth(0, 0) self.blocks_threshold_ff_0 = blocks.threshold_ff(0.08, 0.14, 0) self.blocks_tagged_file_sink_0 = blocks.tagged_file_sink(gr.sizeof_float*1, int(samp_rate)) self.blocks_float_to_short_0 = blocks.float_to_short(1, 1) self.blocks_complex_to_mag_0 = blocks.complex_to_mag(1) self.blocks_burst_tagger_0 = blocks.burst_tagger(gr.sizeof_float) self.blocks_burst_tagger_0.set_true_tag("burst",True) self.blocks_burst_tagger_0.set_false_tag("burst",False) ################################################## # Connections ################################################## self.connect((self.blocks_burst_tagger_0, 0), (self.blocks_tagged_file_sink_0, 0)) self.connect((self.blocks_complex_to_mag_0, 0), (self.blocks_threshold_ff_0, 0)) self.connect((self.blocks_float_to_short_0, 0), (self.blocks_burst_tagger_0, 1)) self.connect((self.blocks_threshold_ff_0, 0), (self.blocks_burst_tagger_0, 0)) self.connect((self.blocks_threshold_ff_0, 0), (self.trigger_trigger_ff_0, 0)) self.connect((self.osmosdr_source_0, 0), (self.blocks_complex_to_mag_0, 0)) self.connect((self.trigger_trigger_ff_0, 0), (self.blocks_float_to_short_0, 0))
def __init__(self): gr.top_block.__init__(self, "Ask Rx Top Raspi") ################################################## # Variables ################################################## self.sound_card_sample_rate = sound_card_sample_rate = 44000 self.samples_per_symbol = samples_per_symbol = 19 self.symbol_rate = symbol_rate = sound_card_sample_rate / samples_per_symbol self.bits_per_symbol = bits_per_symbol = 1 self.variable_rrc_filter_taps = variable_rrc_filter_taps = firdes.root_raised_cosine( 1, sound_card_sample_rate, symbol_rate, 0.5, 70) self.bit_rate = bit_rate = symbol_rate / bits_per_symbol ################################################## # Blocks ################################################## self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_fff( samples_per_symbol, 0.5, (variable_rrc_filter_taps), 32, 0, 1.5, 1) self.digital_hdlc_deframer_bp_0 = digital.hdlc_deframer_bp(32, 500) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_float * 1, sound_card_sample_rate, True) self.blocks_threshold_ff_0 = blocks.threshold_ff(-0.01, 0.01, 0) self.blocks_tagged_file_sink_0 = blocks.tagged_file_sink( gr.sizeof_char * 1, bit_rate) self.blocks_pdu_to_tagged_stream_0 = blocks.pdu_to_tagged_stream( blocks.byte_t, 'burst') self.blocks_float_to_char_0 = blocks.float_to_char(1, 1) self.audio_source_0 = audio.source(sound_card_sample_rate, '', True) ################################################## # Connections ################################################## self.msg_connect((self.digital_hdlc_deframer_bp_0, 'out'), (self.blocks_pdu_to_tagged_stream_0, 'pdus')) self.connect((self.audio_source_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.blocks_float_to_char_0, 0), (self.digital_hdlc_deframer_bp_0, 0)) self.connect((self.blocks_pdu_to_tagged_stream_0, 0), (self.blocks_tagged_file_sink_0, 0)) self.connect((self.blocks_threshold_ff_0, 0), (self.blocks_float_to_char_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.blocks_threshold_ff_0, 0))
def main(): data = scipy.arange(0, 32000, 1).tolist() trig = 100*[0,] + 100*[1,] src = blocks.vector_source_s(data, True) trigger = blocks.vector_source_s(trig, True) thr = blocks.throttle(gr.sizeof_short, 10e3) ann = blocks.annotator_alltoall(1000000, gr.sizeof_short) tagger = blocks.burst_tagger(gr.sizeof_short) fsnk = blocks.tagged_file_sink(gr.sizeof_short, 1) tb = gr.top_block() tb.connect(src, thr, (tagger, 0)) tb.connect(trigger, (tagger, 1)) tb.connect(tagger, fsnk) tb.run()
def __init__(self, source_path): gr.top_block.__init__(self, "Top Block") source_directory, source_filename = os.path.split(source_path) source_filename, source_extension = os.path.splitext(source_filename) target_signal, carrier_freq, sampling_rate, start_date, start_time, capture_device = source_filename.split( '_') if sampling_rate[-1].upper() == 'M': sampling_rate = float(sampling_rate[:-1]) * 1e6 else: raise RuntimeError('Unsupported sampling rate "%s"' % sampling_rate) start_timestamp = iso8601.datetime.strptime( start_date + ' ' + start_time, '%Y%m%d %H%M%Sz') utc = pytz.utc start_timestamp = utc.localize(start_timestamp) f_ts = open('timestamp.txt', 'w') f_ts.write(start_timestamp.isoformat()) f_ts.close() ################################################## # Variables ################################################## self.samp_rate = samp_rate = sampling_rate self.average_window = average_window = 1000 ################################################## # Blocks ################################################## self.blocks_file_source_0 = blocks.file_source( gr.sizeof_gr_complex * 1, source_path, False) self.burst_detector = burst_detector() self.blocks_tagged_file_sink_0 = blocks.tagged_file_sink( gr.sizeof_gr_complex * 1, samp_rate) ################################################## # Connections ################################################## self.connect((self.blocks_file_source_0, 0), (self.burst_detector, 0)) self.connect((self.burst_detector, 0), (self.blocks_tagged_file_sink_0, 0))
def __init__(self, bits_per_symbol=2, rolloff=0.5, sound_card_sample_rate=22000): gr.top_block.__init__(self, "If Psk Rx Rpi") #TODO: CHECK BOUNDARIES OF INPUT PARAMETERS ################################################## # Variables ################################################## self.if_decimation = if_decimation = 2 self.sound_card_sample_rate = sound_card_sample_rate self.samples_per_symbol = samples_per_symbol = 16 / if_decimation self.symbol_rate = symbol_rate = sound_card_sample_rate / if_decimation / samples_per_symbol self.bits_per_symbol = bits_per_symbol self.rolloff = rolloff self.hdlc_packet_overhead = hdlc_packet_overhead = 6 * 8 self.hdlc_packet_length = hdlc_packet_length = 16 * 8 self.channel_bit_rate = channel_bit_rate = symbol_rate * bits_per_symbol self.variable_rrc_filter_taps = variable_rrc_filter_taps = firdes.root_raised_cosine( 1, sound_card_sample_rate / if_decimation, symbol_rate, rolloff, 11 * samples_per_symbol) self.source_bit_rate = source_bit_rate = channel_bit_rate * hdlc_packet_length / ( hdlc_packet_overhead + hdlc_packet_length) self.if_frequency = if_frequency = sound_card_sample_rate / 4 ################################################## # Blocks ################################################## self.raspi_decoder_psk_constellation_decoder_0 = raspi_decoder.psk_constellation_decoder( bits_per_symbol=bits_per_symbol, differential=True, mod_code="gray", debug=False, ) self.low_pass_filter_0_0 = filter.fir_filter_fff( if_decimation, firdes.low_pass(1.66, sound_card_sample_rate, symbol_rate * (1 + rolloff), sound_card_sample_rate / 8, firdes.WIN_HANN, 6.76)) self.low_pass_filter_0 = filter.fir_filter_fff( if_decimation, firdes.low_pass(1.66, sound_card_sample_rate, symbol_rate * (1 + rolloff), sound_card_sample_rate / 8, firdes.WIN_HANN, 6.76)) self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_ccf( samples_per_symbol, 2 * math.pi / 100, (variable_rrc_filter_taps), 32, 0, 3, 1) self.digital_hdlc_deframer_bp_0 = digital.hdlc_deframer_bp( hdlc_packet_length / 8, hdlc_packet_length) self.digital_costas_loop_cc_0 = digital.costas_loop_cc( 2 * math.pi / 100 * 2, 8, True) self.blocks_tagged_file_sink_0 = blocks.tagged_file_sink( gr.sizeof_char * 1, source_bit_rate) self.blocks_pdu_to_tagged_stream_0 = blocks.pdu_to_tagged_stream( blocks.byte_t, "burst") self.blocks_multiply_xx_0_0 = blocks.multiply_vff(1) self.blocks_multiply_xx_0 = blocks.multiply_vff(1) self.blocks_float_to_complex_0 = blocks.float_to_complex(1) self.audio_source_0 = audio.source(sound_card_sample_rate, "", True) self.analog_sig_source_x_0_0 = analog.sig_source_f( sound_card_sample_rate, analog.GR_COS_WAVE, if_frequency, 1, 0) self.analog_sig_source_x_0 = analog.sig_source_f( sound_card_sample_rate, analog.GR_SIN_WAVE, if_frequency, 1, 0) ################################################## # Connections ################################################## self.msg_connect((self.digital_hdlc_deframer_bp_0, 'out'), (self.blocks_pdu_to_tagged_stream_0, 'pdus')) self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0_0, 1)) self.connect((self.analog_sig_source_x_0_0, 0), (self.blocks_multiply_xx_0, 0)) self.connect((self.audio_source_0, 0), (self.blocks_multiply_xx_0, 1)) self.connect((self.audio_source_0, 0), (self.blocks_multiply_xx_0_0, 0)) self.connect((self.blocks_float_to_complex_0, 0), (self.digital_costas_loop_cc_0, 0)) self.connect((self.blocks_multiply_xx_0, 0), (self.low_pass_filter_0_0, 0)) self.connect((self.blocks_multiply_xx_0_0, 0), (self.low_pass_filter_0, 0)) self.connect((self.blocks_pdu_to_tagged_stream_0, 0), (self.blocks_tagged_file_sink_0, 0)) self.connect((self.digital_costas_loop_cc_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.raspi_decoder_psk_constellation_decoder_0, 0)) self.connect((self.low_pass_filter_0, 0), (self.blocks_float_to_complex_0, 1)) self.connect((self.low_pass_filter_0_0, 0), (self.blocks_float_to_complex_0, 0)) self.connect((self.raspi_decoder_psk_constellation_decoder_0, 0), (self.digital_hdlc_deframer_bp_0, 0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) ################################################## # Variables ################################################## self.vec_length = vec_length = int(100e3) self.samp_rate = samp_rate = 2e6 self.folder = folder = "/home/erik/Dev/mini-hackathon/HackaCurtain/data/test/" self.center_freq = center_freq = 433.3e6 ################################################## # Blocks ################################################## self.wxgui_scopesink2_2 = scopesink2.scope_sink_f( self.GetWin(), title='Scope Plot', sample_rate=samp_rate, v_scale=0, v_offset=0, t_scale=0, ac_couple=False, xy_mode=False, num_inputs=1, trig_mode=wxgui.TRIG_MODE_AUTO, y_axis_label='Counts', ) self.Add(self.wxgui_scopesink2_2.win) self.trigger_trigger_ff_0_0 = trigger.trigger_ff(0.01, 1000) self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + '' ) self.osmosdr_source_0.set_sample_rate(samp_rate) self.osmosdr_source_0.set_center_freq(center_freq, 0) self.osmosdr_source_0.set_freq_corr(0, 0) self.osmosdr_source_0.set_dc_offset_mode(0, 0) self.osmosdr_source_0.set_iq_balance_mode(2, 0) self.osmosdr_source_0.set_gain_mode(False, 0) self.osmosdr_source_0.set_gain(30, 0) self.osmosdr_source_0.set_if_gain(40, 0) self.osmosdr_source_0.set_bb_gain(30, 0) self.osmosdr_source_0.set_antenna('', 0) self.osmosdr_source_0.set_bandwidth(0, 0) self.low_pass_filter_0 = filter.fir_filter_ccf(1, firdes.low_pass( 1, samp_rate, 200e3, 10e4, firdes.WIN_HAMMING, 6.76)) self.blocks_threshold_ff_0 = blocks.threshold_ff(1.33, 1.4, 0) self.blocks_tagged_file_sink_0_0 = blocks.tagged_file_sink(gr.sizeof_float*1, int(samp_rate)) self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vff((10000, )) self.blocks_moving_average_xx_0 = blocks.moving_average_ff(1000, 1.0/10000, 40, 1) self.blocks_float_to_short_0_0 = blocks.float_to_short(1, 1) self.blocks_complex_to_mag_squared_0 = blocks.complex_to_mag_squared(1) self.blocks_burst_tagger_0_0 = blocks.burst_tagger(gr.sizeof_float) self.blocks_burst_tagger_0_0.set_true_tag('burst',True) self.blocks_burst_tagger_0_0.set_false_tag('burst',False) ################################################## # Connections ################################################## self.connect((self.blocks_burst_tagger_0_0, 0), (self.blocks_tagged_file_sink_0_0, 0)) self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.blocks_multiply_const_vxx_0, 0)) self.connect((self.blocks_float_to_short_0_0, 0), (self.blocks_burst_tagger_0_0, 1)) self.connect((self.blocks_moving_average_xx_0, 0), (self.blocks_burst_tagger_0_0, 0)) self.connect((self.blocks_moving_average_xx_0, 0), (self.blocks_threshold_ff_0, 0)) self.connect((self.blocks_moving_average_xx_0, 0), (self.wxgui_scopesink2_2, 0)) self.connect((self.blocks_multiply_const_vxx_0, 0), (self.blocks_moving_average_xx_0, 0)) self.connect((self.blocks_threshold_ff_0, 0), (self.trigger_trigger_ff_0_0, 0)) self.connect((self.low_pass_filter_0, 0), (self.blocks_complex_to_mag_squared_0, 0)) self.connect((self.osmosdr_source_0, 0), (self.low_pass_filter_0, 0)) self.connect((self.trigger_trigger_ff_0_0, 0), (self.blocks_float_to_short_0_0, 0))
def __init__(self): gr.top_block.__init__(self, "Recepteur ADSB -Mode-S") Qt.QWidget.__init__(self) self.setWindowTitle("Recepteur ADSB -Mode-S") 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", "adsb_receiver") try: if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): self.restoreGeometry(self.settings.value("geometry").toByteArray()) else: self.restoreGeometry(self.settings.value("geometry")) except: pass ################################################## # Variables ################################################## self.seuil = seuil = 0.003 self.samp_rate = samp_rate = 2000000 self.freq = freq = 1090000000 ################################################## # Blocks ################################################## self._seuil_range = Range(0.0001, 0.3, 0.0001, 0.003, 200) self._seuil_win = RangeWidget(self._seuil_range, self.set_seuil, 'Seuil', "counter_slider", float) self.top_grid_layout.addWidget(self._seuil_win, 0, 1, 1, 1) for r in range(0, 1): self.top_grid_layout.setRowStretch(r, 1) for c in range(1, 2): self.top_grid_layout.setColumnStretch(c, 1) self._freq_range = Range(950000000, 1093000000, 10000, 1090000000, 200) self._freq_win = RangeWidget(self._freq_range, self.set_freq, 'Frequency', "counter_slider", float) self.top_grid_layout.addWidget(self._freq_win, 0, 0, 1, 1) for r in range(0, 1): self.top_grid_layout.setRowStretch(r, 1) for c in range(0, 1): self.top_grid_layout.setColumnStretch(c, 1) self.figures = Qt.QTabWidget() self.figures_widget_0 = Qt.QWidget() self.figures_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.figures_widget_0) self.figures_grid_layout_0 = Qt.QGridLayout() self.figures_layout_0.addLayout(self.figures_grid_layout_0) self.figures.addTab(self.figures_widget_0, 'Waterfall (recu)') self.figures_widget_1 = Qt.QWidget() self.figures_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.figures_widget_1) self.figures_grid_layout_1 = Qt.QGridLayout() self.figures_layout_1.addLayout(self.figures_grid_layout_1) self.figures.addTab(self.figures_widget_1, 'Spectre (recu)') self.figures_widget_2 = Qt.QWidget() self.figures_layout_2 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.figures_widget_2) self.figures_grid_layout_2 = Qt.QGridLayout() self.figures_layout_2.addLayout(self.figures_grid_layout_2) self.figures.addTab(self.figures_widget_2, 'Rx: temporel / bits') self.top_grid_layout.addWidget(self.figures, 1, 0, 3, 2) for r in range(1, 4): self.top_grid_layout.setRowStretch(r, 1) for c in range(0, 2): self.top_grid_layout.setColumnStretch(c, 1) self.rtlsdr_source_0_0 = osmosdr.source( args="numchan=" + str(1) + " " + '' ) self.rtlsdr_source_0_0.set_time_unknown_pps(osmosdr.time_spec_t()) self.rtlsdr_source_0_0.set_sample_rate(samp_rate) self.rtlsdr_source_0_0.set_center_freq(freq, 0) self.rtlsdr_source_0_0.set_freq_corr(0, 0) self.rtlsdr_source_0_0.set_gain(14, 0) self.rtlsdr_source_0_0.set_if_gain(24, 0) self.rtlsdr_source_0_0.set_bb_gain(20, 0) self.rtlsdr_source_0_0.set_antenna('', 0) self.rtlsdr_source_0_0.set_bandwidth(samp_rate, 0) self.qtgui_waterfall_sink_x_0 = qtgui.waterfall_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc samp_rate, #bw "Spectre", #name 1 #number of inputs ) self.qtgui_waterfall_sink_x_0.set_update_time(0.10) self.qtgui_waterfall_sink_x_0.enable_grid(False) self.qtgui_waterfall_sink_x_0.enable_axis_labels(True) labels = ['', '', '', '', '', '', '', '', '', ''] colors = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in range(1): if len(labels[i]) == 0: self.qtgui_waterfall_sink_x_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_waterfall_sink_x_0.set_line_label(i, labels[i]) self.qtgui_waterfall_sink_x_0.set_color_map(i, colors[i]) self.qtgui_waterfall_sink_x_0.set_line_alpha(i, alphas[i]) self.qtgui_waterfall_sink_x_0.set_intensity_range(-140, 10) self._qtgui_waterfall_sink_x_0_win = sip.wrapinstance(self.qtgui_waterfall_sink_x_0.pyqwidget(), Qt.QWidget) self.figures_layout_0.addWidget(self._qtgui_waterfall_sink_x_0_win) self.qtgui_time_sink_x_0_2 = qtgui.time_sink_f( 250, #size samp_rate, #samp_rate "", #name 1 #number of inputs ) self.qtgui_time_sink_x_0_2.set_update_time(0.10) self.qtgui_time_sink_x_0_2.set_y_axis(-0.1, 1.1) self.qtgui_time_sink_x_0_2.set_y_label('Manchester bits', "") self.qtgui_time_sink_x_0_2.enable_tags(True) self.qtgui_time_sink_x_0_2.set_trigger_mode(qtgui.TRIG_MODE_TAG, qtgui.TRIG_SLOPE_POS, 0.0, 0.000008, 0, "burst") self.qtgui_time_sink_x_0_2.enable_autoscale(False) self.qtgui_time_sink_x_0_2.enable_grid(False) self.qtgui_time_sink_x_0_2.enable_axis_labels(True) self.qtgui_time_sink_x_0_2.enable_control_panel(True) self.qtgui_time_sink_x_0_2.enable_stem_plot(False) labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ['blue', 'red', 'green', 'black', 'cyan', 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [8, -1, -1, -1, -1, -1, -1, -1, -1, -1] for i in range(1): if len(labels[i]) == 0: self.qtgui_time_sink_x_0_2.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_0_2.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0_2.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0_2.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0_2.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0_2.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0_2.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_2_win = sip.wrapinstance(self.qtgui_time_sink_x_0_2.pyqwidget(), Qt.QWidget) self.figures_grid_layout_2.addWidget(self._qtgui_time_sink_x_0_2_win, 0, 1, 1, 1) for r in range(0, 1): self.figures_grid_layout_2.setRowStretch(r, 1) for c in range(1, 2): self.figures_grid_layout_2.setColumnStretch(c, 1) self.qtgui_time_sink_x_0_0 = qtgui.time_sink_f( 1024, #size samp_rate, #samp_rate "", #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(-1, 1) self.qtgui_time_sink_x_0_0.set_y_label('Rx mag2', "") self.qtgui_time_sink_x_0_0.enable_tags(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(True) self.qtgui_time_sink_x_0_0.enable_stem_plot(True) labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ['blue', 'red', 'green', 'black', 'cyan', 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue'] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] for i in range(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.figures_grid_layout_2.addWidget(self._qtgui_time_sink_x_0_0_win, 0, 0, 1, 1) for r in range(0, 1): self.figures_grid_layout_2.setRowStretch(r, 1) for c in range(0, 1): self.figures_grid_layout_2.setColumnStretch(c, 1) self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype freq, #fc samp_rate, #bw "", #name 1 ) 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) labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "dark blue"] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in range(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.figures_layout_1.addWidget(self._qtgui_freq_sink_x_0_win) self.digital_correlate_access_code_tag_xx_0 = digital.correlate_access_code_tag_bb('010100001010000001001010110', 0, 'burst') self.blocks_uchar_to_float_0 = blocks.uchar_to_float() self.blocks_threshold_ff_0 = blocks.threshold_ff(seuil, seuil, 0) self.blocks_tagged_file_sink_0 = blocks.tagged_file_sink(gr.sizeof_char*1, samp_rate) self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_char*1) self.blocks_float_to_uchar_0 = blocks.float_to_uchar() self.blocks_complex_to_mag_0 = blocks.complex_to_mag(1) self.blocks_burst_tagger_0 = blocks.burst_tagger(gr.sizeof_char) self.blocks_burst_tagger_0.set_true_tag('',True) self.blocks_burst_tagger_0.set_false_tag('burst',False) self.analog_sig_source_x_1 = analog.sig_source_s(samp_rate, analog.GR_COS_WAVE, 80, 1, 0, 0) ################################################## # Connections ################################################## self.connect((self.analog_sig_source_x_1, 0), (self.blocks_burst_tagger_0, 1)) self.connect((self.blocks_burst_tagger_0, 0), (self.blocks_null_sink_0, 0)) self.connect((self.blocks_burst_tagger_0, 0), (self.blocks_tagged_file_sink_0, 0)) self.connect((self.blocks_complex_to_mag_0, 0), (self.blocks_threshold_ff_0, 0)) self.connect((self.blocks_complex_to_mag_0, 0), (self.qtgui_time_sink_x_0_0, 0)) self.connect((self.blocks_float_to_uchar_0, 0), (self.digital_correlate_access_code_tag_xx_0, 0)) self.connect((self.blocks_threshold_ff_0, 0), (self.blocks_float_to_uchar_0, 0)) self.connect((self.blocks_uchar_to_float_0, 0), (self.qtgui_time_sink_x_0_2, 0)) self.connect((self.digital_correlate_access_code_tag_xx_0, 0), (self.blocks_burst_tagger_0, 0)) self.connect((self.digital_correlate_access_code_tag_xx_0, 0), (self.blocks_uchar_to_float_0, 0)) self.connect((self.rtlsdr_source_0_0, 0), (self.blocks_complex_to_mag_0, 0)) self.connect((self.rtlsdr_source_0_0, 0), (self.qtgui_freq_sink_x_0, 0)) self.connect((self.rtlsdr_source_0_0, 0), (self.qtgui_waterfall_sink_x_0, 0))
def __init__(self): gr.top_block.__init__(self, "If Psk Rx") Qt.QWidget.__init__(self) self.setWindowTitle("If Psk Rx") 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", "if_psk_rx") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.if_decimation = if_decimation = 2 self.sound_card_sample_rate = sound_card_sample_rate = 11025 self.samples_per_symbol = samples_per_symbol = 16 / if_decimation self.symbol_rate = symbol_rate = sound_card_sample_rate / if_decimation / samples_per_symbol self.bits_per_symbol = bits_per_symbol = 2 self.rolloff = rolloff = 0.5 self.hdlc_packet_overhead = hdlc_packet_overhead = 6 * 8 self.hdlc_packet_length = hdlc_packet_length = 16 * 8 self.channel_bit_rate = channel_bit_rate = symbol_rate * bits_per_symbol self.variable_rrc_filter_taps = variable_rrc_filter_taps = firdes.root_raised_cosine( 1, sound_card_sample_rate / if_decimation, symbol_rate, rolloff, 11 * samples_per_symbol) self.source_bit_rate = source_bit_rate = channel_bit_rate * hdlc_packet_length / ( hdlc_packet_overhead + hdlc_packet_length) self.if_frequency = if_frequency = sound_card_sample_rate / 4 ################################################## # Blocks ################################################## self.raspi_decoder_psk_constellation_decoder_0 = raspi_decoder.psk_constellation_decoder( bits_per_symbol=bits_per_symbol, differential=True, mod_code="gray", debug=False, ) self.qtgui_time_sink_x_1_0 = qtgui.time_sink_f( 1024, #size source_bit_rate, #samp_rate "Received packets", #name 1 #number of inputs ) self.qtgui_time_sink_x_1_0.set_update_time(0.10) self.qtgui_time_sink_x_1_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_1_0.set_y_label("Amplitude", "") self.qtgui_time_sink_x_1_0.enable_tags(-1, True) self.qtgui_time_sink_x_1_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_1_0.enable_autoscale(True) self.qtgui_time_sink_x_1_0.enable_grid(False) self.qtgui_time_sink_x_1_0.enable_control_panel(False) if not True: self.qtgui_time_sink_x_1_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_1_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_1_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_1_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_1_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_1_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_1_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_1_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_1_0_win = sip.wrapinstance( self.qtgui_time_sink_x_1_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_time_sink_x_1_0_win) self.qtgui_time_sink_x_1 = qtgui.time_sink_f( 1024, #size channel_bit_rate, #samp_rate "Decoded bits", #name 1 #number of inputs ) self.qtgui_time_sink_x_1.set_update_time(0.10) self.qtgui_time_sink_x_1.set_y_axis(-1, 1) self.qtgui_time_sink_x_1.set_y_label("Amplitude", "") self.qtgui_time_sink_x_1.enable_tags(-1, True) self.qtgui_time_sink_x_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_1.enable_autoscale(True) self.qtgui_time_sink_x_1.enable_grid(False) self.qtgui_time_sink_x_1.enable_control_panel(False) if not True: self.qtgui_time_sink_x_1.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_1.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_1.set_line_label(i, labels[i]) self.qtgui_time_sink_x_1.set_line_width(i, widths[i]) self.qtgui_time_sink_x_1.set_line_color(i, colors[i]) self.qtgui_time_sink_x_1.set_line_style(i, styles[i]) self.qtgui_time_sink_x_1.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_1.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_1_win = sip.wrapinstance( self.qtgui_time_sink_x_1.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_time_sink_x_1_win) self.qtgui_time_sink_x_0_0 = qtgui.time_sink_f( 1024, #size sound_card_sample_rate / if_decimation, #samp_rate "Frequency synchronizer state", #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(-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(True) self.qtgui_time_sink_x_0_0.enable_grid(False) self.qtgui_time_sink_x_0_0.enable_control_panel(False) if not True: self.qtgui_time_sink_x_0_0.disable_legend() labels = ["Frequency", "Phase", "Error", "", "", "", "", "", "", ""] 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 symbol_rate, #samp_rate "Symbol synchronizer state", #name 3 #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_control_panel(False) if not True: self.qtgui_time_sink_x_0.disable_legend() labels = ["Error", "Rate", "Phase", "", "", "", "", "", "", ""] 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(3): 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_sink_x_0_0 = qtgui.sink_c( 1024, #fftsize firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc sound_card_sample_rate / if_decimation, #bw "Phase synchronized baseband signal", #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.qtgui_sink_x_0 = qtgui.sink_c( 1024, #fftsize firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc sound_card_sample_rate / if_decimation, #bw "Baseband I&Q signal", #name True, #plotfreq True, #plotwaterfall True, #plottime True, #plotconst ) self.qtgui_sink_x_0.set_update_time(1.0 / 10) self._qtgui_sink_x_0_win = sip.wrapinstance( self.qtgui_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_sink_x_0_win) self.qtgui_sink_x_0.enable_rf_freq(False) self.qtgui_const_sink_x_0 = qtgui.const_sink_c( 1024, #size "Synchronized symbols", #name 1 #number of inputs ) self.qtgui_const_sink_x_0.set_update_time(0.10) self.qtgui_const_sink_x_0.set_y_axis(-2, 2) self.qtgui_const_sink_x_0.set_x_axis(-2, 2) self.qtgui_const_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") self.qtgui_const_sink_x_0.enable_autoscale(True) self.qtgui_const_sink_x_0.enable_grid(False) if not True: self.qtgui_const_sink_x_0.disable_legend() labels = ["", "", "", "", "", "", "", "", "", ""] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "red", "red", "red", "red", "red", "red", "red", "red" ] styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_const_sink_x_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_const_sink_x_0.set_line_label(i, labels[i]) self.qtgui_const_sink_x_0.set_line_width(i, widths[i]) self.qtgui_const_sink_x_0.set_line_color(i, colors[i]) self.qtgui_const_sink_x_0.set_line_style(i, styles[i]) self.qtgui_const_sink_x_0.set_line_marker(i, markers[i]) self.qtgui_const_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_const_sink_x_0_win = sip.wrapinstance( self.qtgui_const_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_const_sink_x_0_win) self.low_pass_filter_0_0 = filter.fir_filter_fff( if_decimation, firdes.low_pass(1.66, sound_card_sample_rate, symbol_rate * (1 + rolloff), sound_card_sample_rate / 8, firdes.WIN_HANN, 6.76)) self.low_pass_filter_0 = filter.fir_filter_fff( if_decimation, firdes.low_pass(1.66, sound_card_sample_rate, symbol_rate * (1 + rolloff), sound_card_sample_rate / 8, firdes.WIN_HANN, 6.76)) self.final_0 = qtgui.sink_f( 1024, #fftsize firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc sound_card_sample_rate, #bw "IF received signal", #name True, #plotfreq True, #plotwaterfall True, #plottime False, #plotconst ) self.final_0.set_update_time(1.0 / 10) self._final_0_win = sip.wrapinstance(self.final_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._final_0_win) self.final_0.enable_rf_freq(False) self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_ccf( samples_per_symbol, 2 * math.pi / 100, (variable_rrc_filter_taps), 32, 0, 3, 1) self.digital_hdlc_deframer_bp_0 = digital.hdlc_deframer_bp( hdlc_packet_length / 8, hdlc_packet_length) self.digital_costas_loop_cc_0 = digital.costas_loop_cc( 2 * math.pi / 100 * 2, 8, True) self.blocks_wavfile_source_0 = blocks.wavfile_source( "rx_signal.wav", False) self.blocks_uchar_to_float_0_0 = blocks.uchar_to_float() self.blocks_uchar_to_float_0 = blocks.uchar_to_float() self.blocks_throttle_0 = blocks.throttle(gr.sizeof_float * 1, sound_card_sample_rate, True) self.blocks_tagged_file_sink_0 = blocks.tagged_file_sink( gr.sizeof_char * 1, source_bit_rate) self.blocks_pdu_to_tagged_stream_0 = blocks.pdu_to_tagged_stream( blocks.byte_t, "burst") self.blocks_multiply_xx_0_0 = blocks.multiply_vff(1) self.blocks_multiply_xx_0 = blocks.multiply_vff(1) self.blocks_float_to_complex_0 = blocks.float_to_complex(1) self.analog_sig_source_x_0_0 = analog.sig_source_f( sound_card_sample_rate, analog.GR_COS_WAVE, if_frequency, 1, 0) self.analog_sig_source_x_0 = analog.sig_source_f( sound_card_sample_rate, analog.GR_SIN_WAVE, if_frequency, 1, 0) ################################################## # Connections ################################################## self.msg_connect((self.digital_hdlc_deframer_bp_0, 'out'), (self.blocks_pdu_to_tagged_stream_0, 'pdus')) self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0_0, 1)) self.connect((self.analog_sig_source_x_0_0, 0), (self.blocks_multiply_xx_0, 0)) self.connect((self.blocks_float_to_complex_0, 0), (self.digital_costas_loop_cc_0, 0)) self.connect((self.blocks_float_to_complex_0, 0), (self.qtgui_sink_x_0, 0)) self.connect((self.blocks_multiply_xx_0, 0), (self.low_pass_filter_0_0, 0)) self.connect((self.blocks_multiply_xx_0_0, 0), (self.low_pass_filter_0, 0)) self.connect((self.blocks_pdu_to_tagged_stream_0, 0), (self.blocks_tagged_file_sink_0, 0)) self.connect((self.blocks_pdu_to_tagged_stream_0, 0), (self.blocks_uchar_to_float_0_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.blocks_multiply_xx_0, 1)) self.connect((self.blocks_throttle_0, 0), (self.blocks_multiply_xx_0_0, 0)) self.connect((self.blocks_uchar_to_float_0, 0), (self.qtgui_time_sink_x_1, 0)) self.connect((self.blocks_uchar_to_float_0_0, 0), (self.qtgui_time_sink_x_1_0, 0)) self.connect((self.blocks_wavfile_source_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.blocks_wavfile_source_0, 0), (self.final_0, 0)) self.connect((self.digital_costas_loop_cc_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0)) self.connect((self.digital_costas_loop_cc_0, 0), (self.qtgui_sink_x_0_0, 0)) self.connect((self.digital_costas_loop_cc_0, 1), (self.qtgui_time_sink_x_0_0, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.qtgui_const_sink_x_0, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 1), (self.qtgui_time_sink_x_0, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 3), (self.qtgui_time_sink_x_0, 2)) self.connect((self.digital_pfb_clock_sync_xxx_0, 2), (self.qtgui_time_sink_x_0, 1)) self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.raspi_decoder_psk_constellation_decoder_0, 0)) self.connect((self.low_pass_filter_0, 0), (self.blocks_float_to_complex_0, 1)) self.connect((self.low_pass_filter_0_0, 0), (self.blocks_float_to_complex_0, 0)) self.connect((self.raspi_decoder_psk_constellation_decoder_0, 0), (self.blocks_uchar_to_float_0, 0)) self.connect((self.raspi_decoder_psk_constellation_decoder_0, 0), (self.digital_hdlc_deframer_bp_0, 0))
def __init__(self): gr.top_block.__init__(self, "Tlm Ana") Qt.QWidget.__init__(self) self.setWindowTitle("Tlm Ana") 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", "tlm_ana") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.sps = sps = 40 self.nfilt = nfilt = 40 self.audio_rate = audio_rate = 48e3 self.samp_rate = samp_rate = 300e3 self.rrc_taps = rrc_taps = firdes.root_raised_cosine( nfilt * 1.0, audio_rate, 1200.0, 0.35, 16 * sps) self.ch_rate = ch_rate = 96e3 ################################################## # Blocks ################################################## self.root_raised_cosine_filter_0 = filter.fir_filter_fff( 1, firdes.root_raised_cosine(1.0, audio_rate, 1200.0, 0.35, 16 * 40)) self.rational_resampler_xxx_0 = filter.rational_resampler_ccc( interpolation=int(ch_rate), decimation=int(samp_rate), taps=None, fractional_bw=None, ) self.qtgui_time_sink_x_0 = qtgui.time_sink_f( 8192 * 8, #size audio_rate, #samp_rate "", #name 2 #number of inputs ) self.qtgui_time_sink_x_0.set_update_time(0.10) self.qtgui_time_sink_x_0.set_y_axis(-15, 15) 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_TAG, qtgui.TRIG_SLOPE_POS, 0.0, 50e-3, 0, 'start') self.qtgui_time_sink_x_0.enable_autoscale(False) self.qtgui_time_sink_x_0.enable_grid(True) self.qtgui_time_sink_x_0.enable_axis_labels(True) self.qtgui_time_sink_x_0.enable_control_panel(False) if not False: self.qtgui_time_sink_x_0.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "red", "blue", "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(2): 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_freq_sink_x_0 = qtgui.freq_sink_c( 4096, #size firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc samp_rate, #bw "", #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(-100, -20) 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(True) self.qtgui_freq_sink_x_0.set_fft_average(0.2) self.qtgui_freq_sink_x_0.enable_axis_labels(True) self.qtgui_freq_sink_x_0.enable_control_panel(False) if not False: self.qtgui_freq_sink_x_0.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_freq_sink_x_0.set_plot_pos_half(not True) labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "dark blue" ] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_freq_sink_x_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_0.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_0.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_0.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_0_win = sip.wrapinstance( self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_freq_sink_x_0_win) self.fft_filter_xxx_2 = filter.fft_filter_ccc( 1, (firdes.low_pass(1, audio_rate, 1e3, 1e3, firdes.WIN_BLACKMAN)), 1) self.fft_filter_xxx_2.declare_sample_delay(0) self.fft_filter_xxx_1 = filter.fft_filter_fff(1, (firdes.band_pass( 1, audio_rate, 700, 2700, 500, firdes.WIN_BLACKMAN)), 1) self.fft_filter_xxx_1.declare_sample_delay(0) self.fft_filter_xxx_0 = filter.fft_filter_ccc( 1, (firdes.low_pass(1, samp_rate, 5e3, 1e3, firdes.WIN_BLACKMAN)), 1) self.fft_filter_xxx_0.declare_sample_delay(0) self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb() self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1, samp_rate, True) self.blocks_threshold_ff_0 = blocks.threshold_ff(0.5, 0.7, 0) self.blocks_tagged_file_sink_0 = blocks.tagged_file_sink( gr.sizeof_char * 1, int(audio_rate)) self.blocks_rotator_cc_1 = blocks.rotator_cc( (-1700 / audio_rate) * 2 * math.pi) self.blocks_rotator_cc_0 = blocks.rotator_cc(-(-16.2e3 / samp_rate) * 2 * math.pi) self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_float * 1) self.blocks_multiply_const_vxx_5 = blocks.multiply_const_vcc((2, )) self.blocks_multiply_const_vxx_4 = blocks.multiply_const_vff((1.0, )) self.blocks_multiply_const_vxx_3 = blocks.multiply_const_vff((1, )) self.blocks_multiply_const_vxx_2 = blocks.multiply_const_vff((7, )) self.blocks_multiply_const_vxx_1 = blocks.multiply_const_vff((1e4, )) self.blocks_moving_average_xx_0 = blocks.moving_average_ff( 400, 1.0 / 400, 4000) self.blocks_keep_one_in_n_2 = blocks.keep_one_in_n( gr.sizeof_float * 1, 5) self.blocks_keep_one_in_n_1 = blocks.keep_one_in_n( gr.sizeof_float * 1, 2) self.blocks_float_to_short_0 = blocks.float_to_short(1, 1) self.blocks_float_to_complex_0 = blocks.float_to_complex(1) self.blocks_float_to_char_0 = blocks.float_to_char(1, 1) self.blocks_file_source_0 = blocks.file_source( gr.sizeof_gr_complex * 1, '/home/handiko/gqrx_20180319_072938_433268400_300000_fc.raw', True) self.blocks_delay_3 = blocks.delay(gr.sizeof_float * 1, 0) self.blocks_delay_2 = blocks.delay(gr.sizeof_short * 1, 2400) self.blocks_delay_1 = blocks.delay(gr.sizeof_short * 1, 400) self.blocks_delay_0 = blocks.delay(gr.sizeof_float * 1, 400) self.blocks_complex_to_mag_squared_0 = blocks.complex_to_mag_squared(1) self.blocks_char_to_float_0 = blocks.char_to_float(1, 1) self.blocks_burst_tagger_1 = blocks.burst_tagger(gr.sizeof_float) self.blocks_burst_tagger_1.set_true_tag('burst', True) self.blocks_burst_tagger_1.set_false_tag('burst', False) self.blocks_burst_tagger_0 = blocks.burst_tagger(gr.sizeof_float) self.blocks_burst_tagger_0.set_true_tag('start', True) self.blocks_burst_tagger_0.set_false_tag('stop', False) self.blocks_add_const_vxx_3 = blocks.add_const_vff((-5, )) self.blocks_add_const_vxx_2 = blocks.add_const_vff((5, )) self.blocks_add_const_vxx_1 = blocks.add_const_vff((48, )) self.blocks_add_const_vxx_0 = blocks.add_const_vff((0, )) self.analog_quadrature_demod_cf_0 = analog.quadrature_demod_cf( audio_rate / (2 * math.pi * 1e3 / 8.0)) self.analog_nbfm_rx_0 = analog.nbfm_rx( audio_rate=int(audio_rate), quad_rate=int(ch_rate), tau=75e-6, max_dev=5e3, ) ################################################## # Connections ################################################## self.connect((self.analog_nbfm_rx_0, 0), (self.fft_filter_xxx_1, 0)) self.connect((self.analog_quadrature_demod_cf_0, 0), (self.root_raised_cosine_filter_0, 0)) self.connect((self.blocks_add_const_vxx_0, 0), (self.blocks_burst_tagger_1, 0)) self.connect((self.blocks_add_const_vxx_1, 0), (self.blocks_keep_one_in_n_2, 0)) self.connect((self.blocks_add_const_vxx_2, 0), (self.qtgui_time_sink_x_0, 0)) self.connect((self.blocks_add_const_vxx_3, 0), (self.qtgui_time_sink_x_0, 1)) self.connect((self.blocks_burst_tagger_0, 0), (self.blocks_delay_0, 0)) self.connect((self.blocks_burst_tagger_1, 0), (self.blocks_add_const_vxx_1, 0)) self.connect((self.blocks_burst_tagger_1, 0), (self.blocks_null_sink_0, 0)) self.connect((self.blocks_char_to_float_0, 0), (self.blocks_add_const_vxx_0, 0)) self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.blocks_multiply_const_vxx_1, 0)) self.connect((self.blocks_delay_0, 0), (self.blocks_multiply_const_vxx_2, 0)) self.connect((self.blocks_delay_1, 0), (self.blocks_burst_tagger_0, 1)) self.connect((self.blocks_delay_2, 0), (self.blocks_burst_tagger_1, 1)) self.connect((self.blocks_delay_3, 0), (self.blocks_multiply_const_vxx_3, 0)) self.connect((self.blocks_file_source_0, 0), (self.blocks_rotator_cc_0, 0)) self.connect((self.blocks_float_to_char_0, 0), (self.blocks_tagged_file_sink_0, 0)) self.connect((self.blocks_float_to_complex_0, 0), (self.blocks_rotator_cc_1, 0)) self.connect((self.blocks_float_to_short_0, 0), (self.blocks_delay_1, 0)) self.connect((self.blocks_float_to_short_0, 0), (self.blocks_delay_2, 0)) self.connect((self.blocks_keep_one_in_n_1, 0), (self.blocks_float_to_short_0, 0)) self.connect((self.blocks_keep_one_in_n_2, 0), (self.blocks_float_to_char_0, 0)) self.connect((self.blocks_moving_average_xx_0, 0), (self.blocks_threshold_ff_0, 0)) self.connect((self.blocks_multiply_const_vxx_1, 0), (self.blocks_moving_average_xx_0, 0)) self.connect((self.blocks_multiply_const_vxx_2, 0), (self.blocks_add_const_vxx_2, 0)) self.connect((self.blocks_multiply_const_vxx_3, 0), (self.blocks_add_const_vxx_3, 0)) self.connect((self.blocks_multiply_const_vxx_4, 0), (self.digital_binary_slicer_fb_0, 0)) self.connect((self.blocks_multiply_const_vxx_5, 0), (self.blocks_throttle_0, 0)) self.connect((self.blocks_rotator_cc_0, 0), (self.blocks_multiply_const_vxx_5, 0)) self.connect((self.blocks_rotator_cc_1, 0), (self.fft_filter_xxx_2, 0)) self.connect((self.blocks_threshold_ff_0, 0), (self.blocks_keep_one_in_n_1, 0)) self.connect((self.blocks_throttle_0, 0), (self.fft_filter_xxx_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.qtgui_freq_sink_x_0, 0)) self.connect((self.digital_binary_slicer_fb_0, 0), (self.blocks_char_to_float_0, 0)) self.connect((self.fft_filter_xxx_0, 0), (self.rational_resampler_xxx_0, 0)) self.connect((self.fft_filter_xxx_1, 0), (self.blocks_burst_tagger_0, 0)) self.connect((self.fft_filter_xxx_1, 0), (self.blocks_float_to_complex_0, 0)) self.connect((self.fft_filter_xxx_2, 0), (self.analog_quadrature_demod_cf_0, 0)) self.connect((self.rational_resampler_xxx_0, 0), (self.analog_nbfm_rx_0, 0)) self.connect((self.rational_resampler_xxx_0, 0), (self.blocks_complex_to_mag_squared_0, 0)) self.connect((self.root_raised_cosine_filter_0, 0), (self.blocks_delay_3, 0)) self.connect((self.root_raised_cosine_filter_0, 0), (self.blocks_multiply_const_vxx_4, 0))
def __init__(self): gr.top_block.__init__(self, "Rx Top") Qt.QWidget.__init__(self) self.setWindowTitle("Rx Top") 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", "rx_top") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.sound_card_sample_rate = sound_card_sample_rate = 44000 self.samples_per_symbol = samples_per_symbol = 19 self.symbol_rate = symbol_rate = sound_card_sample_rate / samples_per_symbol self.bits_per_symbol = bits_per_symbol = 1 self.variable_rrc_filter_taps = variable_rrc_filter_taps = firdes.root_raised_cosine( 1, sound_card_sample_rate, symbol_rate, 0.5, 70) self.bit_rate = bit_rate = symbol_rate / bits_per_symbol ################################################## # Blocks ################################################## self.qtgui_time_sink_x_1_2_0 = qtgui.time_sink_f( 500, #size sound_card_sample_rate, #samp_rate "Filtered signal", #name 1 #number of inputs ) self.qtgui_time_sink_x_1_2_0.set_update_time(0.10) self.qtgui_time_sink_x_1_2_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_1_2_0.set_y_label('Amplitude', "") self.qtgui_time_sink_x_1_2_0.enable_tags(-1, True) self.qtgui_time_sink_x_1_2_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_1_2_0.enable_autoscale(True) self.qtgui_time_sink_x_1_2_0.enable_grid(False) self.qtgui_time_sink_x_1_2_0.enable_axis_labels(True) self.qtgui_time_sink_x_1_2_0.enable_control_panel(False) if not True: self.qtgui_time_sink_x_1_2_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_1_2_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_1_2_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_1_2_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_1_2_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_1_2_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_1_2_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_1_2_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_1_2_0_win = sip.wrapinstance( self.qtgui_time_sink_x_1_2_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_time_sink_x_1_2_0_win) self.qtgui_time_sink_x_1_2 = qtgui.time_sink_f( 500, #size symbol_rate, #samp_rate "Synchronization phase", #name 1 #number of inputs ) self.qtgui_time_sink_x_1_2.set_update_time(0.10) self.qtgui_time_sink_x_1_2.set_y_axis(-1, 1) self.qtgui_time_sink_x_1_2.set_y_label('Amplitude', "") self.qtgui_time_sink_x_1_2.enable_tags(-1, True) self.qtgui_time_sink_x_1_2.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_1_2.enable_autoscale(True) self.qtgui_time_sink_x_1_2.enable_grid(False) self.qtgui_time_sink_x_1_2.enable_axis_labels(True) self.qtgui_time_sink_x_1_2.enable_control_panel(False) if not True: self.qtgui_time_sink_x_1_2.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_1_2.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_1_2.set_line_label(i, labels[i]) self.qtgui_time_sink_x_1_2.set_line_width(i, widths[i]) self.qtgui_time_sink_x_1_2.set_line_color(i, colors[i]) self.qtgui_time_sink_x_1_2.set_line_style(i, styles[i]) self.qtgui_time_sink_x_1_2.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_1_2.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_1_2_win = sip.wrapinstance( self.qtgui_time_sink_x_1_2.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_time_sink_x_1_2_win) self.qtgui_time_sink_x_1_1 = qtgui.time_sink_f( 500, #size symbol_rate, #samp_rate "Synchronization rate", #name 1 #number of inputs ) self.qtgui_time_sink_x_1_1.set_update_time(0.10) self.qtgui_time_sink_x_1_1.set_y_axis(-1, 1) self.qtgui_time_sink_x_1_1.set_y_label('Amplitude', "") self.qtgui_time_sink_x_1_1.enable_tags(-1, True) self.qtgui_time_sink_x_1_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_1_1.enable_autoscale(True) self.qtgui_time_sink_x_1_1.enable_grid(False) self.qtgui_time_sink_x_1_1.enable_axis_labels(True) self.qtgui_time_sink_x_1_1.enable_control_panel(False) if not True: self.qtgui_time_sink_x_1_1.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_1_1.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_1_1.set_line_label(i, labels[i]) self.qtgui_time_sink_x_1_1.set_line_width(i, widths[i]) self.qtgui_time_sink_x_1_1.set_line_color(i, colors[i]) self.qtgui_time_sink_x_1_1.set_line_style(i, styles[i]) self.qtgui_time_sink_x_1_1.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_1_1.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_1_1_win = sip.wrapinstance( self.qtgui_time_sink_x_1_1.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_time_sink_x_1_1_win) self.qtgui_time_sink_x_1_0 = qtgui.time_sink_f( 500, #size symbol_rate, #samp_rate "Synchronization error", #name 1 #number of inputs ) self.qtgui_time_sink_x_1_0.set_update_time(0.10) self.qtgui_time_sink_x_1_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_1_0.set_y_label('Amplitude', "") self.qtgui_time_sink_x_1_0.enable_tags(-1, True) self.qtgui_time_sink_x_1_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_1_0.enable_autoscale(True) self.qtgui_time_sink_x_1_0.enable_grid(False) self.qtgui_time_sink_x_1_0.enable_axis_labels(True) self.qtgui_time_sink_x_1_0.enable_control_panel(False) if not True: self.qtgui_time_sink_x_1_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_1_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_1_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_1_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_1_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_1_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_1_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_1_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_1_0_win = sip.wrapinstance( self.qtgui_time_sink_x_1_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_time_sink_x_1_0_win) self.qtgui_time_sink_x_1 = qtgui.time_sink_f( 50, #size symbol_rate, #samp_rate "Received symbols", #name 1 #number of inputs ) self.qtgui_time_sink_x_1.set_update_time(0.10) self.qtgui_time_sink_x_1.set_y_axis(-1, 1) self.qtgui_time_sink_x_1.set_y_label('Amplitude', "") self.qtgui_time_sink_x_1.enable_tags(-1, True) self.qtgui_time_sink_x_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_1.enable_autoscale(True) self.qtgui_time_sink_x_1.enable_grid(False) self.qtgui_time_sink_x_1.enable_axis_labels(True) self.qtgui_time_sink_x_1.enable_control_panel(False) if not True: self.qtgui_time_sink_x_1.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_1.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_1.set_line_label(i, labels[i]) self.qtgui_time_sink_x_1.set_line_width(i, widths[i]) self.qtgui_time_sink_x_1.set_line_color(i, colors[i]) self.qtgui_time_sink_x_1.set_line_style(i, styles[i]) self.qtgui_time_sink_x_1.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_1.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_1_win = sip.wrapinstance( self.qtgui_time_sink_x_1.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_time_sink_x_1_win) self.qtgui_sink_x_0_1 = qtgui.sink_f( 1024, #fftsize firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc sound_card_sample_rate, #bw "sync symbols", #name True, #plotfreq True, #plotwaterfall True, #plottime True, #plotconst ) self.qtgui_sink_x_0_1.set_update_time(1.0 / 10) self._qtgui_sink_x_0_1_win = sip.wrapinstance( self.qtgui_sink_x_0_1.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_sink_x_0_1_win) self.qtgui_sink_x_0_1.enable_rf_freq(False) self.qtgui_sink_x_0 = qtgui.sink_f( 1024, #fftsize firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc sound_card_sample_rate, #bw "received-symbol", #name True, #plotfreq True, #plotwaterfall True, #plottime True, #plotconst ) self.qtgui_sink_x_0.set_update_time(1.0 / 10) self._qtgui_sink_x_0_win = sip.wrapinstance( self.qtgui_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_sink_x_0_win) self.qtgui_sink_x_0.enable_rf_freq(False) self.fft_filter_xxx_0 = filter.fft_filter_fff( 1, (variable_rrc_filter_taps), 1) self.fft_filter_xxx_0.declare_sample_delay(0) self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_fff( samples_per_symbol, 0.5, (variable_rrc_filter_taps), 32, 0, 1.5, 1) self.digital_hdlc_deframer_bp_0 = digital.hdlc_deframer_bp(32, 500) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_float * 1, sound_card_sample_rate, True) self.blocks_threshold_ff_0 = blocks.threshold_ff(-0.01, 0.01, 0) self.blocks_tagged_file_sink_0 = blocks.tagged_file_sink( gr.sizeof_char * 1, bit_rate) self.blocks_pdu_to_tagged_stream_0 = blocks.pdu_to_tagged_stream( blocks.byte_t, 'burst') self.blocks_float_to_char_0 = blocks.float_to_char(1, 1) self.audio_source_0 = audio.source(sound_card_sample_rate, '', True) ################################################## # Connections ################################################## self.msg_connect((self.digital_hdlc_deframer_bp_0, 'out'), (self.blocks_pdu_to_tagged_stream_0, 'pdus')) self.connect((self.audio_source_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.audio_source_0, 0), (self.qtgui_sink_x_0, 0)) self.connect((self.blocks_float_to_char_0, 0), (self.digital_hdlc_deframer_bp_0, 0)) self.connect((self.blocks_pdu_to_tagged_stream_0, 0), (self.blocks_tagged_file_sink_0, 0)) self.connect((self.blocks_threshold_ff_0, 0), (self.blocks_float_to_char_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.blocks_threshold_ff_0, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.fft_filter_xxx_0, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.qtgui_sink_x_0_1, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.qtgui_time_sink_x_1, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 1), (self.qtgui_time_sink_x_1_0, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 2), (self.qtgui_time_sink_x_1_1, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 3), (self.qtgui_time_sink_x_1_2, 0)) self.connect((self.fft_filter_xxx_0, 0), (self.qtgui_time_sink_x_1_2_0, 0))
def __init__(self): gr.top_block.__init__(self, "RX Narrowband Receiver") Qt.QWidget.__init__(self) self.setWindowTitle("RX Narrowband Receiver") 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", "rx_narrow_host") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.filename = filename = "./data/" + datetime.datetime.utcnow( ).strftime("%Y%m%d_%H%M%S") + "_UTC.iq" self.checkbox_record = checkbox_record = False self.vec_length = vec_length = 1 self.variable_qtgui_label_1 = variable_qtgui_label_1 = filename self.variable_qtgui_label_0 = variable_qtgui_label_0 = checkbox_record self.sim_amplitude = sim_amplitude = 1e-1 self.samp_rate = samp_rate = 1e6 self.rx_gain = rx_gain = 50 self.n_channels = n_channels = 100 self.freq_select = freq_select = 0 self.freq = freq = 400e6 self.fft_size = fft_size = 1024 self.data_seconds = data_seconds = 300 self.client_address = client_address = "192.168.10.184" ################################################## # Blocks ################################################## self.tabs = Qt.QTabWidget() self.tabs_widget_0 = Qt.QWidget() self.tabs_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.tabs_widget_0) self.tabs_grid_layout_0 = Qt.QGridLayout() self.tabs_layout_0.addLayout(self.tabs_grid_layout_0) self.tabs.addTab(self.tabs_widget_0, 'Real-Time Display') self.top_grid_layout.addWidget(self.tabs, 0, 0, 1, 2) for r in range(0, 1): self.top_grid_layout.setRowStretch(r, 1) for c in range(0, 2): self.top_grid_layout.setColumnStretch(c, 1) self._freq_select_range = Range(-1 * (samp_rate / 2), 1 * (samp_rate / 2), 1, 0, 100) self._freq_select_win = RangeWidget(self._freq_select_range, self.set_freq_select, 'Narrowband Select (Hz)', "counter_slider", float) self.tabs_grid_layout_0.addWidget(self._freq_select_win, 2, 0, 1, 1) for r in range(2, 3): self.tabs_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.tabs_grid_layout_0.setColumnStretch(c, 1) _checkbox_record_check_box = Qt.QCheckBox('Write Data') self._checkbox_record_choices = {True: True, False: False} self._checkbox_record_choices_inv = dict( (v, k) for k, v in self._checkbox_record_choices.iteritems()) self._checkbox_record_callback = lambda i: Qt.QMetaObject.invokeMethod( _checkbox_record_check_box, "setChecked", Qt.Q_ARG("bool", self._checkbox_record_choices_inv[i])) self._checkbox_record_callback(self.checkbox_record) _checkbox_record_check_box.stateChanged.connect( lambda i: self.set_checkbox_record(self._checkbox_record_choices[ bool(i)])) self.tabs_grid_layout_0.addWidget(_checkbox_record_check_box, 4, 0, 1, 1) for r in range(4, 5): self.tabs_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.tabs_grid_layout_0.setColumnStretch(c, 1) self.xmlrpc_client0_0 = xmlrpclib.Server('http://192.168.10.184:30000') self.xmlrpc_client0 = xmlrpclib.Server('http://192.168.10.184:30000') self._variable_qtgui_label_1_tool_bar = Qt.QToolBar(self) if None: self._variable_qtgui_label_1_formatter = None else: self._variable_qtgui_label_1_formatter = lambda x: str(x) self._variable_qtgui_label_1_tool_bar.addWidget( Qt.QLabel('Recording File Name' + ": ")) self._variable_qtgui_label_1_label = Qt.QLabel( str( self._variable_qtgui_label_1_formatter( self.variable_qtgui_label_1))) self._variable_qtgui_label_1_tool_bar.addWidget( self._variable_qtgui_label_1_label) self.tabs_grid_layout_0.addWidget( self._variable_qtgui_label_1_tool_bar, 3, 0, 1, 1) for r in range(3, 4): self.tabs_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.tabs_grid_layout_0.setColumnStretch(c, 1) self._variable_qtgui_label_0_tool_bar = Qt.QToolBar(self) if None: self._variable_qtgui_label_0_formatter = None else: self._variable_qtgui_label_0_formatter = lambda x: eng_notation.num_to_str( x) self._variable_qtgui_label_0_tool_bar.addWidget( Qt.QLabel('Recording?' + ": ")) self._variable_qtgui_label_0_label = Qt.QLabel( str( self._variable_qtgui_label_0_formatter( self.variable_qtgui_label_0))) self._variable_qtgui_label_0_tool_bar.addWidget( self._variable_qtgui_label_0_label) self.tabs_grid_layout_0.addWidget( self._variable_qtgui_label_0_tool_bar, 4, 1, 1, 1) for r in range(4, 5): self.tabs_grid_layout_0.setRowStretch(r, 1) for c in range(1, 2): self.tabs_grid_layout_0.setColumnStretch(c, 1) self._rx_gain_range = Range(0, 80, 1, 50, 100) self._rx_gain_win = RangeWidget(self._rx_gain_range, self.set_rx_gain, 'RX Gain', "counter_slider", float) self.tabs_grid_layout_0.addWidget(self._rx_gain_win, 1, 0, 1, 1) for r in range(1, 2): self.tabs_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.tabs_grid_layout_0.setColumnStretch(c, 1) self.rational_resampler_xxx_0 = filter.rational_resampler_ccc( interpolation=1, decimation=n_channels, taps=None, fractional_bw=None, ) self.qtgui_waterfall_sink_x_0 = qtgui.waterfall_sink_c( fft_size, #size firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc samp_rate, #bw "", #name 1 #number of inputs ) self.qtgui_waterfall_sink_x_0.set_update_time(0.10) self.qtgui_waterfall_sink_x_0.enable_grid(False) self.qtgui_waterfall_sink_x_0.enable_axis_labels(True) if not True: self.qtgui_waterfall_sink_x_0.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_waterfall_sink_x_0.set_plot_pos_half(not True) labels = ['', '', '', '', '', '', '', '', '', ''] colors = [3, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_waterfall_sink_x_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_waterfall_sink_x_0.set_line_label(i, labels[i]) self.qtgui_waterfall_sink_x_0.set_color_map(i, colors[i]) self.qtgui_waterfall_sink_x_0.set_line_alpha(i, alphas[i]) self.qtgui_waterfall_sink_x_0.set_intensity_range(-100, -40) self._qtgui_waterfall_sink_x_0_win = sip.wrapinstance( self.qtgui_waterfall_sink_x_0.pyqwidget(), Qt.QWidget) self.tabs_grid_layout_0.addWidget(self._qtgui_waterfall_sink_x_0_win, 2, 1, 2, 1) for r in range(2, 4): self.tabs_grid_layout_0.setRowStretch(r, 1) for c in range(1, 2): self.tabs_grid_layout_0.setColumnStretch(c, 1) self.qtgui_freq_sink_x_0_0 = qtgui.freq_sink_c( fft_size, #size firdes.WIN_HANN, #wintype 0, #fc samp_rate / n_channels, #bw "", #name 1 #number of inputs ) self.qtgui_freq_sink_x_0_0.set_update_time(0.1) self.qtgui_freq_sink_x_0_0.set_y_axis(-120, -20) self.qtgui_freq_sink_x_0_0.set_y_label('Magnitude', '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(True) 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 False: 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 = ['', 'RXA', 'RXB', '', '', '', '', '', '', ''] widths = [1, 2, 2, 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.tabs_grid_layout_0.addWidget(self._qtgui_freq_sink_x_0_0_win, 0, 2, 2, 1) for r in range(0, 2): self.tabs_grid_layout_0.setRowStretch(r, 1) for c in range(2, 3): self.tabs_grid_layout_0.setColumnStretch(c, 1) self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c( fft_size, #size firdes.WIN_HANN, #wintype 0, #fc samp_rate, #bw "", #name 1 #number of inputs ) self.qtgui_freq_sink_x_0.set_update_time(0.1) self.qtgui_freq_sink_x_0.set_y_axis(-120, -20) self.qtgui_freq_sink_x_0.set_y_label('Magnitude', '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(True) 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 False: 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 = ['', 'RXA', 'RXB', '', '', '', '', '', '', ''] widths = [1, 2, 2, 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.tabs_grid_layout_0.addWidget(self._qtgui_freq_sink_x_0_win, 0, 1, 2, 1) for r in range(0, 2): self.tabs_grid_layout_0.setRowStretch(r, 1) for c in range(1, 2): self.tabs_grid_layout_0.setColumnStretch(c, 1) self.qtgui_const_sink_x_0 = qtgui.const_sink_c( fft_size, #size "", #name 1 #number of inputs ) self.qtgui_const_sink_x_0.set_update_time(0.10) self.qtgui_const_sink_x_0.set_y_axis(-0.1, 0.1) self.qtgui_const_sink_x_0.set_x_axis(-0.1, 0.1) self.qtgui_const_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") self.qtgui_const_sink_x_0.enable_autoscale(False) self.qtgui_const_sink_x_0.enable_grid(True) self.qtgui_const_sink_x_0.enable_axis_labels(True) if not True: self.qtgui_const_sink_x_0.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = [ "blue", "red", "red", "red", "red", "red", "red", "red", "red", "red" ] styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_const_sink_x_0.set_line_label( i, "Data {0}".format(i)) else: self.qtgui_const_sink_x_0.set_line_label(i, labels[i]) self.qtgui_const_sink_x_0.set_line_width(i, widths[i]) self.qtgui_const_sink_x_0.set_line_color(i, colors[i]) self.qtgui_const_sink_x_0.set_line_style(i, styles[i]) self.qtgui_const_sink_x_0.set_line_marker(i, markers[i]) self.qtgui_const_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_const_sink_x_0_win = sip.wrapinstance( self.qtgui_const_sink_x_0.pyqwidget(), Qt.QWidget) self.tabs_grid_layout_0.addWidget(self._qtgui_const_sink_x_0_win, 2, 2, 2, 1) for r in range(2, 4): self.tabs_grid_layout_0.setRowStretch(r, 1) for c in range(2, 3): self.tabs_grid_layout_0.setColumnStretch(c, 1) self._freq_range = Range(100e6, 6000e6, 1e6, 400e6, 100) self._freq_win = RangeWidget(self._freq_range, self.set_freq, 'RF Freq (Hz)', "counter_slider", float) self.tabs_grid_layout_0.addWidget(self._freq_win, 0, 0, 1, 1) for r in range(0, 1): self.tabs_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.tabs_grid_layout_0.setColumnStretch(c, 1) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex * 1, samp_rate, True) self.blocks_tagged_file_sink_0 = blocks.tagged_file_sink( gr.sizeof_gr_complex * 1, int(samp_rate)) self.blocks_multiply_xx_0 = blocks.multiply_vcc(1) self.blocks_float_to_short_0 = blocks.float_to_short(1, 1) self.blocks_burst_tagger_0 = blocks.burst_tagger(gr.sizeof_gr_complex) self.blocks_burst_tagger_0.set_true_tag('burst', True) self.blocks_burst_tagger_0.set_false_tag('burst', False) self.blocks_add_xx_0 = blocks.add_vcc(1) self.analog_sig_source_x_1 = analog.sig_source_c( samp_rate, analog.GR_COS_WAVE, 1000, sim_amplitude, 0) self.analog_sig_source_x_0 = analog.sig_source_c( samp_rate, analog.GR_COS_WAVE, -1 * freq_select, 1, 0) self.analog_noise_source_x_0 = analog.noise_source_c( analog.GR_GAUSSIAN, sim_amplitude * 1e-1, 0) self.analog_const_source_x_0 = analog.sig_source_f( 0, analog.GR_CONST_WAVE, 0, 0, checkbox_record) ################################################## # Connections ################################################## self.connect((self.analog_const_source_x_0, 0), (self.blocks_float_to_short_0, 0)) self.connect((self.analog_noise_source_x_0, 0), (self.blocks_add_xx_0, 1)) self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0, 1)) self.connect((self.analog_sig_source_x_1, 0), (self.blocks_add_xx_0, 0)) self.connect((self.blocks_add_xx_0, 0), (self.blocks_throttle_0, 0)) self.connect((self.blocks_burst_tagger_0, 0), (self.blocks_tagged_file_sink_0, 0)) self.connect((self.blocks_float_to_short_0, 0), (self.blocks_burst_tagger_0, 1)) self.connect((self.blocks_multiply_xx_0, 0), (self.rational_resampler_xxx_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.blocks_multiply_xx_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.qtgui_freq_sink_x_0, 0)) self.connect((self.blocks_throttle_0, 0), (self.qtgui_waterfall_sink_x_0, 0)) self.connect((self.rational_resampler_xxx_0, 0), (self.blocks_burst_tagger_0, 0)) self.connect((self.rational_resampler_xxx_0, 0), (self.qtgui_const_sink_x_0, 0)) self.connect((self.rational_resampler_xxx_0, 0), (self.qtgui_freq_sink_x_0_0, 0))
def __init__(self): gr.top_block.__init__(self, "Not titled yet") Qt.QWidget.__init__(self) self.setWindowTitle("Not titled yet") 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", "zock") try: if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"): self.restoreGeometry(self.settings.value("geometry").toByteArray()) else: self.restoreGeometry(self.settings.value("geometry")) except: pass ################################################## # Variables ################################################## self.xlate_bandwidth = xlate_bandwidth = 100000 self.samp_rate = samp_rate = 2000000 self.freq_offset = freq_offset = 120k ################################################## # Blocks ################################################## self.rtlsdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + "rtl=0" ) self.rtlsdr_source_0.set_time_unknown_pps(osmosdr.time_spec_t()) self.rtlsdr_source_0.set_sample_rate(samp_rate) self.rtlsdr_source_0.set_center_freq(152.0e6, 0) self.rtlsdr_source_0.set_freq_corr(0, 0) self.rtlsdr_source_0.set_gain(10, 0) self.rtlsdr_source_0.set_if_gain(20, 0) self.rtlsdr_source_0.set_bb_gain(20, 0) self.rtlsdr_source_0.set_antenna('', 0) self.rtlsdr_source_0.set_bandwidth(0, 0) self.qtgui_waterfall_sink_x_0 = qtgui.waterfall_sink_c( 1024, #size firdes.WIN_BLACKMAN_hARRIS, #wintype 0, #fc samp_rate, #bw "", #name 1 #number of inputs ) self.qtgui_waterfall_sink_x_0.set_update_time(0.10) self.qtgui_waterfall_sink_x_0.enable_grid(False) self.qtgui_waterfall_sink_x_0.enable_axis_labels(True) labels = ['', '', '', '', '', '', '', '', '', ''] colors = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in range(1): if len(labels[i]) == 0: self.qtgui_waterfall_sink_x_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_waterfall_sink_x_0.set_line_label(i, labels[i]) self.qtgui_waterfall_sink_x_0.set_color_map(i, colors[i]) self.qtgui_waterfall_sink_x_0.set_line_alpha(i, alphas[i]) self.qtgui_waterfall_sink_x_0.set_intensity_range(-140, 10) self._qtgui_waterfall_sink_x_0_win = sip.wrapinstance(self.qtgui_waterfall_sink_x_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_waterfall_sink_x_0_win) self.qtgui_time_sink_x_0 = qtgui.time_sink_f( 1024, #size samp_rate, #samp_rate "", #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(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) self.qtgui_time_sink_x_0.enable_stem_plot(False) labels = ['Signal 1', 'Signal 2', 'Signal 3', 'Signal 4', 'Signal 5', 'Signal 6', 'Signal 7', 'Signal 8', 'Signal 9', 'Signal 10'] 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] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] for i in range(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_number_sink_0 = qtgui.number_sink( gr.sizeof_float, 0, qtgui.NUM_GRAPH_HORIZ, 1 ) self.qtgui_number_sink_0.set_update_time(0.10) self.qtgui_number_sink_0.set_title("") labels = ['', '', '', '', '', '', '', '', '', ''] units = ['', '', '', '', '', '', '', '', '', ''] colors = [("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black")] factor = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] for i in range(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(True) self._qtgui_number_sink_0_win = sip.wrapinstance(self.qtgui_number_sink_0.pyqwidget(), Qt.QWidget) self.top_grid_layout.addWidget(self._qtgui_number_sink_0_win) self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(1, firdes.low_pass(1, samp_rate, xlate_bandwidth, 100000), freq_offset, samp_rate) self.blocks_threshold_ff_0 = blocks.threshold_ff(1.5e-5, 5.5e-5, 0) self.blocks_tagged_file_sink_0 = blocks.tagged_file_sink(gr.sizeof_gr_complex*1, samp_rate) self.blocks_float_to_short_0 = blocks.float_to_short(1, 1) self.blocks_complex_to_mag_squared_0 = blocks.complex_to_mag_squared(1) self.blocks_burst_tagger_0 = blocks.burst_tagger(gr.sizeof_gr_complex) self.blocks_burst_tagger_0.set_true_tag('burst',True) self.blocks_burst_tagger_0.set_false_tag('burst',False) ################################################## # Connections ################################################## self.connect((self.blocks_burst_tagger_0, 0), (self.blocks_tagged_file_sink_0, 0)) self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.blocks_threshold_ff_0, 0)) self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.qtgui_number_sink_0, 0)) self.connect((self.blocks_float_to_short_0, 0), (self.blocks_burst_tagger_0, 1)) self.connect((self.blocks_threshold_ff_0, 0), (self.blocks_float_to_short_0, 0)) self.connect((self.blocks_threshold_ff_0, 0), (self.qtgui_time_sink_x_0, 0)) self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.blocks_burst_tagger_0, 0)) self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.blocks_complex_to_mag_squared_0, 0)) self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.qtgui_waterfall_sink_x_0, 0)) self.connect((self.rtlsdr_source_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0))