Change the CW decoder RF architecture

The CW decoder flowgraph is now amplituded based
assisted by a PLL.
This commit is contained in:
Manolis Surligas 2018-01-05 16:40:44 +02:00
parent fd75575828
commit 72e59ee1a6
2 changed files with 180 additions and 463 deletions

View File

@ -135,33 +135,6 @@
<value>5</value>
</param>
</block>
<block>
<key>variable</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(175, 546)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>ndelay</value>
</param>
<param>
<key>value</key>
<value>250</value>
</param>
</block>
<block>
<key>variable</key>
<param>
@ -175,7 +148,7 @@ TX sampling rate</value>
</param>
<param>
<key>_coordinate</key>
<value>(247, 546)</value>
<value>(231, 547)</value>
</param>
<param>
<key>_rotation</key>
@ -190,53 +163,6 @@ TX sampling rate</value>
<value>satnogs.hw_rx_settings[rx_sdr_device]['samp_rate']</value>
</param>
</block>
<block>
<key>variable_low_pass_filter_taps</key>
<param>
<key>beta</key>
<value>6.76</value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>cutoff_freq</key>
<value>100e3</value>
</param>
<param>
<key>_enabled</key>
<value>1</value>
</param>
<param>
<key>_coordinate</key>
<value>(31, 542)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>gain</key>
<value>12.0</value>
</param>
<param>
<key>id</key>
<value>taps</value>
</param>
<param>
<key>samp_rate</key>
<value>samp_rate_rx</value>
</param>
<param>
<key>width</key>
<value>60000</value>
</param>
<param>
<key>win</key>
<value>firdes.WIN_HAMMING</value>
</param>
</block>
<block>
<key>variable</key>
<param>
@ -249,7 +175,7 @@ TX sampling rate</value>
</param>
<param>
<key>_coordinate</key>
<value>(1723, 219)</value>
<value>(23, 547)</value>
</param>
<param>
<key>_rotation</key>
@ -292,11 +218,7 @@ TX sampling rate</value>
</param>
</block>
<block>
<key>analog_agc2_xx</key>
<param>
<key>attack_rate</key>
<value>0.1</value>
</param>
<key>analog_pll_carriertracking_cc</key>
<param>
<key>alias</key>
<value></value>
@ -309,50 +231,42 @@ TX sampling rate</value>
<key>affinity</key>
<value></value>
</param>
<param>
<key>decay_rate</key>
<value>0.8</value>
</param>
<param>
<key>_enabled</key>
<value>1</value>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(981, 263)</value>
<value>(983, 275)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>gain</key>
<value>0.0</value>
</param>
<param>
<key>id</key>
<value>analog_agc2_xx_0</value>
<value>analog_pll_carriertracking_cc_0</value>
</param>
<param>
<key>max_gain</key>
<value>1e3</value>
<key>w</key>
<value>2*math.pi/100</value>
</param>
<param>
<key>max_freq</key>
<value>2*math.pi*2e3/(samp_rate_rx/xlating_decimation/lpf_decimation)</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>min_freq</key>
<value>-2*math.pi*2e3/(samp_rate_rx/xlating_decimation/lpf_decimation)</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>reference</key>
<value>0.6</value>
</param>
<param>
<key>type</key>
<value>complex</value>
</param>
</block>
<block>
<key>parameter</key>
@ -460,7 +374,7 @@ TX sampling rate</value>
</param>
<param>
<key>_coordinate</key>
<value>(1739, 327)</value>
<value>(1374, 295)</value>
</param>
<param>
<key>_rotation</key>
@ -503,7 +417,7 @@ TX sampling rate</value>
</param>
<param>
<key>_coordinate</key>
<value>(1069, 199)</value>
<value>(1070, 159)</value>
</param>
<param>
<key>_rotation</key>
@ -526,203 +440,6 @@ TX sampling rate</value>
<value>1</value>
</param>
</block>
<block>
<key>blocks_delay</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>delay</key>
<value>ndelay</value>
</param>
<param>
<key>_enabled</key>
<value>1</value>
</param>
<param>
<key>_coordinate</key>
<value>(1172, 379)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>blocks_delay_0</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>num_ports</key>
<value>1</value>
</param>
<param>
<key>type</key>
<value>complex</value>
</param>
<param>
<key>vlen</key>
<value>1</value>
</param>
</block>
<block>
<key>blocks_moving_average_xx</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>1</value>
</param>
<param>
<key>_coordinate</key>
<value>(1883, 394)</value>
</param>
<param>
<key>_rotation</key>
<value>180</value>
</param>
<param>
<key>id</key>
<value>blocks_moving_average_xx_0</value>
</param>
<param>
<key>length</key>
<value>ndelay</value>
</param>
<param>
<key>max_iter</key>
<value>40</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>scale</key>
<value>1</value>
</param>
<param>
<key>type</key>
<value>float</value>
</param>
</block>
<block>
<key>blocks_multiply_conjugate_cc</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>1</value>
</param>
<param>
<key>_coordinate</key>
<value>(1316, 311)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>blocks_multiply_conjugate_cc_0</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>vlen</key>
<value>1</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>alias</key>
<value>700</value>
</param>
<param>
<key>comment</key>
<value>Offset in Hz from the carrier frequency in order the
CW beacon to be audable.</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(678, 546)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>cw_offset</value>
</param>
<param>
<key>label</key>
<value></value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
</param>
<param>
<key>value</key>
<value>700</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
@ -938,61 +655,6 @@ CW beacon to be audable.</value>
<value>test.txt</value>
</param>
</block>
<block>
<key>fir_filter_xxx</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>decim</key>
<value>1</value>
</param>
<param>
<key>_enabled</key>
<value>1</value>
</param>
<param>
<key>_coordinate</key>
<value>(1531, 315)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>fir_filter_xxx_0</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>samp_delay</key>
<value>0</value>
</param>
<param>
<key>taps</key>
<value>[1,] * ndelay</value>
</param>
<param>
<key>type</key>
<value>ccc</value>
</param>
</block>
<block>
<key>freq_xlating_fir_filter_xxx</key>
<param>
@ -1001,7 +663,7 @@ CW beacon to be audable.</value>
</param>
<param>
<key>center_freq</key>
<value>lo_offset - cw_offset</value>
<value>lo_offset</value>
</param>
<param>
<key>comment</key>
@ -1126,6 +788,37 @@ CW beacon to be audable.</value>
<value>import satnogs</value>
</param>
</block>
<block>
<key>import</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(255, 83)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>import_1</value>
</param>
<param>
<key>import</key>
<value>import math</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
@ -1257,7 +950,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>gain</key>
<value>1</value>
<value>lpf_decimation</value>
</param>
<param>
<key>id</key>
@ -1281,7 +974,82 @@ we shift the LO a little further</value>
</param>
<param>
<key>width</key>
<value>500</value>
<value>1e3</value>
</param>
<param>
<key>win</key>
<value>firdes.WIN_HAMMING</value>
</param>
</block>
<block>
<key>low_pass_filter</key>
<param>
<key>beta</key>
<value>6.76</value>
</param>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>cutoff_freq</key>
<value>100</value>
</param>
<param>
<key>decim</key>
<value>4</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>type</key>
<value>fir_filter_ccf</value>
</param>
<param>
<key>_coordinate</key>
<value>(1182, 247)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>gain</key>
<value>4</value>
</param>
<param>
<key>id</key>
<value>low_pass_filter_0_0</value>
</param>
<param>
<key>interp</key>
<value>1</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>samp_rate</key>
<value>samp_rate_rx/xlating_decimation/lpf_decimation</value>
</param>
<param>
<key>width</key>
<value>100</value>
</param>
<param>
<key>win</key>
@ -3020,7 +2788,7 @@ we shift the LO a little further</value>
<key>satnogs_cw_to_symbol</key>
<param>
<key>threshold</key>
<value>300000</value>
<value>0.25</value>
</param>
<param>
<key>alias</key>
@ -3032,7 +2800,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>conf_level</key>
<value>0.9</value>
<value>0.75</value>
</param>
<param>
<key>affinity</key>
@ -3044,7 +2812,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>_coordinate</key>
<value>(1627, 406)</value>
<value>(1366, 391)</value>
</param>
<param>
<key>_rotation</key>
@ -3064,7 +2832,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>sampling_rate</key>
<value>int((samp_rate_rx/xlating_decimation)/lpf_decimation)</value>
<value>samp_rate_rx/xlating_decimation/lpf_decimation/4</value>
</param>
<param>
<key>wpm</key>
@ -3091,7 +2859,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>_coordinate</key>
<value>(1093, 450)</value>
<value>(903, 403)</value>
</param>
<param>
<key>_rotation</key>
@ -3138,7 +2906,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>_coordinate</key>
<value>(1069, 123)</value>
<value>(1070, 83)</value>
</param>
<param>
<key>_rotation</key>
@ -3177,7 +2945,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>_coordinate</key>
<value>(1396, 426)</value>
<value>(1142, 411)</value>
</param>
<param>
<key>_rotation</key>
@ -3224,7 +2992,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>_coordinate</key>
<value>(1244, 179)</value>
<value>(1246, 139)</value>
</param>
<param>
<key>_rotation</key>
@ -3334,7 +3102,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>_coordinate</key>
<value>(1069, 7)</value>
<value>(647, 23)</value>
</param>
<param>
<key>_rotation</key>
@ -3444,20 +3212,14 @@ we shift the LO a little further</value>
</param>
</block>
<connection>
<source_block_id>analog_agc2_xx_0</source_block_id>
<sink_block_id>blocks_delay_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>analog_agc2_xx_0</source_block_id>
<sink_block_id>blocks_multiply_conjugate_cc_0</sink_block_id>
<source_block_id>analog_pll_carriertracking_cc_0</source_block_id>
<sink_block_id>low_pass_filter_0_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>blocks_complex_to_mag_squared_0</source_block_id>
<sink_block_id>blocks_moving_average_xx_0</sink_block_id>
<sink_block_id>satnogs_cw_to_symbol_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
@ -3467,39 +3229,21 @@ we shift the LO a little further</value>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>blocks_delay_0</source_block_id>
<sink_block_id>blocks_multiply_conjugate_cc_0</sink_block_id>
<source_key>0</source_key>
<sink_key>1</sink_key>
</connection>
<connection>
<source_block_id>blocks_moving_average_xx_0</source_block_id>
<sink_block_id>satnogs_cw_to_symbol_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>blocks_multiply_conjugate_cc_0</source_block_id>
<sink_block_id>fir_filter_xxx_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>fir_filter_xxx_0</source_block_id>
<sink_block_id>blocks_complex_to_mag_squared_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>freq_xlating_fir_filter_xxx_0</source_block_id>
<sink_block_id>low_pass_filter_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>freq_xlating_fir_filter_xxx_0</source_block_id>
<sink_block_id>satnogs_waterfall_sink_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>low_pass_filter_0</source_block_id>
<sink_block_id>analog_agc2_xx_0</sink_block_id>
<sink_block_id>analog_pll_carriertracking_cc_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
@ -3509,6 +3253,12 @@ we shift the LO a little further</value>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>low_pass_filter_0_0</source_block_id>
<sink_block_id>blocks_complex_to_mag_squared_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>osmosdr_source_0</source_block_id>
<sink_block_id>satnogs_coarse_doppler_correction_cc_0</sink_block_id>
@ -3527,12 +3277,6 @@ we shift the LO a little further</value>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>rational_resampler_xxx_0</source_block_id>
<sink_block_id>satnogs_waterfall_sink_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>satnogs_coarse_doppler_correction_cc_0</source_block_id>
<sink_block_id>freq_xlating_fir_filter_xxx_0</sink_block_id>

