diff options
author | andreas128 <Andreas> | 2017-08-11 18:39:05 +0200 |
---|---|---|
committer | andreas128 <Andreas> | 2017-08-11 18:39:05 +0200 |
commit | 0e593e6d15e815f32524c84d7165393007027952 (patch) | |
tree | 561f9036f6a1cb5501f7a5fe6fac9e8206cfb82f /dpd | |
parent | d8fc75752c9723a1f72c968f6aaadfaf597608fd (diff) | |
download | dabmod-0e593e6d15e815f32524c84d7165393007027952.tar.gz dabmod-0e593e6d15e815f32524c84d7165393007027952.tar.bz2 dabmod-0e593e6d15e815f32524c84d7165393007027952.zip |
Add case for upsampling with factor 1
Diffstat (limited to 'dpd')
-rw-r--r-- | dpd/src/Dab_Util.py | 8 |
1 files changed, 6 insertions, 2 deletions
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 |