From 388ccbd8c9ce5df7d194557f744a1e5089a89907 Mon Sep 17 00:00:00 2001
From: Andrej Rode <mail@andrejro.de>
Date: Tue, 14 May 2019 18:05:21 +0200
Subject: analog: correct errors of automatic conversion script in fm_preemph

An automatic conversion for python3 mangled the source and introduced a bug.
This commit fixes the conversion bug in fm_preemph. Changeset that lead to this
bug still has to be analyzed further.

Fixes #2286
---
 gr-analog/python/analog/fm_emph.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'gr-analog/python/analog/fm_emph.py')

diff --git a/gr-analog/python/analog/fm_emph.py b/gr-analog/python/analog/fm_emph.py
index a4cdedcf1b..602f1be3ea 100644
--- a/gr-analog/python/analog/fm_emph.py
+++ b/gr-analog/python/analog/fm_emph.py
@@ -289,7 +289,8 @@ class fm_preemph(gr.hier_block2):
         # That isn't what users are going to expect, so adjust with a
         # gain, g, so that H(z = 1) = 1.0 for 0 dB gain at DC.
         w_0dB = 2.0 * math.pi * 0.0
-        g =        abs(1.0 - p1 * cmath.rect(1.0 / -w_0dB), (b0 * abs(1.0 - z1 * cmath.rect(1.0, -w_0dB))))
+        g =        abs(1.0 - p1 * cmath.rect(1.0 / -w_0dB)) \
+            / (b0 * abs(1.0 - z1 * cmath.rect(1.0, -w_0dB)))
 
         btaps = [ g * b0 * 1.0, g * b0 * -z1 ]
         ataps = [          1.0,          -p1 ]
-- 
cgit v1.2.3