...
 
Commits (3)
  • Manolis Surligas's avatar
    Improve CW decoding · 553898f6
    Manolis Surligas authored
    * Introduce the hysteresis option, in order the CW demodulator to adjust
    properly the plateau length based on the WPM and any filtering that can
    be used before
    
    * Instead for a frame per word, now the CW decoder waits for 10 long
    spaces before it commits a frame. With this way many words are placed on
    the same frame telemetry decoding is easier
    553898f6
  • Manolis Surligas's avatar
    Increase CW sensitivity · 41040910
    Manolis Surligas authored
    * Switch from amplitude based approach to auto-correlation
    * Limit the bandwidth of the PLL using a low pass filter
    * Reject noise of the PLL using a very steep low pass after it
    41040910
  • Manolis Surligas's avatar
    35149fc0
This diff is collapsed.
......@@ -136,7 +136,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(1248, 196)</value>
<value>(1190, 411)</value>
</param>
<param>
<key>_rotation</key>
......@@ -179,7 +179,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(992, 316)</value>
<value>(1030, 195)</value>
</param>
<param>
<key>_rotation</key>
......@@ -406,7 +406,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(1432, 188)</value>
<value>(1390, 403)</value>
</param>
<param>
<key>_rotation</key>
......@@ -457,7 +457,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(1208, 308)</value>
<value>(1206, 187)</value>
</param>
<param>
<key>_rotation</key>
......@@ -641,7 +641,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(1616, 164)</value>
<value>(1590, 379)</value>
</param>
<param>
<key>_rotation</key>
......@@ -677,7 +677,7 @@
</param>
<param>
<key>omega</key>
<value>2</value>
<value>4</value>
</param>
<param>
<key>type</key>
......@@ -998,6 +998,81 @@ we shift the LO a little further</value>
<value>100e3</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>baudrate / 2 + 1500</value>
</param>
<param>
<key>decim</key>
<value>1</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>(1007, 363)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>gain</key>
<value>1</value>
</param>
<param>
<key>id</key>
<value>low_pass_filter_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>4.0 * baudrate</value>
</param>
<param>
<key>width</key>
<value>1000</value>
</param>
<param>
<key>win</key>
<value>firdes.WIN_HAMMING</value>
</param>
</block>
<block>
<key>osmosdr_source</key>
<param>
......@@ -2457,7 +2532,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>atten</key>
<value>100</value>
<value>60</value>
</param>
<param>
<key>taps</key>
......@@ -2488,7 +2563,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>_coordinate</key>
<value>(984, 172)</value>
<value>(727, 275)</value>
</param>
<param>
<key>_rotation</key>
......@@ -2512,7 +2587,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>rrate</key>
<value>(2.0*baudrate)/audio_samp_rate</value>
<value>(4.0*baudrate)/satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx)</value>
</param>
<param>
<key>samp_delay</key>
......@@ -2520,7 +2595,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>atten</key>
<value>100</value>
<value>60</value>
</param>
<param>
<key>taps</key>
......@@ -3088,7 +3163,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>_coordinate</key>
<value>(1384, 300)</value>
<value>(1382, 179)</value>
</param>
<param>
<key>_rotation</key>
......@@ -3501,20 +3576,20 @@ we shift the LO a little further</value>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>osmosdr_source_0</source_block_id>
<sink_block_id>blocks_rotator_cc_0</sink_block_id>
<source_block_id>low_pass_filter_0</source_block_id>
<sink_block_id>analog_quadrature_demod_cf_0_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>analog_quadrature_demod_cf_0_0_0</sink_block_id>
<source_block_id>osmosdr_source_0</source_block_id>
<sink_block_id>blocks_rotator_cc_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>pfb_arb_resampler_xxx_0_0</sink_block_id>
<sink_block_id>analog_quadrature_demod_cf_0_0_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
......@@ -3532,7 +3607,7 @@ we shift the LO a little further</value>
</connection>
<connection>
<source_block_id>pfb_arb_resampler_xxx_0_0</source_block_id>
<sink_block_id>analog_quadrature_demod_cf_0_0</sink_block_id>
<sink_block_id>low_pass_filter_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
......@@ -3566,6 +3641,12 @@ we shift the LO a little further</value>
<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>pfb_arb_resampler_xxx_0_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>satnogs_quad_demod_filter_ff_0</source_block_id>
<sink_block_id>digital_binary_slicer_fb_0</sink_block_id>
......
......@@ -136,7 +136,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(1248, 196)</value>
<value>(1214, 419)</value>
</param>
<param>
<key>_rotation</key>
......@@ -406,7 +406,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(1432, 188)</value>
<value>(1430, 411)</value>
</param>
<param>
<key>_rotation</key>
......@@ -641,7 +641,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(1616, 164)</value>
<value>(1614, 387)</value>
</param>
<param>
<key>_rotation</key>
......@@ -677,7 +677,7 @@
</param>
<param>
<key>omega</key>
<value>2</value>
<value>4</value>
</param>
<param>
<key>type</key>
......@@ -998,6 +998,81 @@ we shift the LO a little further</value>
<value>100e3</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>baudrate / 2 + 1500</value>
</param>
<param>
<key>decim</key>
<value>1</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>(1022, 371)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>gain</key>
<value>1</value>
</param>
<param>
<key>id</key>
<value>low_pass_filter_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>4.0 * baudrate</value>
</param>
<param>
<key>width</key>
<value>1000</value>
</param>
<param>
<key>win</key>
<value>firdes.WIN_HAMMING</value>
</param>
</block>
<block>
<key>osmosdr_source</key>
<param>
......@@ -2488,7 +2563,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>_coordinate</key>
<value>(984, 172)</value>
<value>(735, 395)</value>
</param>
<param>
<key>_rotation</key>
......@@ -2496,7 +2571,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>id</key>
<value>pfb_arb_resampler_xxx_0_0</value>
<value>pfb_arb_resampler_xxx_0_0_0</value>
</param>
<param>
<key>maxoutbuf</key>
......@@ -2512,7 +2587,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>rrate</key>
<value>(2.0*baudrate)/audio_samp_rate</value>
<value>(4.0*baudrate)/satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx)</value>
</param>
<param>
<key>samp_delay</key>
......@@ -2520,7 +2595,7 @@ we shift the LO a little further</value>
</param>
<param>
<key>atten</key>
<value>100</value>
<value>60</value>
</param>
<param>
<key>taps</key>
......@@ -3501,20 +3576,20 @@ we shift the LO a little further</value>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>osmosdr_source_0</source_block_id>
<sink_block_id>blocks_rotator_cc_0</sink_block_id>
<source_block_id>low_pass_filter_0</source_block_id>
<sink_block_id>analog_quadrature_demod_cf_0_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>analog_quadrature_demod_cf_0_0_0</sink_block_id>
<source_block_id>osmosdr_source_0</source_block_id>
<sink_block_id>blocks_rotator_cc_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>pfb_arb_resampler_xxx_0_0</sink_block_id>
<sink_block_id>analog_quadrature_demod_cf_0_0_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
......@@ -3531,8 +3606,8 @@ we shift the LO a little further</value>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>pfb_arb_resampler_xxx_0_0</source_block_id>
<sink_block_id>analog_quadrature_demod_cf_0_0</sink_block_id>
<source_block_id>pfb_arb_resampler_xxx_0_0_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>
......@@ -3566,6 +3641,12 @@ we shift the LO a little further</value>
<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>pfb_arb_resampler_xxx_0_0_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>satnogs_quad_demod_filter_ff_0</source_block_id>
<sink_block_id>digital_binary_slicer_fb_0</sink_block_id>
......
This diff is collapsed.
......@@ -5,7 +5,7 @@
# Title: satnogs_fsk_ax25
# Author: Manolis Surligas (surligas@gmail.com)
# Description: Generic FSK AX.25 decoder
# Generated: Fri Aug 17 00:38:04 2018
# Generated: Sun Jan 6 14:19:34 2019
##################################################
from gnuradio import analog
......@@ -72,7 +72,7 @@ class satnogs_fsk_ax25(gr.top_block):
self.satnogs_ax25_decoder_bm_0_0 = satnogs.ax25_decoder_bm('GND', 0, True, False, 1024)
self.satnogs_ax25_decoder_bm_0 = satnogs.ax25_decoder_bm('GND', 0, True, True, 1024)
self.pfb_arb_resampler_xxx_0_0 = pfb.arb_resampler_ccf(
(2.0*baudrate)/audio_samp_rate,
(4.0*baudrate)/satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx),
taps=None,
flt_size=32)
self.pfb_arb_resampler_xxx_0_0.declare_sample_delay(0)
......@@ -96,7 +96,9 @@ class satnogs_fsk_ax25(gr.top_block):
self.osmosdr_source_0.set_antenna(satnogs.handle_rx_antenna(rx_sdr_device, antenna), 0)
self.osmosdr_source_0.set_bandwidth(satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx), 0)
self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(2, 0.25*0.175*0.175, 0.5, 0.175, 0.005)
self.low_pass_filter_0 = filter.fir_filter_ccf(1, firdes.low_pass(
1, 4.0 * baudrate, baudrate / 2 + 1500, 1000, firdes.WIN_HAMMING, 6.76))
self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(4, 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_0 = filter.dc_blocker_ff(1024, True)
self.dc_blocker_xx_0 = filter.dc_blocker_ff(1024, True)
......@@ -122,13 +124,14 @@ class satnogs_fsk_ax25(gr.top_block):
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.low_pass_filter_0, 0), (self.analog_quadrature_demod_cf_0_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.analog_quadrature_demod_cf_0_0_0, 0))
self.connect((self.pfb_arb_resampler_xxx_0, 0), (self.pfb_arb_resampler_xxx_0_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.pfb_arb_resampler_xxx_0_0, 0), (self.analog_quadrature_demod_cf_0_0, 0))
self.connect((self.pfb_arb_resampler_xxx_0_0, 0), (self.low_pass_filter_0, 0))
self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.pfb_arb_resampler_xxx_0, 0))
self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.pfb_arb_resampler_xxx_0_0, 0))
self.connect((self.satnogs_quad_demod_filter_ff_0, 0), (self.digital_binary_slicer_fb_0, 0))
def get_antenna(self):
......@@ -143,7 +146,8 @@ class satnogs_fsk_ax25(gr.top_block):
def set_baudrate(self, baudrate):
self.baudrate = baudrate
self.pfb_arb_resampler_xxx_0_0.set_rate((2.0*self.baudrate)/self.audio_samp_rate)
self.pfb_arb_resampler_xxx_0_0.set_rate((4.0*self.baudrate)/satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx))
self.low_pass_filter_0.set_taps(firdes.low_pass(1, 4.0 * self.baudrate, self.baudrate / 2 + 1500, 1000, firdes.WIN_HAMMING, 6.76))
def get_bb_gain(self):
return self.bb_gain
......@@ -236,6 +240,7 @@ class satnogs_fsk_ax25(gr.top_block):
def set_rx_sdr_device(self, rx_sdr_device):
self.rx_sdr_device = rx_sdr_device
self.pfb_arb_resampler_xxx_0_0.set_rate((4.0*self.baudrate)/satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.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_gain(satnogs.handle_rx_rf_gain(self.rx_sdr_device, self.rf_gain), 0)
......@@ -250,6 +255,7 @@ class satnogs_fsk_ax25(gr.top_block):
def set_samp_rate_rx(self, samp_rate_rx):
self.samp_rate_rx = samp_rate_rx
self.pfb_arb_resampler_xxx_0_0.set_rate((4.0*self.baudrate)/satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.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)
......@@ -278,7 +284,6 @@ class satnogs_fsk_ax25(gr.top_block):
def set_audio_samp_rate(self, audio_samp_rate):
self.audio_samp_rate = audio_samp_rate
self.pfb_arb_resampler_xxx_0_0.set_rate((2.0*self.baudrate)/self.audio_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))
......
......@@ -5,7 +5,7 @@
# Title: satnogs_msk_ax25
# Author: Manolis Surligas (surligas@gmail.com)
# Description: Generic MSK AX.25 decoder
# Generated: Fri Aug 17 00:38:15 2018
# Generated: Sun Jan 6 14:17:55 2019
##################################################
from gnuradio import analog
......@@ -71,11 +71,11 @@ class satnogs_msk_ax25(gr.top_block):
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, False, 1024)
self.satnogs_ax25_decoder_bm_0 = satnogs.ax25_decoder_bm('GND', 0, True, True, 1024)
self.pfb_arb_resampler_xxx_0_0 = pfb.arb_resampler_ccf(
(2.0*baudrate)/audio_samp_rate,
self.pfb_arb_resampler_xxx_0_0_0 = pfb.arb_resampler_ccf(
(4.0*baudrate)/satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx),
taps=None,
flt_size=32)
self.pfb_arb_resampler_xxx_0_0.declare_sample_delay(0)
self.pfb_arb_resampler_xxx_0_0_0.declare_sample_delay(0)
self.pfb_arb_resampler_xxx_0 = pfb.arb_resampler_ccf(
audio_samp_rate/satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx),
......@@ -96,7 +96,9 @@ class satnogs_msk_ax25(gr.top_block):
self.osmosdr_source_0.set_antenna(satnogs.handle_rx_antenna(rx_sdr_device, antenna), 0)
self.osmosdr_source_0.set_bandwidth(satnogs.handle_samp_rate_rx(rx_sdr_device, samp_rate_rx), 0)
self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(2, 0.25*0.175*0.175, 0.5, 0.175, 0.005)
self.low_pass_filter_0 = filter.fir_filter_ccf(1, firdes.low_pass(
1, 4.0 * baudrate, baudrate / 2 + 1500, 1000, firdes.WIN_HAMMING, 6.76))
self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(4, 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_0 = filter.dc_blocker_ff(1024, True)
self.dc_blocker_xx_0 = filter.dc_blocker_ff(1024, True)
......@@ -122,13 +124,14 @@ class satnogs_msk_ax25(gr.top_block):
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.low_pass_filter_0, 0), (self.analog_quadrature_demod_cf_0_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.analog_quadrature_demod_cf_0_0_0, 0))
self.connect((self.pfb_arb_resampler_xxx_0, 0), (self.pfb_arb_resampler_xxx_0_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.pfb_arb_resampler_xxx_0_0, 0), (self.analog_quadrature_demod_cf_0_0, 0))
self.connect((self.pfb_arb_resampler_xxx_0_0_0, 0), (self.low_pass_filter_0, 0))
self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.pfb_arb_resampler_xxx_0, 0))
self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.pfb_arb_resampler_xxx_0_0_0, 0))
self.connect((self.satnogs_quad_demod_filter_ff_0, 0), (self.digital_binary_slicer_fb_0, 0))
def get_antenna(self):
......@@ -143,7 +146,8 @@ class satnogs_msk_ax25(gr.top_block):
def set_baudrate(self, baudrate):
self.baudrate = baudrate
self.pfb_arb_resampler_xxx_0_0.set_rate((2.0*self.baudrate)/self.audio_samp_rate)
self.pfb_arb_resampler_xxx_0_0_0.set_rate((4.0*self.baudrate)/satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.samp_rate_rx))
self.low_pass_filter_0.set_taps(firdes.low_pass(1, 4.0 * self.baudrate, self.baudrate / 2 + 1500, 1000, firdes.WIN_HAMMING, 6.76))
def get_bb_gain(self):
return self.bb_gain
......@@ -236,6 +240,7 @@ class satnogs_msk_ax25(gr.top_block):
def set_rx_sdr_device(self, rx_sdr_device):
self.rx_sdr_device = rx_sdr_device
self.pfb_arb_resampler_xxx_0_0_0.set_rate((4.0*self.baudrate)/satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.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_gain(satnogs.handle_rx_rf_gain(self.rx_sdr_device, self.rf_gain), 0)
......@@ -250,6 +255,7 @@ class satnogs_msk_ax25(gr.top_block):
def set_samp_rate_rx(self, samp_rate_rx):
self.samp_rate_rx = samp_rate_rx
self.pfb_arb_resampler_xxx_0_0_0.set_rate((4.0*self.baudrate)/satnogs.handle_samp_rate_rx(self.rx_sdr_device, self.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)
......@@ -278,7 +284,6 @@ class satnogs_msk_ax25(gr.top_block):
def set_audio_samp_rate(self, audio_samp_rate):
self.audio_samp_rate = audio_samp_rate
self.pfb_arb_resampler_xxx_0_0.set_rate((2.0*self.baudrate)/self.audio_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))
......
<?xml version="1.0"?>
<block>
<name>CW to Symbols</name>
<key>satnogs_cw_to_symbol</key>
<import>import satnogs</import>
<make>satnogs.cw_to_symbol($sampling_rate, $threshold, $conf_level, $wpm)</make>
<callback>set_act_threshold($threshold)</callback>
<param>
<name>Sampling Rate</name>
<key>sampling_rate</key>
<value>samp_rate</value>
<type>real</type>
</param>
<name>CW to Symbols</name>
<key>satnogs_cw_to_symbol</key>
<import>import satnogs</import>
<make>satnogs.cw_to_symbol($sampling_rate, $threshold, $conf_level, $wpm, $hysteresis)</make>
<callback>set_act_threshold($threshold)</callback>
<param>
<name>Activation Threshold</name>
<key>threshold</key>
<type>real</type>
</param>
<param>
<name>Confidence Level</name>
<key>conf_level</key>
<value>0.9</value>
<type>real</type>
</param>
<param>
<name>Sampling Rate</name>
<key>sampling_rate</key>
<value>samp_rate</value>
<type>real</type>
</param>
<param>
<name>Words per Minute</name>
<key>wpm</key>
<value>20</value>
<type>int</type>
</param>
<param>
<name>Activation Threshold</name>
<key>threshold</key>
<type>real</type>
</param>
<sink>
<name>act_threshold</name>
<type>message</type>
<optional>1</optional>
</sink>
<sink>
<name>in</name>
<type>float</type>
</sink>
<param>
<name>Confidence Level</name>
<key>conf_level</key>
<value>0.9</value>
<type>real</type>
</param>
<source>
<name>out</name>
<type>message</type>
</source>
<param>
<name>Words per Minute</name>
<key>wpm</key>
<value>20</value>
<type>int</type>
</param>
<param>
<name>Hysteresis</name>
<key>hysteresis</key>
<value>0</value>
<type>int</type>
</param>
<sink>
<name>act_threshold</name>
<type>message</type>
<optional>1</optional>
</sink>
<sink>
<name>in</name>
<type>float</type>
</sink>
<source>
<name>out</name>
<type>message</type>
</source>
</block>
......@@ -24,6 +24,9 @@
#include <satnogs/api.h>
#include <gnuradio/sync_block.h>
#define MIN_WPM 5
#define MAX_WPM 50
namespace gr
{
namespace satnogs
......@@ -65,10 +68,19 @@ namespace gr
* symbols
*
* @param wpm Morse code Words per Minute
*
* @param hysteresis this value represents the hysteresis of a possible
* filter used before the CW to Symbol block. For example if there is
* a moving average filter with x taps, the full power of the signal
* will be available after x samples. The total length of samples with
* maximum power will be 2*x less. Because the block searches for plateaus
* with proper durations, this filtering hysteresis should be known.
* If no such a filter is used, the hysteresis value should be set to zero.
*/
static cw_to_symbol::sptr
make (double sampling_rate, float threshold, float conf_level = 0.9,
size_t wpm = 20);
size_t wpm = 20,
size_t hysteresis = 0);
virtual void
set_act_threshold (float thrld) = 0;
......
......@@ -2,7 +2,7 @@
/*
* gr-satnogs: SatNOGS GNU Radio Out-Of-Tree Module
*
* Copyright (C) 2016,2017
* Copyright (C) 2016-2018
* Libre Space Foundation <http://librespacefoundation.org/>
*
* This program is free software: you can redistribute it and/or modify
......@@ -22,8 +22,6 @@
#ifndef INCLUDE_SATNOGS_MORSE_H_
#define INCLUDE_SATNOGS_MORSE_H_
#define MIN_WPM 5
#define MAX_WPM 30
/**
* The different Morse symbols
*/
......@@ -32,7 +30,8 @@ typedef enum {
MORSE_DASH, //!< Morse dash (-) symbol
MORSE_INTRA_SPACE, //!< Space between dot and dash symbols
MORSE_S_SPACE, //!< Morse short space between characters
MORSE_L_SPACE //!<Morse long space between words
MORSE_L_SPACE, //!<Morse long space between words
MORSE_END_MSG_SPACE //!< End of message
} morse_symbol_t;
......
This diff is collapsed.
......@@ -45,6 +45,7 @@ namespace gr
size_t d_dot_samples;
size_t d_window_size;
size_t d_window_cnt;
size_t d_idle_cnt;
size_t d_dot_windows_num;
size_t d_dash_windows_num;
size_t d_short_pause_windows_num;
......@@ -84,7 +85,7 @@ namespace gr
public:
cw_to_symbol_impl (double sampling_rate, float threshold,
float conf_level, size_t wpm);
float conf_level, size_t wpm, size_t hysteresis);
~cw_to_symbol_impl ();
// Where all the action really happens
......
......@@ -28,94 +28,99 @@
#include <satnogs/log.h>
namespace gr
{
namespace satnogs
{
morse_decoder::sptr
morse_decoder::make (char unrecognized_char, size_t min_frame_len)
{
return gnuradio::get_initial_sptr (
new morse_decoder_impl (unrecognized_char, min_frame_len));
}
namespace satnogs
{
void
morse_decoder_impl::symbol_msg_handler (pmt::pmt_t msg)
{
bool res = false;
std::string str;
morse_symbol_t s;
s = (morse_symbol_t) pmt::to_long (msg);
morse_decoder::sptr
morse_decoder::make (char unrecognized_char, size_t min_frame_len)
{
return gnuradio::get_initial_sptr (
new morse_decoder_impl (unrecognized_char, min_frame_len));
}
switch (s)
{
case MORSE_DOT:
case MORSE_DASH:
case MORSE_S_SPACE:
res = d_morse_tree.received_symbol (s);
break;
/*
* If a word separator occurs it is a good time to retrieve the decoded
* word
*/
case MORSE_L_SPACE:
/*
* Inject a character separator, for the morse decoder to commit
* the outstanding character
*/
res = d_morse_tree.received_symbol (MORSE_S_SPACE);
/* Just ignore the word separator if no word is yet decoded */
if (d_morse_tree.get_word_len () == 0) {
res = true;
break;
}
str = d_morse_tree.get_word ();
if (str.length () > d_min_frame_len) {
d_morse_tree.reset ();
message_port_pub (pmt::mp ("out"),
pmt::make_blob (str.c_str (), str.length ()));
}
break;
case MORSE_INTRA_SPACE:
/*Ignore it */
break;
default:
LOG_ERROR("Unknown Morse symbol");
return;
}
void
morse_decoder_impl::symbol_msg_handler (pmt::pmt_t msg)
{
bool res = false;
morse_symbol_t s;
s = (morse_symbol_t) pmt::to_long (msg);
switch (s)
{
case MORSE_DOT:
case MORSE_DASH:
case MORSE_S_SPACE:
res = d_morse_tree.received_symbol (s);
break;
/*
* If a word separator occurs it is a good time to retrieve the decoded
* word
*/
case MORSE_L_SPACE:
/*
* If the decoding return false, it means that either an non decode-able
* character situation occurred or the maximum word limit reached
* Inject a character separator, for the morse decoder to commit
* the outstanding character
*/
if (!res) {
if (d_morse_tree.get_max_word_len () == d_morse_tree.get_word_len ()) {
str = d_morse_tree.get_word ();
d_morse_tree.reset ();
message_port_pub (pmt::mp ("out"),
pmt::make_blob (str.c_str (), str.length ()));
}
res = d_morse_tree.received_symbol (MORSE_S_SPACE);
/* Just ignore the word separator if no word is yet decoded */
if (d_morse_tree.get_word_len () == 0) {
res = true;
break;
}
d_str = d_str.append(d_morse_tree.get_word ());
d_str = d_str.append(" ");
d_morse_tree.reset ();
break;
case MORSE_INTRA_SPACE:
/*Ignore it */
break;
case MORSE_END_MSG_SPACE:
if (d_str.length () > d_min_frame_len) {
d_morse_tree.reset ();
message_port_pub (pmt::mp ("out"),
pmt::make_blob (d_str.c_str (), d_str.length ()));
d_str = "";
}
break;
default:
LOG_ERROR("Unknown Morse symbol");
return;
}
/*
* The private constructor
*/
morse_decoder_impl::morse_decoder_impl (char unrecognized_char,
size_t min_frame_len) :
gr::block ("morse_decoder", gr::io_signature::make (0, 0, 0),
gr::io_signature::make (0, 0, 0)),
d_morse_tree (unrecognized_char),
d_min_frame_len (min_frame_len)
{
/* Register the input and output msg handler */
message_port_register_in (pmt::mp ("in"));
message_port_register_out (pmt::mp ("out"));
set_msg_handler (
pmt::mp ("in"),
boost::bind (&morse_decoder_impl::symbol_msg_handler, this, _1));
/*
* If the decoding return false, it means that either an non decode-able
* character situation occurred or the maximum word limit reached
*/
if (!res) {
if (d_morse_tree.get_max_word_len () == d_morse_tree.get_word_len ()) {
d_str = d_morse_tree.get_word ();
d_morse_tree.reset ();
message_port_pub (pmt::mp ("out"),
pmt::make_blob (d_str.c_str (), d_str.length ()));
}
}
}
/*
* The private constructor
*/
morse_decoder_impl::morse_decoder_impl (char unrecognized_char,
size_t min_frame_len) :
gr::block ("morse_decoder", gr::io_signature::make (0, 0, 0),
gr::io_signature::make (0, 0, 0)),
d_morse_tree (unrecognized_char),
d_min_frame_len (min_frame_len),
d_str("")
{
/* Register the input and output msg handler */
message_port_register_in (pmt::mp ("in"));
message_port_register_out (pmt::mp ("out"));
set_msg_handler (
pmt::mp ("in"),
boost::bind (&morse_decoder_impl::symbol_msg_handler, this, _1));
}
} /* namespace satnogs */
} /* namespace satnogs */
} /* namespace gr */
......@@ -24,24 +24,27 @@
#include <satnogs/morse_decoder.h>
#include <satnogs/morse_tree.h>
namespace gr {
namespace satnogs {
namespace gr
{
namespace satnogs
{
class morse_decoder_impl : public morse_decoder
{
private:
morse_tree d_morse_tree;
size_t d_min_frame_len;
class morse_decoder_impl : public morse_decoder
{
void
symbol_msg_handler(pmt::pmt_t msg);
public:
morse_decoder_impl (char unrecognized_char, size_t min_frame_len);
public:
morse_decoder_impl(char unrecognized_char, size_t min_frame_len);
private:
morse_tree d_morse_tree;
size_t d_min_frame_len;
std::string d_str;
};
void
symbol_msg_handler (pmt::pmt_t msg);
};
} // namespace satnogs
} // namespace satnogs
} // namespace gr
#endif /* INCLUDED_SATNOGS_MORSE_DECODER_IMPL_H */
......