def __init__(self): gr.top_block.__init__(self, "SAME Decoder test") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 8000 ################################################## # Blocks ################################################## self.rational_resampler_44k = filter.rational_resampler_fff( interpolation=80, decimation=441, ) self.rational_resampler_xxx_0 = filter.rational_resampler_ccc( interpolation=100, decimation=96, taps=None, fractional_bw=None, ) self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_fcc(1, (firdes.low_pass(1, samp_rate, 600, 100)), 1822.916667, samp_rate) self.digital_gmsk_demod_0 = digital.gmsk_demod( samples_per_symbol=16, gain_mu=0.175, mu=0.5, omega_relative_limit=0.1, freq_error=0.0, verbose=True, log=False, ) #self.src = audio.source(samp_rate, "plughw:CARD=PCH,DEV=2", True) self.blocks_wavfile_source_0 = blocks.wavfile_source("eas-test-11-7-2013.wav", False) self.blocks_bitstream_sink = blocks.file_sink(1, "bitstream.bin") self.xlat_sink = blocks.wavfile_sink("xlat.wav", 1, 8333) self.xlat_complex_to_float = blocks.complex_to_float() self.analog_pwr_squelch_xx_0 = analog.pwr_squelch_ff(-50, 0.0001, 0) self.msg_queue = gr.msg_queue(10) self.same_dec_0 = same.same_dec(self.msg_queue) ################################################## # Connections ################################################## self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.rational_resampler_xxx_0, 0)) self.connect((self.rational_resampler_xxx_0, 0), (self.xlat_complex_to_float, 0), (self.xlat_sink, 0)) self.connect((self.rational_resampler_xxx_0, 0), (self.digital_gmsk_demod_0, 0)) self.connect((self.digital_gmsk_demod_0, 0), (self.same_dec_0, 0)) self.connect((self.digital_gmsk_demod_0, 0), (self.blocks_bitstream_sink, 0)) #self.connect((self.src, 0), (self.rational_resampler_44k, 0)) #self.connect((self.rational_resampler_44k, 0), (self.analog_pwr_squelch_xx_0, 0)) self.connect((self.blocks_wavfile_source_0, 0), (self.analog_pwr_squelch_xx_0,0)) self.connect((self.analog_pwr_squelch_xx_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) self._watcher = _queue_watcher_thread(self.msg_queue)
def __init__(self): gr.top_block.__init__(self, "SAME Decoder test") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 8000 ################################################## # Blocks ################################################## self.rational_resampler_44k = filter.rational_resampler_fff( interpolation=80, decimation=441, ) self.rational_resampler_xxx_0 = filter.rational_resampler_ccc( interpolation=100, decimation=96, taps=None, fractional_bw=None, ) self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_fcc(1, (firdes.low_pass(1, samp_rate, 600, 100)), 1822.916667, samp_rate) self.digital_gmsk_demod_0 = digital.gmsk_demod( samples_per_symbol=16, gain_mu=0.175, mu=0.5, omega_relative_limit=0.1, freq_error=0.0, verbose=True, log=False, ) self.src = audio.source(samp_rate, "plughw:CARD=PCH,DEV=2", True) #self.blocks_wavfile_source_0 = blocks.wavfile_source("Monthly_Test_WUAL_DEC-2013.wav", False) self.analog_pwr_squelch_xx_0 = analog.pwr_squelch_ff(-50, 0.0001, 0) self.msg_queue = gr.msg_queue(10) self.same_dec_0 = same.same_dec(self.msg_queue) ################################################## # Connections ################################################## self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.rational_resampler_xxx_0, 0)) self.connect((self.rational_resampler_xxx_0, 0), (self.digital_gmsk_demod_0, 0)) self.connect((self.digital_gmsk_demod_0, 0), (self.same_dec_0, 0)) self.connect((self.src, 0), (self.rational_resampler_44k, 0)) self.connect((self.rational_resampler_44k, 0), (self.analog_pwr_squelch_xx_0, 0)) self.connect((self.analog_pwr_squelch_xx_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) self._watcher = _queue_watcher_thread(self.msg_queue)
def __init__(self, mon_id, audio_port): gr.top_block.__init__(self, "EAS/SAME Monitor") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 8000 ################################################## # Blocks ################################################## # Resampler from input rate (44.1k) to internal rate (8k) self.rational_resampler_44k = filter.rational_resampler_fff( interpolation=80, decimation=441, ) # Resampler from 8000 Hz to 4166 2/3rd Hz to deal with SAME's weird parameters self.rational_resampler_xxx_0 = filter.rational_resampler_ccc( interpolation=50, decimation=96, taps=None, fractional_bw=None, ) self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_fcc( 1, (firdes.low_pass(1, samp_rate, 600, 100)), 1822.916667, samp_rate) self.digital_gmsk_demod_0 = digital.gmsk_demod( samples_per_symbol=8, gain_mu=0.175, mu=0.5, omega_relative_limit=0.01, freq_error=0.0, verbose=True, log=False, ) self.src = audio.source(44100, "eas_mon_%s:in" % (mon_id), True) self.agc = analog.agc_ff(0.0001, 0.1, 1.0) #self.analog_pwr_squelch_xx_0 = analog.pwr_squelch_ff(-50, 0.0001, 0) self.msg_queue = gr.msg_queue(10) self.same_dec_0 = same.same_dec(self.msg_queue) self.tone_det_0 = fft.goertzel_fc(samp_rate, samp_rate / 10, 853) self.tone_det_1 = fft.goertzel_fc(samp_rate, samp_rate / 10, 960) self.tone_det_2 = fft.goertzel_fc(samp_rate, samp_rate / 10, 1050) self.wat_thresh_msg = same.wat_thresh_msg(self.msg_queue, 1, 0.05, 0.01) #self.avg_audio_level = analog.probe_avg_mag_sqrd_ff(-50) #self.level_thresh_msg = same.level_thresh_msg(self.msg_queue, 1, 3, db_to_abs(-30), db_to_abs(-40)) self.audio_sink_converter = blocks.float_to_short(1, 3276) self.audio_sink = blocks.udp_sink(2, '127.0.0.1', audio_port) ################################################## # Connections ################################################## self.connect((self.src, 0), (self.rational_resampler_44k, 0)) self.connect((self.rational_resampler_44k, 0), (self.agc, 0)) #self.connect((self.agc, 0), (self.analog_pwr_squelch_xx_0, 0)) #self.connect((self.analog_pwr_squelch_xx_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) self.connect((self.agc, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.rational_resampler_xxx_0, 0)) self.connect((self.rational_resampler_xxx_0, 0), (self.digital_gmsk_demod_0, 0)) self.connect((self.digital_gmsk_demod_0, 0), (self.same_dec_0, 0)) self.connect((self.agc, 0), (self.tone_det_0, 0), (self.wat_thresh_msg, 0)) self.connect((self.agc, 0), (self.tone_det_1, 0), (self.wat_thresh_msg, 1)) self.connect((self.agc, 0), (self.tone_det_2, 0), (self.wat_thresh_msg, 2)) #self.connect((self.agc, 0), (self.avg_audio_level, 0), (self.level_thresh_msg, 0)) self.connect((self.agc, 0), (self.audio_sink_converter, 0), (self.audio_sink, 0)) self._watcher = _queue_watcher_thread(self.msg_queue, mon_id, audio_port)
def __init__(self, mon_id, audio_port): gr.top_block.__init__(self, "EAS/SAME Monitor") ################################################## # Variables ################################################## self.samp_rate = samp_rate = 8000 ################################################## # Blocks ################################################## # Resampler from input rate (44.1k) to internal rate (8k) self.rational_resampler_44k = filter.rational_resampler_fff( interpolation=80, decimation=441, ) # Resampler from 8000 Hz to 4166 2/3rd Hz to deal with SAME's weird parameters self.rational_resampler_xxx_0 = filter.rational_resampler_ccc( interpolation=50, decimation=96, taps=None, fractional_bw=None, ) self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_fcc(1, (firdes.low_pass(1, samp_rate, 600, 100)), 1822.916667, samp_rate) self.digital_gmsk_demod_0 = digital.gmsk_demod( samples_per_symbol=8, gain_mu=0.175, mu=0.5, omega_relative_limit=0.01, freq_error=0.0, verbose=True, log=False, ) self.src = audio.source(44100, "eas_mon_%s:in" % (mon_id), True) self.agc = analog.agc_ff(0.0001, 0.1, 1.0) #self.analog_pwr_squelch_xx_0 = analog.pwr_squelch_ff(-50, 0.0001, 0) self.msg_queue = gr.msg_queue(10) self.same_dec_0 = same.same_dec(self.msg_queue) self.tone_det_0 = fft.goertzel_fc(samp_rate, samp_rate / 10, 853) self.tone_det_1 = fft.goertzel_fc(samp_rate, samp_rate / 10, 960) self.tone_det_2 = fft.goertzel_fc(samp_rate, samp_rate / 10, 1050) self.wat_thresh_msg = same.wat_thresh_msg(self.msg_queue, 1, 0.05, 0.01) #self.avg_audio_level = analog.probe_avg_mag_sqrd_ff(-50) #self.level_thresh_msg = same.level_thresh_msg(self.msg_queue, 1, 3, db_to_abs(-30), db_to_abs(-40)) self.audio_sink_converter = blocks.float_to_short(1, 3276) self.audio_sink = blocks.udp_sink(2, '127.0.0.1', audio_port) ################################################## # Connections ################################################## self.connect((self.src, 0), (self.rational_resampler_44k, 0)) self.connect((self.rational_resampler_44k, 0), (self.agc, 0)) #self.connect((self.agc, 0), (self.analog_pwr_squelch_xx_0, 0)) #self.connect((self.analog_pwr_squelch_xx_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) self.connect((self.agc, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.rational_resampler_xxx_0, 0)) self.connect((self.rational_resampler_xxx_0, 0), (self.digital_gmsk_demod_0, 0)) self.connect((self.digital_gmsk_demod_0, 0), (self.same_dec_0, 0)) self.connect((self.agc, 0), (self.tone_det_0, 0), (self.wat_thresh_msg, 0)) self.connect((self.agc, 0), (self.tone_det_1, 0), (self.wat_thresh_msg, 1)) self.connect((self.agc, 0), (self.tone_det_2, 0), (self.wat_thresh_msg, 2)) #self.connect((self.agc, 0), (self.avg_audio_level, 0), (self.level_thresh_msg, 0)) self.connect((self.agc, 0), (self.audio_sink_converter, 0), (self.audio_sink, 0)) self._watcher = _queue_watcher_thread(self.msg_queue, mon_id, audio_port)