Fix CW decoder

* Fix CW decoder
* Link with boost chrono to avoid a linking error in boost 1.67
This commit is contained in:
Manolis Surligas 2018-05-21 19:49:52 +03:00
parent dbfb6e6562
commit 85219e5d6b
3 changed files with 278 additions and 353 deletions

View File

@ -74,7 +74,7 @@ set(Boost_ADDITIONAL_VERSIONS
"1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
"1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
)
find_package(Boost "1.35" COMPONENTS filesystem system)
find_package(Boost "1.35" COMPONENTS filesystem system chrono thread)
if(NOT Boost_FOUND)
message(FATAL_ERROR "Boost required to compile satnogs")

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.11'?>
<?grc format='1' created='3.7.12'?>
<flow_graph>
<timestamp>Thu May 5 00:22:45 2016</timestamp>
<block>
@ -72,6 +72,10 @@
<key>run</key>
<value>True</value>
</param>
<param>
<key>sizing_mode</key>
<value>fixed</value>
</param>
<param>
<key>thread_safe_setters</key>
<value></value>
@ -80,6 +84,10 @@
<key>title</key>
<value>CW Decoder</value>
</param>
<param>
<key>placement</key>
<value>(0,0)</value>
</param>
</block>
<block>
<key>variable</key>
@ -108,33 +116,6 @@
<value>48000</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>(574, 546)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>lpf_decimation</value>
</param>
<param>
<key>value</key>
<value>5</value>
</param>
</block>
<block>
<key>variable</key>
<param>
@ -280,6 +261,65 @@ TX sampling rate</value>
<value>complex</value>
</param>
</block>
<block>
<key>analog_agc_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>(1372, 339)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>gain</key>
<value>1.0</value>
</param>
<param>
<key>id</key>
<value>analog_agc_xx_0</value>
</param>
<param>
<key>max_gain</key>
<value>65536</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>rate</key>
<value>1e-4</value>
</param>
<param>
<key>reference</key>
<value>1.0</value>
</param>
<param>
<key>type</key>
<value>float</value>
</param>
</block>
<block>
<key>analog_pll_carriertracking_cc</key>
<param>
@ -316,7 +356,7 @@ TX sampling rate</value>
</param>
<param>
<key>max_freq</key>
<value>2*math.pi*2e3/(samp_rate_rx/xlating_decimation/lpf_decimation)</value>
<value>2*math.pi*2e3/audio_samp_rate</value>
</param>
<param>
<key>maxoutbuf</key>
@ -324,7 +364,7 @@ TX sampling rate</value>
</param>
<param>
<key>min_freq</key>
<value>-2*math.pi*2e3/(samp_rate_rx/xlating_decimation/lpf_decimation)</value>
<value>-2*math.pi*2e3/audio_samp_rate</value>
</param>
<param>
<key>minoutbuf</key>
@ -428,6 +468,10 @@ TX sampling rate</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>string</value>
@ -471,6 +515,10 @@ TX sampling rate</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
@ -516,6 +564,10 @@ tone. This tone is typically 1 kHz.</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
@ -611,61 +663,6 @@ tone. This tone is typically 1 kHz.</value>
<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>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(1400, 348)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>blocks_moving_average_xx_0</value>
</param>
<param>
<key>length</key>
<value>300</value>
</param>
<param>
<key>max_iter</key>
<value>4000</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_xx</key>
<param>
@ -751,6 +748,10 @@ tone. This tone is typically 1 kHz.</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>string</value>
@ -794,6 +795,10 @@ tone. This tone is typically 1 kHz.</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>string</value>
@ -837,6 +842,10 @@ tone. This tone is typically 1 kHz.</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>intx</value>
@ -880,6 +889,10 @@ tone. This tone is typically 1 kHz.</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>intx</value>
@ -923,6 +936,10 @@ tone. This tone is typically 1 kHz.</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>string</value>
@ -960,7 +977,7 @@ tone. This tone is typically 1 kHz.</value>
</param>
<param>
<key>_coordinate</key>
<value>(520, 188)</value>
<value>(287, 379)</value>
</param>
<param>
<key>_rotation</key>
@ -1025,6 +1042,10 @@ tone. This tone is typically 1 kHz.</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
@ -1130,6 +1151,10 @@ tone. This tone is typically 1 kHz.</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>string</value>
@ -1174,6 +1199,10 @@ we shift the LO a little further</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
@ -1195,7 +1224,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>comment</key>
<value>Output samplerate: 100k / 5 = 20k</value>
<value></value>
</param>
<param>
<key>affinity</key>
@ -1207,7 +1236,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>decim</key>
<value>lpf_decimation</value>
<value>1</value>
</param>
<param>
<key>_enabled</key>
@ -1219,7 +1248,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>_coordinate</key>
<value>(768, 284)</value>
<value>(1268, 179)</value>
</param>
<param>
<key>_rotation</key>
@ -1227,7 +1256,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>gain</key>
<value>lpf_decimation</value>
<value>1</value>
</param>
<param>
<key>id</key>
@ -1247,7 +1276,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>samp_rate</key>
<value>samp_rate_rx/xlating_decimation</value>
<value>audio_samp_rate</value>
</param>
<param>
<key>width</key>
@ -1322,7 +1351,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>samp_rate</key>
<value>samp_rate_rx/xlating_decimation/lpf_decimation</value>
<value>audio_samp_rate</value>
</param>
<param>
<key>width</key>
@ -2740,6 +2769,69 @@ we shift the LO a little further</value>
<value></value>
</param>
</block>
<block>
<key>pfb_arb_resampler_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>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(662, 227)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>pfb_arb_resampler_xxx_0</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>nfilts</key>
<value>32</value>
</param>
<param>
<key>rrate</key>
<value>(audio_samp_rate) / (samp_rate_rx / xlating_decimation)</value>
</param>
<param>
<key>samp_delay</key>
<value>0</value>
</param>
<param>
<key>atten</key>
<value>80</value>
</param>
<param>
<key>taps</key>
<value></value>
</param>
<param>
<key>type</key>
<value>ccf</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
@ -2774,6 +2866,10 @@ we shift the LO a little further</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>intx</value>
@ -2783,124 +2879,6 @@ we shift the LO a little further</value>
<value>0</value>
</param>
</block>
<block>
<key>rational_resampler_xxx</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value>Output samplerate: 48k</value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>decim</key>
<value>int((samp_rate_rx/xlating_decimation))</value>
</param>
<param>
<key>_enabled</key>
<value>1</value>
</param>
<param>
<key>fbw</key>
<value>0</value>
</param>
<param>
<key>_coordinate</key>
<value>(864, 76)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>rational_resampler_xxx_0</value>
</param>
<param>
<key>interp</key>
<value>audio_samp_rate</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>taps</key>
<value></value>
</param>
<param>
<key>type</key>
<value>ccc</value>
</param>
</block>
<block>
<key>rational_resampler_xxx</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value>Output samplerate: 48k</value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>decim</key>
<value>int((samp_rate_rx/xlating_decimation)/lpf_decimation)</value>
</param>
<param>
<key>_enabled</key>
<value>1</value>
</param>
<param>
<key>fbw</key>
<value>0</value>
</param>
<param>
<key>_coordinate</key>
<value>(1088, 580)</value>
</param>
<param>
<key>_rotation</key>
<value>180</value>
</param>
<param>
<key>id</key>
<value>rational_resampler_xxx_0_0</value>
</param>
<param>
<key>interp</key>
<value>audio_samp_rate</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>taps</key>
<value></value>
</param>
<param>
<key>type</key>
<value>ccc</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
@ -2935,6 +2913,10 @@ we shift the LO a little further</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
@ -2978,6 +2960,10 @@ we shift the LO a little further</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>intx</value>
@ -3021,6 +3007,10 @@ we shift the LO a little further</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
@ -3064,6 +3054,10 @@ we shift the LO a little further</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>string</value>
@ -3093,7 +3087,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>_coordinate</key>
<value>(280, 304)</value>
<value>(446, 239)</value>
</param>
<param>
<key>_rotation</key>
@ -3113,7 +3107,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>sampling_rate</key>
<value>samp_rate_rx</value>
<value>samp_rate_rx / xlating_decimation</value>
</param>
<param>
<key>target_freq</key>
@ -3124,7 +3118,7 @@ we shift the LO a little further</value>
<key>satnogs_cw_to_symbol</key>
<param>
<key>threshold</key>
<value>0.75</value>
<value>0.8</value>
</param>
<param>
<key>alias</key>
@ -3168,64 +3162,13 @@ we shift the LO a little further</value>
</param>
<param>
<key>sampling_rate</key>
<value>samp_rate_rx/xlating_decimation/lpf_decimation/4</value>
<value>audio_samp_rate/4</value>
</param>
<param>
<key>wpm</key>
<value>wpm</value>
</param>
</block>
<block>
<key>satnogs_doppler_correction_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>corrections_per_sec</key>
<value>1000</value>
</param>
<param>
<key>_enabled</key>
<value>0</value>
</param>
<param>
<key>_coordinate</key>
<value>(288, 192)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>satnogs_doppler_correction_cc_0</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>sampling_rate</key>
<value>samp_rate_rx</value>
</param>
<param>
<key>target_freq</key>
<value>rx_freq</value>
</param>
</block>
<block>
<key>satnogs_frame_file_sink</key>
<param>
@ -3593,6 +3536,10 @@ we shift the LO a little further</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>string</value>
@ -3636,6 +3583,10 @@ we shift the LO a little further</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>intx</value>
@ -3679,6 +3630,10 @@ we shift the LO a little further</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>string</value>
@ -3722,6 +3677,10 @@ we shift the LO a little further</value>
<key>short_id</key>
<value></value>
</param>
<param>
<key>hide</key>
<value>none</value>
</param>
<param>
<key>type</key>
<value>intx</value>
@ -3737,6 +3696,12 @@ we shift the LO a little further</value>
<source_key>0</source_key>
<sink_key>1</sink_key>
</connection>
<connection>
<source_block_id>analog_agc_xx_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>analog_pll_carriertracking_cc_0</source_block_id>
<sink_block_id>blocks_complex_to_mag_squared_0</sink_block_id>
@ -3751,7 +3716,7 @@ we shift the LO a little further</value>
</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>analog_agc_xx_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
@ -3761,27 +3726,15 @@ we shift the LO a little further</value>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>blocks_moving_average_xx_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_multiply_xx_0</source_block_id>
<sink_block_id>rational_resampler_xxx_0_0</sink_block_id>
<sink_block_id>blocks_complex_to_real_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>rational_resampler_xxx_0</sink_block_id>
<sink_block_id>satnogs_coarse_doppler_correction_cc_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
@ -3805,31 +3758,31 @@ we shift the LO a little further</value>
</connection>
<connection>
<source_block_id>osmosdr_source_0</source_block_id>
<sink_block_id>satnogs_coarse_doppler_correction_cc_0</sink_block_id>
<sink_block_id>freq_xlating_fir_filter_xxx_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>rational_resampler_xxx_0</source_block_id>
<source_block_id>pfb_arb_resampler_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>pfb_arb_resampler_xxx_0</source_block_id>
<sink_block_id>satnogs_iq_sink_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>rational_resampler_xxx_0</source_block_id>
<source_block_id>pfb_arb_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>rational_resampler_xxx_0_0</source_block_id>
<sink_block_id>blocks_complex_to_real_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>
<sink_block_id>pfb_arb_resampler_xxx_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
@ -3839,12 +3792,6 @@ we shift the LO a little further</value>
<source_key>out</source_key>
<sink_key>in</sink_key>
</connection>
<connection>
<source_block_id>satnogs_doppler_correction_cc_0</source_block_id>
<sink_block_id>freq_xlating_fir_filter_xxx_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>satnogs_morse_decoder_0</source_block_id>
<sink_block_id>satnogs_frame_file_sink_0_0</sink_block_id>
@ -3863,10 +3810,4 @@ we shift the LO a little further</value>
<source_key>freq</source_key>
<sink_key>freq</sink_key>
</connection>
<connection>
<source_block_id>satnogs_tcp_rigctl_msg_source_0</source_block_id>
<sink_block_id>satnogs_doppler_correction_cc_0</sink_block_id>
<source_key>freq</source_key>
<sink_key>freq</sink_key>
</connection>
</flow_graph>

