From b4d1df33b3bffd5799da5a2dbe941e784b96b9d4 Mon Sep 17 00:00:00 2001 From: andreas128 Date: Sat, 19 Aug 2017 16:21:01 +0200 Subject: Add phase alignment. Unstable for small angles. --- dpd/src/Dab_Util.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'dpd/src/Dab_Util.py') diff --git a/dpd/src/Dab_Util.py b/dpd/src/Dab_Util.py index e85d45d..a4a271e 100644 --- a/dpd/src/Dab_Util.py +++ b/dpd/src/Dab_Util.py @@ -7,6 +7,7 @@ matplotlib.use('agg') import matplotlib.pyplot as plt import datetime import src.subsample_align as sa +import src.phase_align as pa from scipy import signal import logging @@ -123,6 +124,17 @@ class Dab_Util: rxframe_path = ('/tmp/rx_2_' + dt + '.iq') sig2.tofile(rxframe_path) + sig2 = pa.phase_align(sig2, sig1) + + sig2 = sa.subsample_align(sig2, sig1) + sig2 = pa.phase_align(sig2, sig1) + + if logging.getLogger().getEffectiveLevel() == logging.DEBUG: + txframe_path = ('/tmp/tx_3_' + dt + '.iq') + sig1.tofile(txframe_path) + rxframe_path = ('/tmp/rx_3_' + dt + '.iq') + sig2.tofile(rxframe_path) + logging.debug("Sig1_cut: %d %s, Sig2_cut: %d %s, off: %d" % (len(sig1), sig1.dtype, len(sig2), sig2.dtype, off)) return sig1, sig2 -- cgit v1.2.3