diff options
author | andreas128 <Andreas> | 2017-05-29 21:55:44 +0100 |
---|---|---|
committer | andreas128 <Andreas> | 2017-05-29 21:55:44 +0100 |
commit | 59ff35e5b6a81150a87cc0b5a972a91bd64c3ab9 (patch) | |
tree | 84996d2f963fc90bef09802fbb74916e14da0f15 /calc_lag.py | |
parent | c8d61fa0a7b36e3c3acec5a4c22ee4b4ab14a700 (diff) | |
download | ODR-StaticPrecorrection-59ff35e5b6a81150a87cc0b5a972a91bd64c3ab9.tar.gz ODR-StaticPrecorrection-59ff35e5b6a81150a87cc0b5a972a91bd64c3ab9.tar.bz2 ODR-StaticPrecorrection-59ff35e5b6a81150a87cc0b5a972a91bd64c3ab9.zip |
Add subsample_alignment and it's test
Diffstat (limited to 'calc_lag.py')
-rw-r--r-- | calc_lag.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/calc_lag.py b/calc_lag.py new file mode 100644 index 0000000..5f5cf70 --- /dev/null +++ b/calc_lag.py @@ -0,0 +1,44 @@ +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import argparse +import re +import sys +from tqdm import tqdm + +from glob import glob +from natsort import natsorted +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt + +import src.dab_util as du + + + + +tx_paths = natsorted(glob(r'/home/andreas/dab/ODR-StaticPrecorrection/data/received/*_tx_record.iq')) +rx_paths = natsorted(glob(r'/home/andreas/dab/ODR-StaticPrecorrection/data/received/*_rx_record.iq')) + +res = [] + +for tx_path, rx_path in zip(tx_paths, rx_paths): + s1 = du.fromfile(tx_path) + s2 = du.fromfile(rx_path) + + res.append({ + '1':du.lag_upsampling(s2, s1, n_up=1), + '2':du.lag_upsampling(s2, s1, n_up=2), + '3':du.lag_upsampling(s2, s1, n_up=3), + '4':du.lag_upsampling(s2, s1, n_up=4), + '8':du.lag_upsampling(s2, s1, n_up=8), + '16':du.lag_upsampling(s2, s1, n_up=16), + '32':du.lag_upsampling(s2, s1, n_up=32), + }) + +df = pd.DataFrame(res) +df = df.reindex_axis(sorted(df.columns), axis=1) +print(df) +print(df.describe()) + |