View File

@ -5,10 +5,9 @@
# Title: CW Decoder
# Author: Manolis Surligas (surligas@gmail.com)
# Description: A CW (Morse) Decoder
# Generated: Tue May 15 22:58:51 2018
# Generated: Mon May 21 18:50:09 2018
##################################################
from gnuradio import analog
from gnuradio import blocks
from gnuradio import eng_notation
@ -16,6 +15,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
@ -58,7 +58,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 = 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.lpf_decimation = lpf_decimation = 5
self.audio_samp_rate = audio_samp_rate = 48000
##################################################
@ -71,20 +70,14 @@ class satnogs_cw_decoder(gr.top_block):
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(samp_rate_rx/xlating_decimation/lpf_decimation/4, 0.75, 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_0 = filter.rational_resampler_ccc(
interpolation=audio_samp_rate,
decimation=int((samp_rate_rx/xlating_decimation)/lpf_decimation),
taps=None,
fractional_bw=None,
)
self.rational_resampler_xxx_0 = filter.rational_resampler_ccc(
interpolation=audio_samp_rate,
decimation=int((samp_rate_rx/xlating_decimation)),
taps=None,
fractional_bw=None,
)
self.satnogs_cw_to_symbol_0 = satnogs.cw_to_symbol(audio_samp_rate/4, 0.8, 0.75, wpm)
self.satnogs_coarse_doppler_correction_cc_0 = satnogs.coarse_doppler_correction_cc(rx_freq, samp_rate_rx / xlating_decimation)
self.pfb_arb_resampler_xxx_0 = pfb.arb_resampler_ccf(
(audio_samp_rate) / (samp_rate_rx / xlating_decimation),
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_center_freq(rx_freq - lo_offset, 0)
@ -99,19 +92,22 @@ class satnogs_cw_decoder(gr.top_block):
self.osmosdr_source_0.set_bandwidth(samp_rate_rx, 0)
self.low_pass_filter_0_0 = filter.fir_filter_fff(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(
lpf_decimation, samp_rate_rx/xlating_decimation, 2e3, 1e3, firdes.WIN_HAMMING, 6.76))
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_multiply_xx_0 = blocks.multiply_vcc(1)
self.blocks_moving_average_xx_0 = blocks.moving_average_ff(300, 1, 4000)
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_sig_source_x_0 = analog.sig_source_c(audio_samp_rate, analog.GR_COS_WAVE, bfo_freq, 1, 0)
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))
self.analog_pll_carriertracking_cc_0 = analog.pll_carriertracking_cc(2*math.pi/100, 2*math.pi*2e3/audio_samp_rate, -2*math.pi*2e3/audio_samp_rate)
self.analog_agc_xx_0 = analog.agc_ff(1e-4, 1.0, 1.0)
self.analog_agc_xx_0.set_max_gain(65536)
self.analog_agc2_xx_0_0 = analog.agc2_cc(0.01, 0.001, 0.015, 0.0)
self.analog_agc2_xx_0_0.set_max_gain(65536)
##################################################
# Connections
##################################################
@ -120,22 +116,21 @@ class satnogs_cw_decoder(gr.top_block):
self.msg_connect((self.satnogs_morse_decoder_0, 'out'), (self.satnogs_udp_msg_sink_0_0, 'in'))
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, 0), (self.blocks_multiply_xx_0, 1))
self.connect((self.analog_agc_xx_0, 0), (self.low_pass_filter_0_0, 0))
self.connect((self.analog_pll_carriertracking_cc_0, 0), (self.blocks_complex_to_mag_squared_0, 0))
self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0, 0))
self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.blocks_moving_average_xx_0, 0))
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_moving_average_xx_0, 0), (self.low_pass_filter_0_0, 0))
self.connect((self.blocks_multiply_xx_0, 0), (self.rational_resampler_xxx_0_0, 0))
self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.low_pass_filter_0, 0))
self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.rational_resampler_xxx_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.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.satnogs_coarse_doppler_correction_cc_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.rational_resampler_xxx_0_0, 0), (self.blocks_complex_to_real_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.freq_xlating_fir_filter_xxx_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))
def get_antenna(self):
return self.antenna
@ -279,22 +274,16 @@ class satnogs_cw_decoder(gr.top_block):
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)
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_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))
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
@ -303,22 +292,17 @@ 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_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
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.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)
self.analog_pll_carriertracking_cc_0.set_max_freq(2*math.pi*2e3/self.audio_samp_rate)
self.analog_pll_carriertracking_cc_0.set_min_freq(-2*math.pi*2e3/self.audio_samp_rate)
def argument_parser():