From 59ff35e5b6a81150a87cc0b5a972a91bd64c3ab9 Mon Sep 17 00:00:00 2001 From: andreas128 Date: Mon, 29 May 2017 21:55:44 +0100 Subject: Add subsample_alignment and it's test --- calc_lag.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 calc_lag.py (limited to 'calc_lag.py') 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()) + -- cgit v1.2.3