From 61501694d733f822271de086466ab73fdb493d56 Mon Sep 17 00:00:00 2001 From: Manolis Surligas Date: Sun, 19 Aug 2018 22:07:24 +0300 Subject: [PATCH] Support arbitrary sampling rates on CW and AFSK1200 --- CMakeLists.txt | 2 +- apps/flowgraphs/afsk1200_ax25.grc | 617 ++++++++++++----------- apps/flowgraphs/cw_decoder.grc | 261 ++++------ apps/flowgraphs/satnogs_afsk1200_ax25.py | 117 +++-- apps/flowgraphs/satnogs_cw_decoder.py | 61 +-- python/satnogs_info.py.in | 3 +- 6 files changed, 518 insertions(+), 543 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ced8e31..cec98e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,7 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules) set(VERSION_INFO_MAJOR_VERSION 1) set(VERSION_INFO_API_COMPAT 4) set(VERSION_INFO_MINOR_VERSION 2) -set(VERSION_INFO_MAINT_VERSION git) +set(VERSION_INFO_MAINT_VERSION next) ######################################################################## # Compiler specific setup diff --git a/apps/flowgraphs/afsk1200_ax25.grc b/apps/flowgraphs/afsk1200_ax25.grc index 614fffb..4101be8 100644 --- a/apps/flowgraphs/afsk1200_ax25.grc +++ b/apps/flowgraphs/afsk1200_ax25.grc @@ -1,5 +1,5 @@ - + Thu May 5 00:22:45 2016 @@ -72,6 +72,10 @@ run True + + sizing_mode + fixed + thread_safe_setters @@ -80,6 +84,10 @@ title AFSK1200 AX.25 decoder + + placement + (0,0) + variable @@ -191,33 +199,6 @@ SDR received samples 5000 - - variable - - comment - - - - _enabled - True - - - _coordinate - (327, 1073) - - - _rotation - 0 - - - id - filter_rate - - - value - 250000 - - variable @@ -245,108 +226,6 @@ SDR received samples 3000 - - variable - - comment - SDR device -RX sampling rate - - - _enabled - True - - - _coordinate - (574, 873) - - - _rotation - 0 - - - id - samp_rate_rx - - - value - satnogs.hw_rx_settings[rx_sdr_device]['samp_rate'] - - - - variable_low_pass_filter_taps - - beta - 6.76 - - - comment - - - - cutoff_freq - 100e3 - - - _enabled - 1 - - - _coordinate - (31, 542) - - - _rotation - 0 - - - gain - 12.0 - - - id - taps - - - samp_rate - samp_rate_rx - - - width - 60000 - - - win - firdes.WIN_HAMMING - - - - variable - - comment - - - - _enabled - True - - - _coordinate - (167, 1073) - - - _rotation - 0 - - - id - xlate_filter_taps - - - value - firdes.low_pass(1, samp_rate_rx, 125000, 25000, firdes.WIN_HAMMING, 6.76) - - analog_quadrature_demod_cf @@ -530,6 +409,10 @@ RX sampling rate short_id + + hide + none + type string @@ -539,6 +422,53 @@ RX sampling rate satnogs.not_set_antenna + + parameter + + alias + + + + comment + For compatibility, not used + + + _enabled + True + + + _coordinate + (232, 1116) + + + _rotation + 0 + + + id + baudrate + + + label + + + + short_id + + + + hide + none + + + type + eng_float + + + value + 9600.0 + + parameter @@ -573,6 +503,10 @@ RX sampling rate short_id + + hide + none + type eng_float @@ -582,65 +516,6 @@ RX sampling rate satnogs.not_set_rx_bb_gain - - rational_resampler_xxx - - alias - - - - comment - - - - affinity - - - - decim - int(samp_rate_rx / (int(samp_rate_rx/filter_rate))) - - - _enabled - True - - - fbw - 0 - - - _coordinate - (1125, 271) - - - _rotation - 0 - - - id - blks2_rational_resampler_xxx_1 - - - interp - 48000 - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - taps - [] - - - type - ccc - - blocks_float_to_complex @@ -735,6 +610,49 @@ RX sampling rate 1 + + blocks_rotator_cc + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (256, 324) + + + _rotation + 0 + + + id + blocks_rotator_cc_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + phase_inc + -2.0 * math.pi * (lo_offset / satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx)) + + dc_blocker_xx @@ -820,6 +738,10 @@ RX sampling rate short_id + + hide + none + type string @@ -863,6 +785,10 @@ RX sampling rate short_id + + hide + none + type string @@ -1008,6 +934,10 @@ RX sampling rate short_id + + hide + none + type intx @@ -1051,6 +981,10 @@ RX sampling rate short_id + + hide + none + type intx @@ -1094,6 +1028,10 @@ RX sampling rate short_id + + hide + none + type string @@ -1103,65 +1041,6 @@ RX sampling rate test.wav - - freq_xlating_fir_filter_xxx - - alias - - - - center_freq - lo_offset - - - comment - - - - affinity - - - - decim - int(samp_rate_rx/filter_rate) - - - _enabled - 1 - - - _coordinate - (680, 268) - - - _rotation - 0 - - - id - freq_xlating_fir_filter_xxx_0 - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - samp_rate - samp_rate_rx - - - taps - xlate_filter_taps - - - type - ccc - - parameter @@ -1196,6 +1075,10 @@ RX sampling rate short_id + + hide + none + type eng_float @@ -1239,6 +1122,10 @@ RX sampling rate short_id + + hide + none + type string @@ -1283,6 +1170,10 @@ we shift the LO a little further short_id + + hide + none + type eng_float @@ -1331,7 +1222,7 @@ max_modulation_freq = 3000 _coordinate - (861, 351) + (1144, 276) _rotation @@ -1406,7 +1297,7 @@ max_modulation_freq = 3000 _coordinate - (1148, 534) + (1152, 532) _rotation @@ -1414,7 +1305,7 @@ max_modulation_freq = 3000 gain - 10 + 1 id @@ -1479,6 +1370,10 @@ max_modulation_freq = 3000 short_id + + hide + none + type eng_float @@ -1504,7 +1399,7 @@ max_modulation_freq = 3000 bw0 - samp_rate_rx + satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx) dc_offset_mode0 @@ -2792,7 +2687,7 @@ max_modulation_freq = 3000 _coordinate - (15, 319) + (8, 300) _rotation @@ -2888,13 +2783,76 @@ max_modulation_freq = 3000 sample_rate - samp_rate_rx + satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx) sync + + pfb_arb_resampler_xxx + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (640, 196) + + + _rotation + 0 + + + id + pfb_arb_resampler_xxx_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + nfilts + 32 + + + rrate + audio_samp_rate/satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx) + + + samp_delay + 0 + + + atten + 100 + + + taps + + + + type + ccf + + parameter @@ -2929,6 +2887,10 @@ max_modulation_freq = 3000 short_id + + hide + none + type intx @@ -2972,6 +2934,10 @@ max_modulation_freq = 3000 short_id + + hide + none + type eng_float @@ -3015,6 +2981,10 @@ max_modulation_freq = 3000 short_id + + hide + none + type intx @@ -3058,6 +3028,10 @@ max_modulation_freq = 3000 short_id + + hide + none + type eng_float @@ -3101,6 +3075,10 @@ max_modulation_freq = 3000 short_id + + hide + none + type string @@ -3110,6 +3088,53 @@ max_modulation_freq = 3000 usrpb200 + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (136, 1116) + + + _rotation + 0 + + + id + samp_rate_rx + + + label + + + + short_id + + + + hide + none + + + type + eng_float + + + value + satnogs.not_set_samp_rate_rx + + satnogs_ax25_decoder_bm @@ -3248,7 +3273,7 @@ max_modulation_freq = 3000 _coordinate - (352, 276) + (288, 208) _rotation @@ -3268,7 +3293,7 @@ max_modulation_freq = 3000 sampling_rate - samp_rate_rx + satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx) target_freq @@ -3338,11 +3363,11 @@ max_modulation_freq = 3000 filename - /tmp/iq.bin + iq_file_path _coordinate - (1286, 139) + (1304, 28) _rotation @@ -3385,7 +3410,7 @@ max_modulation_freq = 3000 _coordinate - (630, 99) + (368, 452) _rotation @@ -3471,7 +3496,7 @@ max_modulation_freq = 3000 _coordinate - (16, 204) + (8, 164) _rotation @@ -3585,11 +3610,11 @@ max_modulation_freq = 3000 _coordinate - (1486, 255) + (872, 4) _rotation - 0 + 180 id @@ -3642,6 +3667,10 @@ max_modulation_freq = 3000 short_id + + hide + none + type eng_float @@ -3685,6 +3714,10 @@ max_modulation_freq = 3000 short_id + + hide + none + type string @@ -3728,6 +3761,10 @@ max_modulation_freq = 3000 short_id + + hide + none + type intx @@ -3771,6 +3808,10 @@ max_modulation_freq = 3000 short_id + + hide + none + type string @@ -3804,24 +3845,6 @@ max_modulation_freq = 3000 0 1 - - blks2_rational_resampler_xxx_1 - low_pass_filter_0 - 0 - 0 - - - blks2_rational_resampler_xxx_1 - satnogs_iq_sink_0 - 0 - 0 - - - blks2_rational_resampler_xxx_1 - satnogs_waterfall_sink_0 - 0 - 0 - blocks_float_to_complex_0 blocks_multiply_xx_0 @@ -3834,6 +3857,12 @@ max_modulation_freq = 3000 0 0 + + blocks_rotator_cc_0 + satnogs_coarse_doppler_correction_cc_0 + 0 + 0 + dc_blocker_xx_0 blocks_float_to_complex_0 @@ -3858,12 +3887,6 @@ max_modulation_freq = 3000 0 0 - - freq_xlating_fir_filter_xxx_0 - blks2_rational_resampler_xxx_1 - 0 - 0 - low_pass_filter_0 analog_quadrature_demod_cf_0_0 @@ -3878,7 +3901,25 @@ max_modulation_freq = 3000 osmosdr_source_0 - satnogs_coarse_doppler_correction_cc_0 + blocks_rotator_cc_0 + 0 + 0 + + + pfb_arb_resampler_xxx_0 + low_pass_filter_0 + 0 + 0 + + + pfb_arb_resampler_xxx_0 + satnogs_iq_sink_0 + 0 + 0 + + + pfb_arb_resampler_xxx_0 + satnogs_waterfall_sink_0 0 0 @@ -3908,7 +3949,7 @@ max_modulation_freq = 3000 satnogs_coarse_doppler_correction_cc_0 - freq_xlating_fir_filter_xxx_0 + pfb_arb_resampler_xxx_0 0 0 diff --git a/apps/flowgraphs/cw_decoder.grc b/apps/flowgraphs/cw_decoder.grc index 7f72635..87eec52 100644 --- a/apps/flowgraphs/cw_decoder.grc +++ b/apps/flowgraphs/cw_decoder.grc @@ -1,5 +1,5 @@ - + Thu May 5 00:22:45 2016 @@ -116,88 +116,6 @@ 48000 - - variable - - comment - SDR device -TX sampling rate - - - _enabled - True - - - _coordinate - (231, 547) - - - _rotation - 0 - - - id - samp_rate_rx - - - value - satnogs.hw_rx_settings[rx_sdr_device]['samp_rate'] - - - - variable - - comment - - - - _enabled - True - - - _coordinate - (23, 547) - - - _rotation - 0 - - - id - xlate_filter_taps - - - value - firdes.low_pass(1, samp_rate_rx, 125000, 25000, firdes.WIN_HAMMING, 6.76) - - - - variable - - comment - - - - _enabled - True - - - _coordinate - (446, 546) - - - _rotation - 0 - - - id - xlating_decimation - - - value - int(samp_rate_rx/100e3) - - analog_agc2_xx @@ -714,6 +632,49 @@ tone. This tone is typically 1 kHz. 1 + + blocks_rotator_cc + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (240, 364) + + + _rotation + 0 + + + id + blocks_rotator_cc_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + phase_inc + -2.0 * math.pi * (lo_offset / satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx)) + + parameter @@ -949,65 +910,6 @@ tone. This tone is typically 1 kHz. test.txt - - freq_xlating_fir_filter_xxx - - alias - - - - center_freq - lo_offset - - - comment - Output samplerate: 500k / 5 = 100k - - - affinity - - - - decim - xlating_decimation - - - _enabled - 1 - - - _coordinate - (287, 379) - - - _rotation - 0 - - - id - freq_xlating_fir_filter_xxx_0 - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - samp_rate - samp_rate_rx - - - taps - xlate_filter_taps - - - type - ccc - - parameter @@ -1378,7 +1280,7 @@ we shift the LO a little further bw0 - samp_rate_rx + satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx) dc_offset_mode0 @@ -2666,7 +2568,7 @@ we shift the LO a little further _coordinate - (15, 311) + (8, 276) _rotation @@ -2762,7 +2664,7 @@ we shift the LO a little further sample_rate - samp_rate_rx + satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx) sync @@ -2789,7 +2691,7 @@ we shift the LO a little further _coordinate - (662, 227) + (520, 180) _rotation @@ -2813,7 +2715,7 @@ we shift the LO a little further rrate - (audio_samp_rate) / (samp_rate_rx / xlating_decimation) + audio_samp_rate/satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx) samp_delay @@ -2821,7 +2723,7 @@ we shift the LO a little further atten - 80 + 100 taps @@ -3067,6 +2969,53 @@ we shift the LO a little further usrpb200 + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (32, 852) + + + _rotation + 0 + + + id + samp_rate_rx + + + label + + + + short_id + + + + hide + none + + + type + eng_float + + + value + satnogs.not_set_samp_rate_rx + + satnogs_coarse_doppler_correction_cc @@ -3075,7 +3024,7 @@ we shift the LO a little further comment - Output samplerate: 500k + affinity @@ -3083,11 +3032,11 @@ we shift the LO a little further _enabled - 1 + True _coordinate - (446, 239) + (288, 192) _rotation @@ -3107,7 +3056,7 @@ we shift the LO a little further sampling_rate - samp_rate_rx / xlating_decimation + satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx) target_freq @@ -3365,7 +3314,7 @@ we shift the LO a little further _coordinate - (16, 204) + (8, 140) _rotation @@ -3401,7 +3350,7 @@ we shift the LO a little further interval - 50 + 1000 @@ -3733,7 +3682,7 @@ we shift the LO a little further 0 - freq_xlating_fir_filter_xxx_0 + blocks_rotator_cc_0 satnogs_coarse_doppler_correction_cc_0 0 0 @@ -3758,7 +3707,7 @@ we shift the LO a little further osmosdr_source_0 - freq_xlating_fir_filter_xxx_0 + blocks_rotator_cc_0 0 0 diff --git a/apps/flowgraphs/satnogs_afsk1200_ax25.py b/apps/flowgraphs/satnogs_afsk1200_ax25.py index 6115c30..b2d5eee 100755 --- a/apps/flowgraphs/satnogs_afsk1200_ax25.py +++ b/apps/flowgraphs/satnogs_afsk1200_ax25.py @@ -5,7 +5,7 @@ # Title: AFSK1200 AX.25 decoder # Author: Manolis Surligas (surligas@gmail.com), Vardakis Giorgos (vardakis.grg@gmail.com) # Description: AFSK1200 AX.25 decoder -# Generated: Sun Mar 25 17:48:06 2018 +# Generated: Sun Aug 19 21:49:02 2018 ################################################## from gnuradio import analog @@ -16,6 +16,7 @@ from gnuradio import filter from gnuradio import gr from gnuradio.eng_option import eng_option from gnuradio.filter import firdes +from gnuradio.filter import pfb from optparse import OptionParser import math import osmosdr @@ -25,13 +26,14 @@ import time class satnogs_afsk1200_ax25(gr.top_block): - def __init__(self, antenna=satnogs.not_set_antenna, bb_gain=satnogs.not_set_rx_bb_gain, decoded_data_file_path='/tmp/.satnogs/data/data', dev_args=satnogs.not_set_dev_args, doppler_correction_per_sec=1000, enable_iq_dump=0, file_path='test.wav', if_gain=satnogs.not_set_rx_if_gain, iq_file_path='/tmp/iq.dat', lo_offset=100e3, mark_frequency=2200.0, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', space_frequency=1200.0, udp_IP='127.0.0.1', udp_port=16887, waterfall_file_path='/tmp/waterfall.dat'): + def __init__(self, antenna=satnogs.not_set_antenna, baudrate=9600.0, bb_gain=satnogs.not_set_rx_bb_gain, decoded_data_file_path='/tmp/.satnogs/data/data', dev_args=satnogs.not_set_dev_args, doppler_correction_per_sec=1000, enable_iq_dump=0, file_path='test.wav', if_gain=satnogs.not_set_rx_if_gain, iq_file_path='/tmp/iq.dat', lo_offset=100e3, mark_frequency=2200.0, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', samp_rate_rx=satnogs.not_set_samp_rate_rx, space_frequency=1200.0, udp_IP='127.0.0.1', udp_port=16887, waterfall_file_path='/tmp/waterfall.dat'): gr.top_block.__init__(self, "AFSK1200 AX.25 decoder ") ################################################## # Parameters ################################################## self.antenna = antenna + self.baudrate = baudrate self.bb_gain = bb_gain self.decoded_data_file_path = decoded_data_file_path self.dev_args = dev_args @@ -47,6 +49,7 @@ class satnogs_afsk1200_ax25(gr.top_block): self.rigctl_port = rigctl_port self.rx_freq = rx_freq self.rx_sdr_device = rx_sdr_device + self.samp_rate_rx = samp_rate_rx self.space_frequency = space_frequency self.udp_IP = udp_IP self.udp_port = udp_port @@ -55,13 +58,7 @@ class satnogs_afsk1200_ax25(gr.top_block): ################################################## # Variables ################################################## - self.samp_rate_rx = samp_rate_rx = satnogs.hw_rx_settings[rx_sdr_device]['samp_rate'] - self.xlate_filter_taps = xlate_filter_taps = firdes.low_pass(1, samp_rate_rx, 125000, 25000, firdes.WIN_HAMMING, 6.76) - - self.taps = taps = firdes.low_pass(12.0, samp_rate_rx, 100e3, 60000, firdes.WIN_HAMMING, 6.76) - self.max_modulation_freq = max_modulation_freq = 3000 - self.filter_rate = filter_rate = 250000 self.deviation = deviation = 5000 self.baud_rate = baud_rate = 1200 self.audio_samp_rate = audio_samp_rate = 48000 @@ -75,13 +72,19 @@ class satnogs_afsk1200_ax25(gr.top_block): self.satnogs_tcp_rigctl_msg_source_0 = satnogs.tcp_rigctl_msg_source("127.0.0.1", rigctl_port, False, 1000, 1500) self.satnogs_quad_demod_filter_ff_0 = satnogs.quad_demod_filter_ff(((audio_samp_rate/10) / baud_rate)/(math.pi*1)) self.satnogs_ogg_encoder_0 = satnogs.ogg_encoder(file_path, audio_samp_rate, 1.0) - self.satnogs_iq_sink_0 = satnogs.iq_sink(16768, '/tmp/iq.bin', False, enable_iq_dump) + self.satnogs_iq_sink_0 = satnogs.iq_sink(16768, iq_file_path, False, enable_iq_dump) self.satnogs_frame_file_sink_0_1_0 = satnogs.frame_file_sink(decoded_data_file_path, 0) - self.satnogs_coarse_doppler_correction_cc_0 = satnogs.coarse_doppler_correction_cc(rx_freq, samp_rate_rx) + self.satnogs_coarse_doppler_correction_cc_0 = satnogs.coarse_doppler_correction_cc(rx_freq, satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx)) self.satnogs_ax25_decoder_bm_0_0 = satnogs.ax25_decoder_bm('GND', 0, True, True, 1024) self.satnogs_ax25_decoder_bm_0 = satnogs.ax25_decoder_bm('GND', 0, True, False, 1024) + self.pfb_arb_resampler_xxx_0 = pfb.arb_resampler_ccf( + audio_samp_rate/satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx), + taps=None, + flt_size=32) + self.pfb_arb_resampler_xxx_0.declare_sample_delay(0) + self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + satnogs.handle_rx_dev_args(rx_sdr_device, dev_args) ) - self.osmosdr_source_0.set_sample_rate(samp_rate_rx) + self.osmosdr_source_0.set_sample_rate(satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx)) self.osmosdr_source_0.set_center_freq(rx_freq - lo_offset, 0) self.osmosdr_source_0.set_freq_corr(ppm, 0) self.osmosdr_source_0.set_dc_offset_mode(2, 0) @@ -91,28 +94,24 @@ class satnogs_afsk1200_ax25(gr.top_block): self.osmosdr_source_0.set_if_gain(satnogs.handle_rx_if_gain(rx_sdr_device, if_gain), 0) self.osmosdr_source_0.set_bb_gain(satnogs.handle_rx_bb_gain(rx_sdr_device, bb_gain), 0) self.osmosdr_source_0.set_antenna(satnogs.handle_rx_antenna(rx_sdr_device, antenna), 0) - self.osmosdr_source_0.set_bandwidth(samp_rate_rx, 0) + self.osmosdr_source_0.set_bandwidth(satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx), 0) self.low_pass_filter_1 = filter.fir_filter_ccf(10, firdes.low_pass( - 10, audio_samp_rate, (mark_frequency - space_frequency)/2.0, 1000, firdes.WIN_HAMMING, 6.76)) + 1, audio_samp_rate, (mark_frequency - space_frequency)/2.0, 1000, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_0 = filter.fir_filter_ccf(1, firdes.low_pass( 1, audio_samp_rate, deviation+max_modulation_freq, 3000, firdes.WIN_HAMMING, 6.76)) - self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(int(samp_rate_rx/filter_rate), (xlate_filter_taps), lo_offset, samp_rate_rx) self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff((48e3/10)/baud_rate, 0.25*0.175*0.175, 0.5, 0.175, 0.005) self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb() self.dc_blocker_xx_0 = filter.dc_blocker_ff(1024, True) + self.blocks_rotator_cc_0 = blocks.rotator_cc(-2.0 * math.pi * (lo_offset / satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx))) self.blocks_multiply_xx_0 = blocks.multiply_vcc(1) self.blocks_float_to_complex_0 = blocks.float_to_complex(1) - self.blks2_rational_resampler_xxx_1 = filter.rational_resampler_ccc( - interpolation=48000, - decimation=int(samp_rate_rx / (int(samp_rate_rx/filter_rate))), - taps=None, - fractional_bw=None, - ) self.analog_sig_source_x_0 = analog.sig_source_c(audio_samp_rate, analog.GR_COS_WAVE, -(1200 + 2200) / 2, 1, 0) self.analog_quadrature_demod_cf_0_0 = analog.quadrature_demod_cf((2*math.pi*deviation)/audio_samp_rate) self.analog_quadrature_demod_cf_0 = analog.quadrature_demod_cf(((audio_samp_rate/10) / baud_rate)/(math.pi*1)) + + ################################################## # Connections ################################################## @@ -125,20 +124,20 @@ class satnogs_afsk1200_ax25(gr.top_block): self.connect((self.analog_quadrature_demod_cf_0_0, 0), (self.dc_blocker_xx_0, 0)) self.connect((self.analog_quadrature_demod_cf_0_0, 0), (self.satnogs_ogg_encoder_0, 0)) self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0, 1)) - self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.low_pass_filter_0, 0)) - self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.satnogs_iq_sink_0, 0)) - self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.satnogs_waterfall_sink_0, 0)) self.connect((self.blocks_float_to_complex_0, 0), (self.blocks_multiply_xx_0, 0)) self.connect((self.blocks_multiply_xx_0, 0), (self.low_pass_filter_1, 0)) + self.connect((self.blocks_rotator_cc_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0)) self.connect((self.dc_blocker_xx_0, 0), (self.blocks_float_to_complex_0, 0)) self.connect((self.digital_binary_slicer_fb_0, 0), (self.satnogs_ax25_decoder_bm_0, 0)) self.connect((self.digital_binary_slicer_fb_0, 0), (self.satnogs_ax25_decoder_bm_0_0, 0)) self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.satnogs_quad_demod_filter_ff_0, 0)) - self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.blks2_rational_resampler_xxx_1, 0)) self.connect((self.low_pass_filter_0, 0), (self.analog_quadrature_demod_cf_0_0, 0)) self.connect((self.low_pass_filter_1, 0), (self.analog_quadrature_demod_cf_0, 0)) - self.connect((self.osmosdr_source_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0)) - self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) + self.connect((self.osmosdr_source_0, 0), (self.blocks_rotator_cc_0, 0)) + self.connect((self.pfb_arb_resampler_xxx_0, 0), (self.low_pass_filter_0, 0)) + self.connect((self.pfb_arb_resampler_xxx_0, 0), (self.satnogs_iq_sink_0, 0)) + self.connect((self.pfb_arb_resampler_xxx_0, 0), (self.satnogs_waterfall_sink_0, 0)) + self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.pfb_arb_resampler_xxx_0, 0)) self.connect((self.satnogs_quad_demod_filter_ff_0, 0), (self.digital_binary_slicer_fb_0, 0)) def get_antenna(self): @@ -148,6 +147,12 @@ class satnogs_afsk1200_ax25(gr.top_block): self.antenna = antenna self.osmosdr_source_0.set_antenna(satnogs.handle_rx_antenna(self.rx_sdr_device, self.antenna), 0) + def get_baudrate(self): + return self.baudrate + + def set_baudrate(self, baudrate): + self.baudrate = baudrate + def get_bb_gain(self): return self.bb_gain @@ -204,14 +209,14 @@ class satnogs_afsk1200_ax25(gr.top_block): def set_lo_offset(self, lo_offset): self.lo_offset = lo_offset self.osmosdr_source_0.set_center_freq(self.rx_freq - self.lo_offset, 0) - self.freq_xlating_fir_filter_xxx_0.set_center_freq(self.lo_offset) + self.blocks_rotator_cc_0.set_phase_inc(-2.0 * math.pi * (self.lo_offset / satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx))) def get_mark_frequency(self): return self.mark_frequency def set_mark_frequency(self, mark_frequency): self.mark_frequency = mark_frequency - self.low_pass_filter_1.set_taps(firdes.low_pass(10, self.audio_samp_rate, (self.mark_frequency - self.space_frequency)/2.0, 1000, firdes.WIN_HAMMING, 6.76)) + self.low_pass_filter_1.set_taps(firdes.low_pass(1, self.audio_samp_rate, (self.mark_frequency - self.space_frequency)/2.0, 1000, firdes.WIN_HAMMING, 6.76)) def get_ppm(self): return self.ppm @@ -246,19 +251,32 @@ class satnogs_afsk1200_ax25(gr.top_block): def set_rx_sdr_device(self, rx_sdr_device): self.rx_sdr_device = rx_sdr_device - self.set_samp_rate_rx(satnogs.hw_rx_settings[self.rx_sdr_device]['samp_rate']) + self.pfb_arb_resampler_xxx_0.set_rate(self.audio_samp_rate/satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx)) + self.osmosdr_source_0.set_sample_rate(satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx)) self.osmosdr_source_0.set_gain(satnogs.handle_rx_rf_gain(self.rx_sdr_device, self.rf_gain), 0) self.osmosdr_source_0.set_if_gain(satnogs.handle_rx_if_gain(self.rx_sdr_device, self.if_gain), 0) self.osmosdr_source_0.set_bb_gain(satnogs.handle_rx_bb_gain(self.rx_sdr_device, self.bb_gain), 0) self.osmosdr_source_0.set_antenna(satnogs.handle_rx_antenna(self.rx_sdr_device, self.antenna), 0) + self.osmosdr_source_0.set_bandwidth(satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx), 0) + self.blocks_rotator_cc_0.set_phase_inc(-2.0 * math.pi * (self.lo_offset / satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx))) self.set_audio_gain(satnogs.fm_demod_settings[self.rx_sdr_device]['audio_gain']) + def get_samp_rate_rx(self): + return self.samp_rate_rx + + def set_samp_rate_rx(self, samp_rate_rx): + self.samp_rate_rx = samp_rate_rx + self.pfb_arb_resampler_xxx_0.set_rate(self.audio_samp_rate/satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx)) + self.osmosdr_source_0.set_sample_rate(satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx)) + self.osmosdr_source_0.set_bandwidth(satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx), 0) + self.blocks_rotator_cc_0.set_phase_inc(-2.0 * math.pi * (self.lo_offset / satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx))) + def get_space_frequency(self): return self.space_frequency def set_space_frequency(self, space_frequency): self.space_frequency = space_frequency - self.low_pass_filter_1.set_taps(firdes.low_pass(10, self.audio_samp_rate, (self.mark_frequency - self.space_frequency)/2.0, 1000, firdes.WIN_HAMMING, 6.76)) + self.low_pass_filter_1.set_taps(firdes.low_pass(1, self.audio_samp_rate, (self.mark_frequency - self.space_frequency)/2.0, 1000, firdes.WIN_HAMMING, 6.76)) def get_udp_IP(self): return self.udp_IP @@ -278,28 +296,6 @@ class satnogs_afsk1200_ax25(gr.top_block): def set_waterfall_file_path(self, waterfall_file_path): self.waterfall_file_path = waterfall_file_path - def get_samp_rate_rx(self): - return self.samp_rate_rx - - def set_samp_rate_rx(self, samp_rate_rx): - self.samp_rate_rx = samp_rate_rx - self.set_xlate_filter_taps(firdes.low_pass(1, self.samp_rate_rx, 125000, 25000, firdes.WIN_HAMMING, 6.76)) - self.osmosdr_source_0.set_sample_rate(self.samp_rate_rx) - self.osmosdr_source_0.set_bandwidth(self.samp_rate_rx, 0) - - def get_xlate_filter_taps(self): - return self.xlate_filter_taps - - def set_xlate_filter_taps(self, xlate_filter_taps): - self.xlate_filter_taps = xlate_filter_taps - self.freq_xlating_fir_filter_xxx_0.set_taps((self.xlate_filter_taps)) - - def get_taps(self): - return self.taps - - def set_taps(self, taps): - self.taps = taps - def get_max_modulation_freq(self): return self.max_modulation_freq @@ -307,12 +303,6 @@ class satnogs_afsk1200_ax25(gr.top_block): self.max_modulation_freq = max_modulation_freq self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.audio_samp_rate, self.deviation+self.max_modulation_freq, 3000, firdes.WIN_HAMMING, 6.76)) - def get_filter_rate(self): - return self.filter_rate - - def set_filter_rate(self, filter_rate): - self.filter_rate = filter_rate - def get_deviation(self): return self.deviation @@ -334,7 +324,8 @@ class satnogs_afsk1200_ax25(gr.top_block): def set_audio_samp_rate(self, audio_samp_rate): self.audio_samp_rate = audio_samp_rate - self.low_pass_filter_1.set_taps(firdes.low_pass(10, self.audio_samp_rate, (self.mark_frequency - self.space_frequency)/2.0, 1000, firdes.WIN_HAMMING, 6.76)) + self.pfb_arb_resampler_xxx_0.set_rate(self.audio_samp_rate/satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx)) + self.low_pass_filter_1.set_taps(firdes.low_pass(1, self.audio_samp_rate, (self.mark_frequency - self.space_frequency)/2.0, 1000, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.audio_samp_rate, self.deviation+self.max_modulation_freq, 3000, firdes.WIN_HAMMING, 6.76)) self.analog_sig_source_x_0.set_sampling_freq(self.audio_samp_rate) self.analog_quadrature_demod_cf_0_0.set_gain((2*math.pi*self.deviation)/self.audio_samp_rate) @@ -353,6 +344,9 @@ def argument_parser(): parser.add_option( "", "--antenna", dest="antenna", type="string", default=satnogs.not_set_antenna, help="Set antenna [default=%default]") + parser.add_option( + "", "--baudrate", dest="baudrate", type="eng_float", default=eng_notation.num_to_str(9600.0), + help="Set baudrate [default=%default]") parser.add_option( "", "--bb-gain", dest="bb_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_bb_gain), help="Set bb_gain [default=%default]") @@ -398,6 +392,9 @@ def argument_parser(): parser.add_option( "", "--rx-sdr-device", dest="rx_sdr_device", type="string", default='usrpb200', help="Set rx_sdr_device [default=%default]") + parser.add_option( + "", "--samp-rate-rx", dest="samp_rate_rx", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_samp_rate_rx), + help="Set samp_rate_rx [default=%default]") parser.add_option( "", "--space-frequency", dest="space_frequency", type="eng_float", default=eng_notation.num_to_str(1200.0), help="Set space_frequency [default=%default]") @@ -417,7 +414,7 @@ def main(top_block_cls=satnogs_afsk1200_ax25, options=None): if options is None: options, _ = argument_parser().parse_args() - tb = top_block_cls(antenna=options.antenna, bb_gain=options.bb_gain, decoded_data_file_path=options.decoded_data_file_path, dev_args=options.dev_args, doppler_correction_per_sec=options.doppler_correction_per_sec, enable_iq_dump=options.enable_iq_dump, file_path=options.file_path, if_gain=options.if_gain, iq_file_path=options.iq_file_path, lo_offset=options.lo_offset, mark_frequency=options.mark_frequency, ppm=options.ppm, rf_gain=options.rf_gain, rigctl_port=options.rigctl_port, rx_freq=options.rx_freq, rx_sdr_device=options.rx_sdr_device, space_frequency=options.space_frequency, udp_IP=options.udp_IP, udp_port=options.udp_port, waterfall_file_path=options.waterfall_file_path) + tb = top_block_cls(antenna=options.antenna, baudrate=options.baudrate, bb_gain=options.bb_gain, decoded_data_file_path=options.decoded_data_file_path, dev_args=options.dev_args, doppler_correction_per_sec=options.doppler_correction_per_sec, enable_iq_dump=options.enable_iq_dump, file_path=options.file_path, if_gain=options.if_gain, iq_file_path=options.iq_file_path, lo_offset=options.lo_offset, mark_frequency=options.mark_frequency, ppm=options.ppm, rf_gain=options.rf_gain, rigctl_port=options.rigctl_port, rx_freq=options.rx_freq, rx_sdr_device=options.rx_sdr_device, samp_rate_rx=options.samp_rate_rx, space_frequency=options.space_frequency, udp_IP=options.udp_IP, udp_port=options.udp_port, waterfall_file_path=options.waterfall_file_path) tb.start() tb.wait() diff --git a/apps/flowgraphs/satnogs_cw_decoder.py b/apps/flowgraphs/satnogs_cw_decoder.py index 2fba76c..630ba3c 100755 --- a/apps/flowgraphs/satnogs_cw_decoder.py +++ b/apps/flowgraphs/satnogs_cw_decoder.py @@ -5,7 +5,7 @@ # Title: CW Decoder # Author: Manolis Surligas (surligas@gmail.com) # Description: A CW (Morse) Decoder -# Generated: Mon Jun 4 11:44:20 2018 +# Generated: Sun Aug 19 21:56:19 2018 ################################################## from gnuradio import analog @@ -25,7 +25,7 @@ import time class satnogs_cw_decoder(gr.top_block): - def __init__(self, antenna=satnogs.not_set_antenna, bb_gain=satnogs.not_set_rx_bb_gain, bfo_freq=1e3, decoded_data_file_path='/tmp/.satnogs/data/data', dev_args=satnogs.not_set_dev_args, doppler_correction_per_sec=1000, enable_iq_dump=0, file_path='test.txt', if_gain=satnogs.not_set_rx_if_gain, iq_file_path='/tmp/iq.dat', lo_offset=100e3, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', udp_IP='127.0.0.1', udp_port=16887, waterfall_file_path='/tmp/waterfall.dat', wpm=20): + def __init__(self, antenna=satnogs.not_set_antenna, bb_gain=satnogs.not_set_rx_bb_gain, bfo_freq=1e3, decoded_data_file_path='/tmp/.satnogs/data/data', dev_args=satnogs.not_set_dev_args, doppler_correction_per_sec=1000, enable_iq_dump=0, file_path='test.txt', if_gain=satnogs.not_set_rx_if_gain, iq_file_path='/tmp/iq.dat', lo_offset=100e3, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', udp_IP='127.0.0.1', udp_port=16887, waterfall_file_path='/tmp/waterfall.dat', wpm=20, samp_rate_rx=satnogs.not_set_samp_rate_rx): gr.top_block.__init__(self, "CW Decoder") ################################################## @@ -51,13 +51,11 @@ class satnogs_cw_decoder(gr.top_block): self.udp_port = udp_port self.waterfall_file_path = waterfall_file_path self.wpm = wpm + self.samp_rate_rx = samp_rate_rx ################################################## # Variables ################################################## - self.samp_rate_rx = samp_rate_rx = satnogs.hw_rx_settings[rx_sdr_device]['samp_rate'] - self.xlating_decimation = xlating_decimation = int(samp_rate_rx/100e3) - self.xlate_filter_taps = xlate_filter_taps = firdes.low_pass(1, samp_rate_rx, 125000, 25000, firdes.WIN_HAMMING, 6.76) self.audio_samp_rate = audio_samp_rate = 48000 ################################################## @@ -65,21 +63,21 @@ class satnogs_cw_decoder(gr.top_block): ################################################## self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate, 0.0, 10, 1024, waterfall_file_path, 1) self.satnogs_udp_msg_sink_0_0 = satnogs.udp_msg_sink(udp_IP, udp_port, 1500) - self.satnogs_tcp_rigctl_msg_source_0 = satnogs.tcp_rigctl_msg_source("127.0.0.1", rigctl_port, False, 50, 1500) + self.satnogs_tcp_rigctl_msg_source_0 = satnogs.tcp_rigctl_msg_source("127.0.0.1", rigctl_port, False, 1000, 1500) self.satnogs_ogg_encoder_0 = satnogs.ogg_encoder(file_path, audio_samp_rate, 1.0) self.satnogs_morse_decoder_0 = satnogs.morse_decoder(ord('#'), 3) self.satnogs_iq_sink_0 = satnogs.iq_sink(16768, iq_file_path, False, enable_iq_dump) self.satnogs_frame_file_sink_0_0 = satnogs.frame_file_sink(decoded_data_file_path, 0) self.satnogs_cw_to_symbol_0 = satnogs.cw_to_symbol(audio_samp_rate/4, 0.4, 0.75, wpm) - self.satnogs_coarse_doppler_correction_cc_0 = satnogs.coarse_doppler_correction_cc(rx_freq, samp_rate_rx / xlating_decimation) + self.satnogs_coarse_doppler_correction_cc_0 = satnogs.coarse_doppler_correction_cc(rx_freq, satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx)) self.pfb_arb_resampler_xxx_0 = pfb.arb_resampler_ccf( - (audio_samp_rate) / (samp_rate_rx / xlating_decimation), + audio_samp_rate/satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx), taps=None, flt_size=32) self.pfb_arb_resampler_xxx_0.declare_sample_delay(0) self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + satnogs.handle_rx_dev_args(rx_sdr_device, dev_args) ) - self.osmosdr_source_0.set_sample_rate(samp_rate_rx) + self.osmosdr_source_0.set_sample_rate(satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx)) self.osmosdr_source_0.set_center_freq(rx_freq - lo_offset, 0) self.osmosdr_source_0.set_freq_corr(ppm, 0) self.osmosdr_source_0.set_dc_offset_mode(2, 0) @@ -89,13 +87,13 @@ class satnogs_cw_decoder(gr.top_block): self.osmosdr_source_0.set_if_gain(satnogs.handle_rx_if_gain(rx_sdr_device, if_gain), 0) self.osmosdr_source_0.set_bb_gain(satnogs.handle_rx_bb_gain(rx_sdr_device, bb_gain), 0) self.osmosdr_source_0.set_antenna(satnogs.handle_rx_antenna(rx_sdr_device, antenna), 0) - self.osmosdr_source_0.set_bandwidth(samp_rate_rx, 0) + self.osmosdr_source_0.set_bandwidth(satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx), 0) self.low_pass_filter_0_0 = filter.fir_filter_fff(4, firdes.low_pass( 4, audio_samp_rate, 100, 100, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_0 = filter.fir_filter_ccf(1, firdes.low_pass( 1, audio_samp_rate, 2e3, 1e3, firdes.WIN_HAMMING, 6.76)) - self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(xlating_decimation, (xlate_filter_taps), lo_offset, samp_rate_rx) + self.blocks_rotator_cc_0 = blocks.rotator_cc(-2.0 * math.pi * (lo_offset / satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx))) self.blocks_multiply_xx_0 = blocks.multiply_vcc(1) self.blocks_complex_to_real_0 = blocks.complex_to_real(1) self.blocks_complex_to_mag_squared_0 = blocks.complex_to_mag_squared(1) @@ -122,11 +120,11 @@ class satnogs_cw_decoder(gr.top_block): self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.analog_agc_xx_0, 0)) self.connect((self.blocks_complex_to_real_0, 0), (self.satnogs_ogg_encoder_0, 0)) self.connect((self.blocks_multiply_xx_0, 0), (self.blocks_complex_to_real_0, 0)) - self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0)) + self.connect((self.blocks_rotator_cc_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0)) self.connect((self.low_pass_filter_0, 0), (self.analog_agc2_xx_0_0, 0)) self.connect((self.low_pass_filter_0, 0), (self.analog_pll_carriertracking_cc_0, 0)) self.connect((self.low_pass_filter_0_0, 0), (self.satnogs_cw_to_symbol_0, 0)) - self.connect((self.osmosdr_source_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) + self.connect((self.osmosdr_source_0, 0), (self.blocks_rotator_cc_0, 0)) self.connect((self.pfb_arb_resampler_xxx_0, 0), (self.low_pass_filter_0, 0)) self.connect((self.pfb_arb_resampler_xxx_0, 0), (self.satnogs_iq_sink_0, 0)) self.connect((self.pfb_arb_resampler_xxx_0, 0), (self.satnogs_waterfall_sink_0, 0)) @@ -202,7 +200,7 @@ class satnogs_cw_decoder(gr.top_block): def set_lo_offset(self, lo_offset): self.lo_offset = lo_offset self.osmosdr_source_0.set_center_freq(self.rx_freq - self.lo_offset, 0) - self.freq_xlating_fir_filter_xxx_0.set_center_freq(self.lo_offset) + self.blocks_rotator_cc_0.set_phase_inc(-2.0 * math.pi * (self.lo_offset / satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx))) def get_ppm(self): return self.ppm @@ -237,11 +235,14 @@ class satnogs_cw_decoder(gr.top_block): def set_rx_sdr_device(self, rx_sdr_device): self.rx_sdr_device = rx_sdr_device - self.set_samp_rate_rx(satnogs.hw_rx_settings[self.rx_sdr_device]['samp_rate']) + self.pfb_arb_resampler_xxx_0.set_rate(self.audio_samp_rate/satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx)) + self.osmosdr_source_0.set_sample_rate(satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx)) self.osmosdr_source_0.set_gain(satnogs.handle_rx_rf_gain(self.rx_sdr_device, self.rf_gain), 0) self.osmosdr_source_0.set_if_gain(satnogs.handle_rx_if_gain(self.rx_sdr_device, self.if_gain), 0) self.osmosdr_source_0.set_bb_gain(satnogs.handle_rx_bb_gain(self.rx_sdr_device, self.bb_gain), 0) self.osmosdr_source_0.set_antenna(satnogs.handle_rx_antenna(self.rx_sdr_device, self.antenna), 0) + self.osmosdr_source_0.set_bandwidth(satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx), 0) + self.blocks_rotator_cc_0.set_phase_inc(-2.0 * math.pi * (self.lo_offset / satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx))) def get_udp_IP(self): return self.udp_IP @@ -272,32 +273,17 @@ class satnogs_cw_decoder(gr.top_block): def set_samp_rate_rx(self, samp_rate_rx): self.samp_rate_rx = samp_rate_rx - self.set_xlating_decimation(int(self.samp_rate_rx/100e3)) - self.set_xlate_filter_taps(firdes.low_pass(1, self.samp_rate_rx, 125000, 25000, firdes.WIN_HAMMING, 6.76)) - self.pfb_arb_resampler_xxx_0.set_rate((self.audio_samp_rate) / (self.samp_rate_rx / self.xlating_decimation)) - self.osmosdr_source_0.set_sample_rate(self.samp_rate_rx) - self.osmosdr_source_0.set_bandwidth(self.samp_rate_rx, 0) - - def get_xlating_decimation(self): - return self.xlating_decimation - - def set_xlating_decimation(self, xlating_decimation): - self.xlating_decimation = xlating_decimation - self.pfb_arb_resampler_xxx_0.set_rate((self.audio_samp_rate) / (self.samp_rate_rx / self.xlating_decimation)) - - def get_xlate_filter_taps(self): - return self.xlate_filter_taps - - def set_xlate_filter_taps(self, xlate_filter_taps): - self.xlate_filter_taps = xlate_filter_taps - self.freq_xlating_fir_filter_xxx_0.set_taps((self.xlate_filter_taps)) + self.pfb_arb_resampler_xxx_0.set_rate(self.audio_samp_rate/satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx)) + self.osmosdr_source_0.set_sample_rate(satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx)) + self.osmosdr_source_0.set_bandwidth(satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx), 0) + self.blocks_rotator_cc_0.set_phase_inc(-2.0 * math.pi * (self.lo_offset / satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx))) def get_audio_samp_rate(self): return self.audio_samp_rate def set_audio_samp_rate(self, audio_samp_rate): self.audio_samp_rate = audio_samp_rate - self.pfb_arb_resampler_xxx_0.set_rate((self.audio_samp_rate) / (self.samp_rate_rx / self.xlating_decimation)) + self.pfb_arb_resampler_xxx_0.set_rate(self.audio_samp_rate/satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx)) self.low_pass_filter_0_0.set_taps(firdes.low_pass(4, self.audio_samp_rate, 100, 100, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.audio_samp_rate, 2e3, 1e3, firdes.WIN_HAMMING, 6.76)) self.analog_sig_source_x_0.set_sampling_freq(self.audio_samp_rate) @@ -368,6 +354,9 @@ def argument_parser(): parser.add_option( "", "--wpm", dest="wpm", type="intx", default=20, help="Set wpm [default=%default]") + parser.add_option( + "", "--samp-rate-rx", dest="samp_rate_rx", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_samp_rate_rx), + help="Set samp_rate_rx [default=%default]") return parser @@ -375,7 +364,7 @@ def main(top_block_cls=satnogs_cw_decoder, options=None): if options is None: options, _ = argument_parser().parse_args() - tb = top_block_cls(antenna=options.antenna, bb_gain=options.bb_gain, bfo_freq=options.bfo_freq, decoded_data_file_path=options.decoded_data_file_path, dev_args=options.dev_args, doppler_correction_per_sec=options.doppler_correction_per_sec, enable_iq_dump=options.enable_iq_dump, file_path=options.file_path, if_gain=options.if_gain, iq_file_path=options.iq_file_path, lo_offset=options.lo_offset, ppm=options.ppm, rf_gain=options.rf_gain, rigctl_port=options.rigctl_port, rx_freq=options.rx_freq, rx_sdr_device=options.rx_sdr_device, udp_IP=options.udp_IP, udp_port=options.udp_port, waterfall_file_path=options.waterfall_file_path, wpm=options.wpm) + tb = top_block_cls(antenna=options.antenna, bb_gain=options.bb_gain, bfo_freq=options.bfo_freq, decoded_data_file_path=options.decoded_data_file_path, dev_args=options.dev_args, doppler_correction_per_sec=options.doppler_correction_per_sec, enable_iq_dump=options.enable_iq_dump, file_path=options.file_path, if_gain=options.if_gain, iq_file_path=options.iq_file_path, lo_offset=options.lo_offset, ppm=options.ppm, rf_gain=options.rf_gain, rigctl_port=options.rigctl_port, rx_freq=options.rx_freq, rx_sdr_device=options.rx_sdr_device, udp_IP=options.udp_IP, udp_port=options.udp_port, waterfall_file_path=options.waterfall_file_path, wpm=options.wpm, samp_rate_rx=options.samp_rate_rx) tb.start() tb.wait() diff --git a/python/satnogs_info.py.in b/python/satnogs_info.py.in index 46a56de..40cb9d2 100644 --- a/python/satnogs_info.py.in +++ b/python/satnogs_info.py.in @@ -4,10 +4,9 @@ import sys import json -VERSION = "@VERSION_INFO_MAJOR_VERSION@.@VERSION_INFO_API_COMPAT@.@VERSION_INFO_MINOR_VERSION@" INFO = { "name": "gr-satnogs", - "version": VERSION, + "version": "@VERSION@", } json.dump(INFO, sys.stdout)