summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Müller <mmueller@gnuradio.org>2020-11-07 12:39:08 +0100
committermormj <34754695+mormj@users.noreply.github.com>2020-11-09 07:59:14 -0500
commit55621a9709b219551b908e67ee88f6f7ad2593cb (patch)
tree18f742e7af01bb4bfed4918a36865fa88c0a9d1b
parent269fd060c56cbb01665a4ce9270ce4e67e56b70f (diff)
analog: WFM tools: proper integer div, decimation handling
-rw-r--r--gr-analog/python/analog/wfm_rcv.py5
-rw-r--r--gr-analog/python/analog/wfm_rcv_fmdet.py7
-rw-r--r--gr-analog/python/analog/wfm_rcv_pll.py9
-rw-r--r--gr-analog/python/analog/wfm_tx.py4
4 files changed, 18 insertions, 7 deletions
diff --git a/gr-analog/python/analog/wfm_rcv.py b/gr-analog/python/analog/wfm_rcv.py
index 99eb2c190a..48501d47af 100644
--- a/gr-analog/python/analog/wfm_rcv.py
+++ b/gr-analog/python/analog/wfm_rcv.py
@@ -1,5 +1,5 @@
#
-# Copyright 2005,2007,2012 Free Software Foundation, Inc.
+# Copyright 2005,2007,2012,2020 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -31,6 +31,9 @@ class wfm_rcv(gr.hier_block2):
gr.hier_block2.__init__(self, "wfm_rcv",
gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
gr.io_signature(1, 1, gr.sizeof_float)) # Output signature
+ if audio_decimation != int(audio_decimation):
+ raise ValueError("audio_decimation needs to be an integer")
+ audio_decimation = int(audio_decimation)
volume = 20.
diff --git a/gr-analog/python/analog/wfm_rcv_fmdet.py b/gr-analog/python/analog/wfm_rcv_fmdet.py
index ac653842d9..27a416aa1c 100644
--- a/gr-analog/python/analog/wfm_rcv_fmdet.py
+++ b/gr-analog/python/analog/wfm_rcv_fmdet.py
@@ -1,5 +1,5 @@
#
-# Copyright 2005,2006,2012-2013 Free Software Foundation, Inc.
+# Copyright 2005,2006,2012-2013,2020 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -34,6 +34,11 @@ class wfm_rcv_fmdet(gr.hier_block2):
gr.hier_block2.__init__(self, "wfm_rcv_fmdet",
gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
gr.io_signature(2, 2, gr.sizeof_float)) # Output signature
+
+ if audio_decimation != int(audio_decimation):
+ raise ValueError("audio_decimation needs to be an integer")
+ audio_decimation = int(audio_decimation)
+
lowfreq = -125e3 / demod_rate
highfreq = 125e3 / demod_rate
audio_rate = demod_rate / audio_decimation
diff --git a/gr-analog/python/analog/wfm_rcv_pll.py b/gr-analog/python/analog/wfm_rcv_pll.py
index d69f9e852c..37a9a64c4c 100644
--- a/gr-analog/python/analog/wfm_rcv_pll.py
+++ b/gr-analog/python/analog/wfm_rcv_pll.py
@@ -1,13 +1,12 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
+# Copyright 2007-2020 Free Software Foundation, Inc.
#
# SPDX-License-Identifier: GPL-3.0
#
# GNU Radio Python Flow Graph
# Title: FM stereo demod block
-# corrected output ports
-
import math
@@ -27,12 +26,16 @@ class wfm_rcv_pll(gr.hier_block2):
Args:
demod_rate: input sample rate of complex baseband input. (float)
- audio_decimation: how much to decimate demod_rate to get to audio. (integer)
+ audio_decimation: how much to decimate demod_rate to get to audio. (integer) FIXME: Not actually implemented!
"""
gr.hier_block2.__init__(self, "wfm_rcv_pll",
gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
gr.io_signature(2, 2, gr.sizeof_float)) # Output signature
+ if audio_decimation != int(audio_decimation):
+ raise ValueError("audio_decimation needs to be an integer")
+ audio_decimation = int(audio_decimation)
+
##################################################
# Variables
##################################################
diff --git a/gr-analog/python/analog/wfm_tx.py b/gr-analog/python/analog/wfm_tx.py
index 5de90747cc..11f90ae545 100644
--- a/gr-analog/python/analog/wfm_tx.py
+++ b/gr-analog/python/analog/wfm_tx.py
@@ -1,5 +1,5 @@
#
-# Copyright 2005,2007,2012 Free Software Foundation, Inc.
+# Copyright 2005,2007,2012,2020 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -49,7 +49,7 @@ class wfm_tx(gr.hier_block2):
do_interp = audio_rate != quad_rate
if do_interp:
- interp_factor = quad_rate / audio_rate
+ interp_factor = quad_rate // audio_rate
interp_taps = filter.optfir.low_pass(interp_factor, # gain
quad_rate, # Fs
16000, # passband cutoff