aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2021-03-25 13:07:23 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2021-03-25 13:09:30 +0100
commit7f46a3879c9c76aa817cc27fb39718b8dd813f96 (patch)
tree0a81cc1f8763195a7bf7b351d4ba082675e3bc1e
parente1cb67c6ce1b260582a87e0cf61ebfd29067febd (diff)
downloadglutte-o-matic-master.tar.gz
glutte-o-matic-master.tar.bz2
glutte-o-matic-master.zip
Port analyse_capture.py to GNURadio 3.8HEADmaster
-rw-r--r--decoder/README.md7
-rwxr-xr-xdecoder/analyse_capture.py40
2 files changed, 27 insertions, 20 deletions
diff --git a/decoder/README.md b/decoder/README.md
index 870f69f..7ebc2b8 100644
--- a/decoder/README.md
+++ b/decoder/README.md
@@ -3,11 +3,14 @@ Introduction
This folder contains a set of scripts that can be used to automatically decode the PSK125 beacon at 22:00
+The `analyse_capture.grc` was designed with GNURadio 3.7, but later the python file was
+manually ported to GNURadio 3.8, because the [MPSK receiver block was deprecated](https://github.com/gnuradio/gnuradio/issues/1083)
+
Dependencies
------------
* Python 3
-* GNURadio 3.7
+* GNURadio 3.8
* An SDR device and a suitable I/Q capture tool
Principle of operation
@@ -25,5 +28,3 @@ References
https://sdradventure.wordpress.com/2011/10/15/gnuradio-psk31-decoder-part-1/
https://sdradventure.wordpress.com/2011/10/15/gnuradio-psk31-decoder-part-2/
-
-For GnuRadio 3.8, maybe consider https://github.com/dl1ksv/gr-radioteletype
diff --git a/decoder/analyse_capture.py b/decoder/analyse_capture.py
index 69fd714..52c6dad 100755
--- a/decoder/analyse_capture.py
+++ b/decoder/analyse_capture.py
@@ -1,12 +1,5 @@
-#!/usr/bin/env python2
-# -*- coding: utf-8 -*-
-##################################################
-# GNU Radio Python Flow Graph
-# Title: Analyse RTLSDR capture
+#!/usr/bin/env python3
# Author: HB9EGM
-# GNU Radio version: 3.7.13.5
-##################################################
-
from gnuradio import analog
from gnuradio import blocks
@@ -20,15 +13,9 @@ from gnuradio.filter import firdes
from optparse import OptionParser
import pmt
-
class analyse_capture(gr.top_block):
-
def __init__(self):
gr.top_block.__init__(self, "Analyse RTLSDR capture")
-
- ##################################################
- # Variables
- ##################################################
self.samp_rate = samp_rate = 2048000
self.taps = taps = firdes.low_pass(1.0/256, samp_rate, 3e3, 10e2, firdes.WIN_HAMMING, 6.76)
@@ -44,7 +31,25 @@ class analyse_capture(gr.top_block):
self.freq_xlating_fft_filter_ccc_0 = filter.freq_xlating_fft_filter_ccc(decim, (taps), 145725e3-145700e3, samp_rate)
self.freq_xlating_fft_filter_ccc_0.set_nthreads(1)
self.freq_xlating_fft_filter_ccc_0.declare_sample_delay(0)
- self.digital_mpsk_receiver_cc_0 = digital.mpsk_receiver_cc(2, 0, cmath.pi/100.0, -0.25, 0.25, 0.25, 0.04, 64, 64*64/4, 0.005)
+
+ order = 2
+ theta = 0
+ loop_bw = cmath.pi/100.0
+ fmin = -0.25
+ fmax = 0.25
+ mu = 0.25
+ gain_mu = 0.04
+ omega = 64
+ gain_omega = 64*64/4
+ omega_relative_limit = 0.005
+
+ # GNURadio 3.7. see https://github.com/gnuradio/gnuradio/issues/1083
+ #self.digital_mpsk_receiver_cc_0 = digital.mpsk_receiver_cc(2, 0, cmath.pi/100.0, -0.25, 0.25, 0.25, 0.04, 64, 64*64/4, 0.005)
+
+ self.costas_loop_cc_0 = digital.costas_loop_cc(loop_bw, order)
+ self.clock_recovery_mm_cc_0 = digital.clock_recovery_mm_cc(omega, gain_omega, mu, gain_mu, omega_relative_limit)
+
+
self.digital_diff_phasor_cc_0 = digital.diff_phasor_cc()
self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb()
self.blocks_uchar_to_float_0_0 = blocks.uchar_to_float()
@@ -89,9 +94,10 @@ class analyse_capture(gr.top_block):
self.connect((self.blocks_uchar_to_float_0_0, 0), (self.blocks_float_to_complex_0, 1))
self.connect((self.digital_binary_slicer_fb_0, 0), (self.blocks_file_sink_0, 0))
self.connect((self.digital_diff_phasor_cc_0, 0), (self.blocks_complex_to_float_0, 0))
- self.connect((self.digital_mpsk_receiver_cc_0, 0), (self.digital_diff_phasor_cc_0, 0))
+ self.connect((self.clock_recovery_mm_cc_0, 0), (self.digital_diff_phasor_cc_0, 0))
self.connect((self.freq_xlating_fft_filter_ccc_0, 0), (self.analog_nbfm_rx_0, 0))
- self.connect((self.low_pass_filter_0, 0), (self.digital_mpsk_receiver_cc_0, 0))
+ self.connect((self.low_pass_filter_0, 0), (self.costas_loop_cc_0, 0))
+ self.connect((self.costas_loop_cc_0, 0), (self.clock_recovery_mm_cc_0, 0))
def get_samp_rate(self):
return self.samp_rate