aboutsummaryrefslogtreecommitdiffstats
path: root/src/gr-fadingui/python/phasecorrection.py
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2021-12-11 19:03:48 +0100
committerNao Pross <np@0hm.ch>2021-12-11 19:03:48 +0100
commit2ce1ab42bcb3b35a5ad529a959526603faeb2eea (patch)
treee01a43ca409134fe3e693cd25444b9993f6e11e3 /src/gr-fadingui/python/phasecorrection.py
parentUpdate Frame Synchronization notebook (diff)
parentCorrections for QPSK on hardware (diff)
downloadFading-2ce1ab42bcb3b35a5ad529a959526603faeb2eea.tar.gz
Fading-2ce1ab42bcb3b35a5ad529a959526603faeb2eea.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/gr-fadingui/python/phasecorrection.py')
-rw-r--r--src/gr-fadingui/python/phasecorrection.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gr-fadingui/python/phasecorrection.py b/src/gr-fadingui/python/phasecorrection.py
index cd3fa37..9acf563 100644
--- a/src/gr-fadingui/python/phasecorrection.py
+++ b/src/gr-fadingui/python/phasecorrection.py
@@ -68,12 +68,15 @@ class phasecorrection(gr.sync_block):
phasediff = (ephase - sphase) % (2 * np.pi)
freq = phasediff / nsamples
+ if freq < 1e-3:
+ freq = 0
+
# save this one for the last block (see variable `end' in self.work)
self.lastfreq = freq
# debugging
log.debug(f"Correction for chunk of {nsamples:2d} samples is " \
- f"sphase={sphase: .4f} rad and freq={freq*1e3: .4f}e-3 rad / sample")
+ f"sphase={sphase: .4f} rad, ephase={ephase: .4f} rad and freq={freq*1e3: .4f}e-3 rad / sample")
self.lastnsamples = nsamples
# compute chunk values