...
 
Commits (16)
......@@ -48,7 +48,7 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
# Set the version information here
set(VERSION_INFO_MAJOR_VERSION 1)
set(VERSION_INFO_API_COMPAT 5)
set(VERSION_INFO_MINOR_VERSION 0)
set(VERSION_INFO_MINOR_VERSION 1)
set(VERSION_INFO_MAINT_VERSION git)
......
......@@ -14,6 +14,7 @@ for decoding signals from various scientific and academic sattelites.
* libpng
* libpng++
* git
* swig
**Optional**
* gr-osmocom (for using the flowgraphs with real SDR hardware)
......@@ -23,14 +24,15 @@ for decoding signals from various scientific and academic sattelites.
```
apt install -y build-essential cmake gnuradio g++ \
python-mako python-six libogg-dev \
libvorbis-dev libpng-dev libpng++-dev
libvorbis-dev libpng-dev libpng++-dev \
swig
cd /tmp
git clone https://github.com/gnuradio/volk.git
cd volk
mkdir build
cd build
cmake ..
make -j 8
make -j $(nproc --all)
sudo make install
```
......@@ -41,7 +43,7 @@ sudo make install
3. `mkdir build`
4. `cd build`
5. `cmake ..`
6. `make`
6. `make -j $(nproc --all)`
7. `sudo make install`
If this is the first time you are building the gr-satnogs module run
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -5,9 +5,10 @@
# Title: satnogs_reaktor_hello_world_fsk9600_decoder
# Author: Manolis Surligas (surligas@gmail.com)
# Description: FSK 9600 Decoder for the Reaktor-Hello-World satellite
# Generated: Mon Dec 3 11:51:46 2018
# GNU Radio version: 3.7.13.5
##################################################
from gnuradio import analog
from gnuradio import blocks
from gnuradio import digital
......@@ -70,11 +71,11 @@ class satnogs_reaktor_hello_world_fsk9600_decoder(gr.top_block):
self.satnogs_frame_file_sink_0_1_0 = satnogs.frame_file_sink(decoded_data_file_path, 0)
self.satnogs_frame_acquisition_0 = satnogs.frame_acquisition(1, [0xAA, 0xAA, 0xAA, 0xAA], 4, [0x35, 0x2E, 0x35, 0x2E], 3, 1, 256, 3, variable_whitening_0, 2048)
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_0 = pfb.arb_resampler_ccf(
self.pfb_arb_resampler_xxx_0_0_0 = pfb.arb_resampler_ccf(
(2.0*baudrate)/audio_samp_rate,
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),
......@@ -95,13 +96,22 @@ class satnogs_reaktor_hello_world_fsk9600_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(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_1 = filter.fir_filter_fff(1, firdes.low_pass(
1, 2 * baudrate, baudrate * 0.60, baudrate / 8.0, firdes.WIN_HAMMING, 6.76))
self.low_pass_filter_0 = filter.fir_filter_ccf(1, firdes.low_pass(
1, audio_samp_rate, 0.75 * baudrate, 1000, firdes.WIN_HAMMING, 6.76))
self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(2, 2 * math.pi / 100, 0.5, 0.5/8.0, 0.01)
self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb()
self.dc_blocker_xx_0_0_0 = filter.dc_blocker_ff(1024, True)
self.dc_blocker_xx_0_0 = filter.dc_blocker_ff(1024, True)
self.dc_blocker_xx_0 = filter.dc_blocker_ff(1024, True)
self.blocks_vco_c_0 = blocks.vco_c(audio_samp_rate, -audio_samp_rate, 1.0)
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_0 = blocks.multiply_vcc(1)
self.blocks_moving_average_xx_0 = blocks.moving_average_ff(1024, 1.0/1024.0, 4096)
self.blocks_delay_0 = blocks.delay(gr.sizeof_gr_complex*1, 1024/2)
self.analog_quadrature_demod_cf_0_0_0_1 = analog.quadrature_demod_cf(1.2)
self.analog_quadrature_demod_cf_0_0_0_0 = analog.quadrature_demod_cf(1.0)
self.analog_quadrature_demod_cf_0_0_0 = analog.quadrature_demod_cf(0.9)
self.analog_quadrature_demod_cf_0_0 = analog.quadrature_demod_cf(1.2)
......@@ -111,19 +121,27 @@ class satnogs_reaktor_hello_world_fsk9600_decoder(gr.top_block):
self.msg_connect((self.satnogs_frame_acquisition_0, 'out'), (self.satnogs_frame_file_sink_0_1_0, 'frame'))
self.msg_connect((self.satnogs_frame_acquisition_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_quadrature_demod_cf_0_0, 0), (self.dc_blocker_xx_0, 0))
self.connect((self.analog_quadrature_demod_cf_0_0_0, 0), (self.dc_blocker_xx_0_0, 0))
self.connect((self.analog_quadrature_demod_cf_0_0_0_0, 0), (self.blocks_moving_average_xx_0, 0))
self.connect((self.analog_quadrature_demod_cf_0_0_0_1, 0), (self.low_pass_filter_1, 0))
self.connect((self.blocks_delay_0, 0), (self.blocks_multiply_xx_0_0, 0))
self.connect((self.blocks_moving_average_xx_0, 0), (self.blocks_vco_c_0, 0))
self.connect((self.blocks_multiply_xx_0_0, 0), (self.low_pass_filter_0, 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.digital_clock_recovery_mm_xx_0, 0))
self.connect((self.blocks_vco_c_0, 0), (self.blocks_multiply_xx_0_0, 1))
self.connect((self.dc_blocker_xx_0_0, 0), (self.satnogs_ogg_encoder_0, 0))
self.connect((self.dc_blocker_xx_0_0_0, 0), (self.digital_clock_recovery_mm_xx_0, 0))
self.connect((self.digital_binary_slicer_fb_0, 0), (self.satnogs_frame_acquisition_0, 0))
self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0))
self.connect((self.low_pass_filter_0, 0), (self.pfb_arb_resampler_xxx_0_0_0, 0))
self.connect((self.low_pass_filter_1, 0), (self.dc_blocker_xx_0_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.analog_quadrature_demod_cf_0_0_0_0, 0))
self.connect((self.pfb_arb_resampler_xxx_0, 0), (self.blocks_delay_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.analog_quadrature_demod_cf_0_0_0_1, 0))
self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.pfb_arb_resampler_xxx_0, 0))
def get_antenna(self):
......@@ -138,7 +156,9 @@ class satnogs_reaktor_hello_world_fsk9600_decoder(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((2.0*self.baudrate)/self.audio_samp_rate)
self.low_pass_filter_1.set_taps(firdes.low_pass(1, 2 * self.baudrate, self.baudrate * 0.60, self.baudrate / 8.0, firdes.WIN_HAMMING, 6.76))
self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.audio_samp_rate, 0.75 * self.baudrate, 1000, firdes.WIN_HAMMING, 6.76))
def get_bb_gain(self):
return self.bb_gain
......@@ -279,8 +299,9 @@ class satnogs_reaktor_hello_world_fsk9600_decoder(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_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))
self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.audio_samp_rate, 0.75 * self.baudrate, 1000, firdes.WIN_HAMMING, 6.76))
def argument_parser():
......
This diff is collapsed.
This diff is collapsed.
......@@ -5,9 +5,10 @@
# Title: satnogs_fsk_ax25
# Author: Manolis Surligas (surligas@gmail.com)
# Description: Generic FSK AX.25 decoder
# Generated: Fri Aug 17 00:38:04 2018
# GNU Radio version: 3.7.13.5
##################################################
from gnuradio import analog
from gnuradio import blocks
from gnuradio import digital
......@@ -64,18 +65,17 @@ class satnogs_fsk_ax25(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, 1000, 1500)
self.satnogs_quad_demod_filter_ff_0 = satnogs.quad_demod_filter_ff(1.2)
self.satnogs_ogg_encoder_0 = satnogs.ogg_encoder(file_path, audio_samp_rate, 1.0)
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, 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(
self.pfb_arb_resampler_xxx_0_0_0 = pfb.arb_resampler_ccf(
(2.0*baudrate)/audio_samp_rate,
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,11 +96,20 @@ 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_1 = filter.fir_filter_fff(1, firdes.low_pass(
1, 2 * baudrate, baudrate * 0.60, baudrate / 8.0, firdes.WIN_HAMMING, 6.76))
self.low_pass_filter_0 = filter.fir_filter_ccf(1, firdes.low_pass(
1, audio_samp_rate, 0.75 * baudrate, 1000, firdes.WIN_HAMMING, 6.76))
self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(2, 2 * math.pi / 100, 0.5, 0.5/8.0, 0.01)
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)
self.blocks_vco_c_0 = blocks.vco_c(audio_samp_rate, -audio_samp_rate, 1.0)
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_moving_average_xx_0 = blocks.moving_average_ff(1024, 1.0/1024.0, 4096)
self.blocks_delay_0 = blocks.delay(gr.sizeof_gr_complex*1, 1024/2)
self.analog_quadrature_demod_cf_0_0_0_0 = analog.quadrature_demod_cf(1.0)
self.analog_quadrature_demod_cf_0_0_0 = analog.quadrature_demod_cf(0.9)
self.analog_quadrature_demod_cf_0_0 = analog.quadrature_demod_cf(1.2)
......@@ -114,22 +123,29 @@ class satnogs_fsk_ax25(gr.top_block):
self.msg_connect((self.satnogs_ax25_decoder_bm_0_0, 'pdu'), (self.satnogs_frame_file_sink_0_1_0, 'frame'))
self.msg_connect((self.satnogs_ax25_decoder_bm_0_0, 'pdu'), (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_quadrature_demod_cf_0_0, 0), (self.dc_blocker_xx_0, 0))
self.connect((self.analog_quadrature_demod_cf_0_0, 0), (self.low_pass_filter_1, 0))
self.connect((self.analog_quadrature_demod_cf_0_0_0, 0), (self.dc_blocker_xx_0_0, 0))
self.connect((self.analog_quadrature_demod_cf_0_0_0_0, 0), (self.blocks_moving_average_xx_0, 0))
self.connect((self.blocks_delay_0, 0), (self.blocks_multiply_xx_0, 0))
self.connect((self.blocks_moving_average_xx_0, 0), (self.blocks_vco_c_0, 0))
self.connect((self.blocks_multiply_xx_0, 0), (self.low_pass_filter_0, 0))
self.connect((self.blocks_rotator_cc_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0))
self.connect((self.blocks_vco_c_0, 0), (self.blocks_multiply_xx_0, 1))
self.connect((self.dc_blocker_xx_0, 0), (self.digital_clock_recovery_mm_xx_0, 0))
self.connect((self.dc_blocker_xx_0_0, 0), (self.satnogs_ogg_encoder_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.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0))
self.connect((self.low_pass_filter_0, 0), (self.pfb_arb_resampler_xxx_0_0_0, 0))
self.connect((self.low_pass_filter_1, 0), (self.dc_blocker_xx_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.analog_quadrature_demod_cf_0_0_0_0, 0))
self.connect((self.pfb_arb_resampler_xxx_0, 0), (self.blocks_delay_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.analog_quadrature_demod_cf_0_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):
return self.antenna
......@@ -143,7 +159,9 @@ 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_0.set_rate((2.0*self.baudrate)/self.audio_samp_rate)
self.low_pass_filter_1.set_taps(firdes.low_pass(1, 2 * self.baudrate, self.baudrate * 0.60, self.baudrate / 8.0, firdes.WIN_HAMMING, 6.76))
self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.audio_samp_rate, 0.75 * self.baudrate, 1000, firdes.WIN_HAMMING, 6.76))
def get_bb_gain(self):
return self.bb_gain
......@@ -278,8 +296,9 @@ 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_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))
self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.audio_samp_rate, 0.75 * self.baudrate, 1000, firdes.WIN_HAMMING, 6.76))
def argument_parser():
......
......@@ -5,9 +5,10 @@
# Title: satnogs_msk_ax25
# Author: Manolis Surligas (surligas@gmail.com)
# Description: Generic MSK AX.25 decoder
# Generated: Fri Aug 17 00:38:15 2018
# GNU Radio version: 3.7.13.5
##################################################
from gnuradio import analog
from gnuradio import blocks
from gnuradio import digital
......@@ -64,18 +65,17 @@ class satnogs_msk_ax25(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, 1000, 1500)
self.satnogs_quad_demod_filter_ff_0 = satnogs.quad_demod_filter_ff(1.2)
self.satnogs_ogg_encoder_0 = satnogs.ogg_encoder(file_path, audio_samp_rate, 1.0)
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, 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(
self.pfb_arb_resampler_xxx_0_0_0 = pfb.arb_resampler_ccf(
(2.0*baudrate)/audio_samp_rate,
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,11 +96,20 @@ 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_1 = filter.fir_filter_fff(1, firdes.low_pass(
1, 2 * baudrate, baudrate * 0.60, baudrate / 8.0, firdes.WIN_HAMMING, 6.76))
self.low_pass_filter_0 = filter.fir_filter_ccf(1, firdes.low_pass(
1, audio_samp_rate, 0.75 * baudrate, 1000, firdes.WIN_HAMMING, 6.76))
self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(2, 2 * math.pi / 100, 0.5, 0.5/8.0, 0.01)
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)
self.blocks_vco_c_0 = blocks.vco_c(audio_samp_rate, -audio_samp_rate, 1.0)
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_moving_average_xx_0 = blocks.moving_average_ff(1024, 1.0/1024.0, 4096)
self.blocks_delay_0 = blocks.delay(gr.sizeof_gr_complex*1, 1024/2)
self.analog_quadrature_demod_cf_0_0_0_0 = analog.quadrature_demod_cf(1.0)
self.analog_quadrature_demod_cf_0_0_0 = analog.quadrature_demod_cf(0.9)
self.analog_quadrature_demod_cf_0_0 = analog.quadrature_demod_cf(1.2)
......@@ -114,22 +123,29 @@ class satnogs_msk_ax25(gr.top_block):
self.msg_connect((self.satnogs_ax25_decoder_bm_0_0, 'pdu'), (self.satnogs_frame_file_sink_0_1_0, 'frame'))
self.msg_connect((self.satnogs_ax25_decoder_bm_0_0, 'pdu'), (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_quadrature_demod_cf_0_0, 0), (self.dc_blocker_xx_0, 0))
self.connect((self.analog_quadrature_demod_cf_0_0, 0), (self.low_pass_filter_1, 0))
self.connect((self.analog_quadrature_demod_cf_0_0_0, 0), (self.dc_blocker_xx_0_0, 0))
self.connect((self.analog_quadrature_demod_cf_0_0_0_0, 0), (self.blocks_moving_average_xx_0, 0))
self.connect((self.blocks_delay_0, 0), (self.blocks_multiply_xx_0, 0))
self.connect((self.blocks_moving_average_xx_0, 0), (self.blocks_vco_c_0, 0))
self.connect((self.blocks_multiply_xx_0, 0), (self.low_pass_filter_0, 0))
self.connect((self.blocks_rotator_cc_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0))
self.connect((self.blocks_vco_c_0, 0), (self.blocks_multiply_xx_0, 1))
self.connect((self.dc_blocker_xx_0, 0), (self.digital_clock_recovery_mm_xx_0, 0))
self.connect((self.dc_blocker_xx_0_0, 0), (self.satnogs_ogg_encoder_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.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0))
self.connect((self.low_pass_filter_0, 0), (self.pfb_arb_resampler_xxx_0_0_0, 0))
self.connect((self.low_pass_filter_1, 0), (self.dc_blocker_xx_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.analog_quadrature_demod_cf_0_0_0_0, 0))
self.connect((self.pfb_arb_resampler_xxx_0, 0), (self.blocks_delay_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.analog_quadrature_demod_cf_0_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):
return self.antenna
......@@ -143,7 +159,9 @@ 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((2.0*self.baudrate)/self.audio_samp_rate)
self.low_pass_filter_1.set_taps(firdes.low_pass(1, 2 * self.baudrate, self.baudrate * 0.60, self.baudrate / 8.0, firdes.WIN_HAMMING, 6.76))
self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.audio_samp_rate, 0.75 * self.baudrate, 1000, firdes.WIN_HAMMING, 6.76))
def get_bb_gain(self):
return self.bb_gain
......@@ -278,8 +296,9 @@ 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_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))
self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.audio_samp_rate, 0.75 * self.baudrate, 1000, firdes.WIN_HAMMING, 6.76))
def argument_parser():
......
......@@ -3,7 +3,7 @@
<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>
<make>satnogs.cw_to_symbol($sampling_rate, $threshold, $conf_level, $wpm, $hysteresis)</make>
<callback>set_act_threshold($threshold)</callback>
<param>
......@@ -33,6 +33,13 @@
<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>
......
......@@ -197,7 +197,10 @@ namespace gr
out[i++] = fcs & 0xFF;
out[i++] = (fcs >> 8) & 0xFF;
memset (out + i, AX25_SYNC_FLAG, postamble_len);
for(size_t j = preamble_len; j < i; j++) {
printf("0x%02x ", out[j]);
}
printf("\n");
return i + postamble_len;
}
......
......@@ -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.
......@@ -24,6 +24,7 @@
#include <satnogs/ax25_decoder_bm.h>
#include <gnuradio/digital/lfsr.h>
#include <deque>
namespace gr
{
......@@ -35,7 +36,7 @@ namespace gr
private:
typedef enum
{
NO_SYNC, IN_SYNC, DECODING, FRAME_END
NO_SYNC, IN_SYNC, DECODING
} decoding_state_t;
/**
......@@ -53,6 +54,8 @@ namespace gr
size_t d_decoded_bits;
digital::lfsr d_lfsr;
uint8_t *d_frame_buffer;
std::deque<uint8_t> d_bitstream;
size_t d_start_idx;
void
reset_state ();
......@@ -60,20 +63,16 @@ namespace gr
enter_sync_state ();
void
enter_decoding_state ();
void
bool
enter_frame_end ();
size_t
descramble_and_decode (const uint8_t *in, size_t nitems);
size_t
decode (const uint8_t *in, size_t nitems);
void
decode ();
inline void
descramble_and_decode_1b (uint8_t in);
inline void
decode_1b (uint8_t in);
inline bool
check_byte ();
bool
frame_check();
public:
......
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,21 +28,20 @@
#include <satnogs/log.h>
namespace gr
{
namespace satnogs
{
namespace satnogs
{
morse_decoder::sptr
morse_decoder::make (char unrecognized_char, size_t min_frame_len)
{
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));
}
}
void
morse_decoder_impl::symbol_msg_handler (pmt::pmt_t msg)
{
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);
......@@ -68,16 +67,21 @@ namespace gr
res = true;
break;
}
str = d_morse_tree.get_word ();
if (str.length () > d_min_frame_len) {
d_str = d_str.append(d_morse_tree.get_word ());
d_str = d_str.append(" ");
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;
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;
......@@ -89,33 +93,34 @@ namespace gr
*/
if (!res) {
if (d_morse_tree.get_max_word_len () == d_morse_tree.get_word_len ()) {
str = d_morse_tree.get_word ();
d_str = d_morse_tree.get_word ();
d_morse_tree.reset ();
message_port_pub (pmt::mp ("out"),
pmt::make_blob (str.c_str (), str.length ()));
}
pmt::make_blob (d_str.c_str (), d_str.length ()));
}
}
}
/*
/*
* The private constructor
*/
morse_decoder_impl::morse_decoder_impl (char unrecognized_char,
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_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:
class morse_decoder_impl : public morse_decoder
{
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);
public:
morse_decoder_impl(char unrecognized_char, size_t min_frame_len);
};
symbol_msg_handler (pmt::pmt_t msg);
};
} // namespace satnogs
} // namespace satnogs
} // namespace gr
#endif /* INCLUDED_SATNOGS_MORSE_DECODER_IMPL_H */
......
......@@ -37,13 +37,16 @@ hw_tx_settings = {'usrpb200' : {'rf_gain' : 60.0, 'if_gain' : 0.0,
hw_rx_settings = {'usrpb200' : {'rf_gain' : 50.0, 'if_gain' : 0.0,
'bb_gain' : 0.0, 'samp_rate' : 5e5,
'antenna' : 'TX/RX', 'dev_arg': 'uhd'},
'usrp1' : {'rf_gain' : 500.0, 'if_gain' : 30.0,
'bb_gain' : 0.0, 'samp_rate' : 5e5,
'antenna' : 'RX', 'dev_arg': 'uhd'},
'usrp2' : {'rf_gain' : 50.0, 'if_gain' : 0.0,
'bb_gain' : 0.0, 'samp_rate' : 5e5,
'antenna' : 'TX/RX', 'dev_arg': 'uhd'},
'usrpx3x0' : {'rf_gain' : 26.0, 'if_gain' : 0.0,
'bb_gain' : 0.0, 'samp_rate' : 2e6,
'antenna' : 'TX/RX', 'dev_arg': 'uhd'},
'airspy' : {'rf_gain' : 30.0, 'if_gain' : 0.0,
'airspy' : {'rf_gain' : 19.0, 'if_gain' : 0.0,
'bb_gain' : 0.0, 'samp_rate' : 10e6,
'antenna' : '', 'dev_arg': 'airspy'},
'airspymini' : {'rf_gain' : 15.0, 'if_gain' : 0.0,
......