View File

@ -5,7 +5,7 @@
# Title: CW Decoder
# Author: Manolis Surligas (surligas@gmail.com)
# Description: A CW (Morse) Decoder
# Generated: Thu Nov 2 13:59:29 2017
# Generated: Fri Jan 5 22:45:33 2018
##################################################
from gnuradio import analog
@ -16,6 +16,7 @@ from gnuradio import gr
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from optparse import OptionParser
import math
import osmosdr
import satnogs
import time
@ -23,7 +24,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, cw_offset=700, 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', waterfall_file_path='/tmp/waterfall.dat', wpm=20):
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.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', waterfall_file_path='/tmp/waterfall.dat', wpm=20):
gr.top_block.__init__(self, "CW Decoder")
##################################################
@ -31,7 +32,6 @@ class satnogs_cw_decoder(gr.top_block):
##################################################
self.antenna = antenna
self.bb_gain = bb_gain
self.cw_offset = cw_offset
self.decoded_data_file_path = decoded_data_file_path
self.dev_args = dev_args
self.doppler_correction_per_sec = doppler_correction_per_sec
@ -54,10 +54,6 @@ class satnogs_cw_decoder(gr.top_block):
self.samp_rate_rx = samp_rate_rx = satnogs.hw_rx_settings[rx_sdr_device]['samp_rate']
self.xlating_decimation = xlating_decimation = 5
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.ndelay = ndelay = 250
self.lpf_decimation = lpf_decimation = 5
self.audio_samp_rate = audio_samp_rate = 48000
@ -70,7 +66,7 @@ class satnogs_cw_decoder(gr.top_block):
self.satnogs_morse_decoder_0 = satnogs.morse_decoder(ord('#'))
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(int((samp_rate_rx/xlating_decimation)/lpf_decimation), 300000, 0.9, wpm)
self.satnogs_cw_to_symbol_0 = satnogs.cw_to_symbol(samp_rate_rx/xlating_decimation/lpf_decimation/4, 0.25, 0.75, wpm)
self.satnogs_coarse_doppler_correction_cc_0 = satnogs.coarse_doppler_correction_cc(rx_freq, samp_rate_rx)
self.rational_resampler_xxx_0 = filter.rational_resampler_ccc(
interpolation=audio_samp_rate,
@ -91,18 +87,14 @@ class satnogs_cw_decoder(gr.top_block):
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.low_pass_filter_0_0 = filter.fir_filter_ccf(4, firdes.low_pass(
4, samp_rate_rx/xlating_decimation/lpf_decimation, 100, 100, firdes.WIN_HAMMING, 6.76))
self.low_pass_filter_0 = filter.fir_filter_ccf(lpf_decimation, firdes.low_pass(
1, samp_rate_rx/xlating_decimation, 2e3, 500, 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 - cw_offset, samp_rate_rx)
self.fir_filter_xxx_0 = filter.fir_filter_ccc(1, ([1,] * ndelay))
self.fir_filter_xxx_0.declare_sample_delay(0)
self.blocks_multiply_conjugate_cc_0 = blocks.multiply_conjugate_cc(1)
self.blocks_moving_average_xx_0 = blocks.moving_average_ff(ndelay, 1, 40)
self.blocks_delay_0 = blocks.delay(gr.sizeof_gr_complex*1, ndelay)
lpf_decimation, samp_rate_rx/xlating_decimation, 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_complex_to_real_0 = blocks.complex_to_real(1)
self.blocks_complex_to_mag_squared_0 = blocks.complex_to_mag_squared(1)
self.analog_agc2_xx_0 = analog.agc2_cc(0.1, 0.8, 0.6, 0.0)
self.analog_agc2_xx_0.set_max_gain(1e3)
self.analog_pll_carriertracking_cc_0 = analog.pll_carriertracking_cc(2*math.pi/100, 2*math.pi*2e3/(samp_rate_rx/xlating_decimation/lpf_decimation), -2*math.pi*2e3/(samp_rate_rx/xlating_decimation/lpf_decimation))
##################################################
# Connections
@ -110,21 +102,17 @@ class satnogs_cw_decoder(gr.top_block):
self.msg_connect((self.satnogs_cw_to_symbol_0, 'out'), (self.satnogs_morse_decoder_0, 'in'))
self.msg_connect((self.satnogs_morse_decoder_0, 'out'), (self.satnogs_frame_file_sink_0_0, 'frame'))
self.msg_connect((self.satnogs_tcp_rigctl_msg_source_0, 'freq'), (self.satnogs_coarse_doppler_correction_cc_0, 'freq'))
self.connect((self.analog_agc2_xx_0, 0), (self.blocks_delay_0, 0))
self.connect((self.analog_agc2_xx_0, 0), (self.blocks_multiply_conjugate_cc_0, 0))
self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.blocks_moving_average_xx_0, 0))
self.connect((self.analog_pll_carriertracking_cc_0, 0), (self.low_pass_filter_0_0, 0))
self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.satnogs_cw_to_symbol_0, 0))
self.connect((self.blocks_complex_to_real_0, 0), (self.satnogs_ogg_encoder_0, 0))
self.connect((self.blocks_delay_0, 0), (self.blocks_multiply_conjugate_cc_0, 1))
self.connect((self.blocks_moving_average_xx_0, 0), (self.satnogs_cw_to_symbol_0, 0))
self.connect((self.blocks_multiply_conjugate_cc_0, 0), (self.fir_filter_xxx_0, 0))
self.connect((self.fir_filter_xxx_0, 0), (self.blocks_complex_to_mag_squared_0, 0))
self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.low_pass_filter_0, 0))
self.connect((self.low_pass_filter_0, 0), (self.analog_agc2_xx_0, 0))
self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.satnogs_waterfall_sink_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), (self.rational_resampler_xxx_0, 0))
self.connect((self.low_pass_filter_0_0, 0), (self.blocks_complex_to_mag_squared_0, 0))
self.connect((self.osmosdr_source_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0))
self.connect((self.rational_resampler_xxx_0, 0), (self.blocks_complex_to_real_0, 0))
self.connect((self.rational_resampler_xxx_0, 0), (self.satnogs_iq_sink_0, 0))
self.connect((self.rational_resampler_xxx_0, 0), (self.satnogs_waterfall_sink_0, 0))
self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0))
def get_antenna(self):
@ -141,13 +129,6 @@ class satnogs_cw_decoder(gr.top_block):
self.bb_gain = bb_gain
self.osmosdr_source_0.set_bb_gain(satnogs.handle_rx_bb_gain(self.rx_sdr_device, self.bb_gain), 0)
def get_cw_offset(self):
return self.cw_offset
def set_cw_offset(self, cw_offset):
self.cw_offset = cw_offset
self.freq_xlating_fir_filter_xxx_0.set_center_freq(self.lo_offset - self.cw_offset)
def get_decoded_data_file_path(self):
return self.decoded_data_file_path
@ -197,7 +178,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.cw_offset)
self.freq_xlating_fir_filter_xxx_0.set_center_freq(self.lo_offset)
def get_ppm(self):
return self.ppm
@ -258,14 +239,20 @@ class satnogs_cw_decoder(gr.top_block):
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)
self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.samp_rate_rx/self.xlating_decimation, 2e3, 500, firdes.WIN_HAMMING, 6.76))
self.low_pass_filter_0_0.set_taps(firdes.low_pass(4, self.samp_rate_rx/self.xlating_decimation/self.lpf_decimation, 100, 100, firdes.WIN_HAMMING, 6.76))
self.low_pass_filter_0.set_taps(firdes.low_pass(self.lpf_decimation, self.samp_rate_rx/self.xlating_decimation, 2e3, 1e3, firdes.WIN_HAMMING, 6.76))
self.analog_pll_carriertracking_cc_0.set_max_freq(2*math.pi*2e3/(self.samp_rate_rx/self.xlating_decimation/self.lpf_decimation))
self.analog_pll_carriertracking_cc_0.set_min_freq(-2*math.pi*2e3/(self.samp_rate_rx/self.xlating_decimation/self.lpf_decimation))
def get_xlating_decimation(self):
return self.xlating_decimation
def set_xlating_decimation(self, xlating_decimation):
self.xlating_decimation = xlating_decimation
self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.samp_rate_rx/self.xlating_decimation, 2e3, 500, firdes.WIN_HAMMING, 6.76))
self.low_pass_filter_0_0.set_taps(firdes.low_pass(4, self.samp_rate_rx/self.xlating_decimation/self.lpf_decimation, 100, 100, firdes.WIN_HAMMING, 6.76))
self.low_pass_filter_0.set_taps(firdes.low_pass(self.lpf_decimation, self.samp_rate_rx/self.xlating_decimation, 2e3, 1e3, firdes.WIN_HAMMING, 6.76))
self.analog_pll_carriertracking_cc_0.set_max_freq(2*math.pi*2e3/(self.samp_rate_rx/self.xlating_decimation/self.lpf_decimation))
self.analog_pll_carriertracking_cc_0.set_min_freq(-2*math.pi*2e3/(self.samp_rate_rx/self.xlating_decimation/self.lpf_decimation))
def get_xlate_filter_taps(self):
return self.xlate_filter_taps
@ -274,26 +261,15 @@ class satnogs_cw_decoder(gr.top_block):
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_ndelay(self):
return self.ndelay
def set_ndelay(self, ndelay):
self.ndelay = ndelay
self.fir_filter_xxx_0.set_taps(([1,] * self.ndelay))
self.blocks_moving_average_xx_0.set_length_and_scale(self.ndelay, 1)
self.blocks_delay_0.set_dly(self.ndelay)
def get_lpf_decimation(self):
return self.lpf_decimation
def set_lpf_decimation(self, lpf_decimation):
self.lpf_decimation = lpf_decimation
self.low_pass_filter_0_0.set_taps(firdes.low_pass(4, self.samp_rate_rx/self.xlating_decimation/self.lpf_decimation, 100, 100, firdes.WIN_HAMMING, 6.76))
self.low_pass_filter_0.set_taps(firdes.low_pass(self.lpf_decimation, self.samp_rate_rx/self.xlating_decimation, 2e3, 1e3, firdes.WIN_HAMMING, 6.76))
self.analog_pll_carriertracking_cc_0.set_max_freq(2*math.pi*2e3/(self.samp_rate_rx/self.xlating_decimation/self.lpf_decimation))
self.analog_pll_carriertracking_cc_0.set_min_freq(-2*math.pi*2e3/(self.samp_rate_rx/self.xlating_decimation/self.lpf_decimation))
def get_audio_samp_rate(self):
return self.audio_samp_rate
@ -311,9 +287,6 @@ def argument_parser():
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]")
parser.add_option(
"", "--cw-offset", dest="cw_offset", type="eng_float", default=eng_notation.num_to_str(700),
help="Set cw_offset [default=%default]")
parser.add_option(
"", "--decoded-data-file-path", dest="decoded_data_file_path", type="string", default='/tmp/.satnogs/data/data',
help="Set decoded_data_file_path [default=%default]")
@ -366,7 +339,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, cw_offset=options.cw_offset, 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, waterfall_file_path=options.waterfall_file_path, wpm=options.wpm)
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, 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, waterfall_file_path=options.waterfall_file_path, wpm=options.wpm)
tb.start()
tb.wait()