From 0e593e6d15e815f32524c84d7165393007027952 Mon Sep 17 00:00:00 2001 From: andreas128 Date: Fri, 11 Aug 2017 18:39:05 +0200 Subject: Add case for upsampling with factor 1 --- dpd/src/Dab_Util.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'dpd/src/Dab_Util.py') diff --git a/dpd/src/Dab_Util.py b/dpd/src/Dab_Util.py index 1c0fe92..0da7343 100644 --- a/dpd/src/Dab_Util.py +++ b/dpd/src/Dab_Util.py @@ -31,8 +31,12 @@ class Dab_Util: return np.argmax(c) - off + 1 def lag_upsampling(self, sig_orig, sig_rec, n_up): - sig_orig_up = signal.resample(sig_orig, sig_orig.shape[0] * n_up) - sig_rec_up = signal.resample(sig_rec, sig_rec.shape[0] * n_up) + if n_up != 1: + sig_orig_up = signal.resample(sig_orig, sig_orig.shape[0] * n_up) + sig_rec_up = signal.resample(sig_rec, sig_rec.shape[0] * n_up) + else: + sig_orig_up = sig_orig + sig_rec_up = sig_rec l = self.lag(sig_orig_up, sig_rec_up) l_orig = float(l) / n_up return l_orig -- cgit v1.2.3