aboutsummaryrefslogtreecommitdiffstats
path: root/src/gr-fadingui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gr-fadingui')
-rw-r--r--src/gr-fadingui/python/phasecorrection.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gr-fadingui/python/phasecorrection.py b/src/gr-fadingui/python/phasecorrection.py
index 9acf563..e30824d 100644
--- a/src/gr-fadingui/python/phasecorrection.py
+++ b/src/gr-fadingui/python/phasecorrection.py
@@ -65,7 +65,11 @@ class phasecorrection(gr.sync_block):
ephase = pmt.to_python(end.value)
# compute frequency offset between start and end
- phasediff = (ephase - sphase) % (2 * np.pi)
+ phasediff = (ephase - sphase) # % (2 * np.pi)
+ if phasediff > np.pi:
+ phasediff -= np.pi
+ elif phasediff < -np.pi:
+ phasediff += np.pi
freq = phasediff / nsamples
if freq < 1e-3: