aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-07-23 17:15:36 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-07-23 17:15:36 +0200
commit5310fe8830ac25667daa332118be965be72c9420 (patch)
treea0e57915e620dc34f3aa7fea9b909ee942fe61d6
parentb9b461796a81f651310c2c0c73028ec08f66d3aa (diff)
downloadodr-dab-cir-5310fe8830ac25667daa332118be965be72c9420.tar.gz
odr-dab-cir-5310fe8830ac25667daa332118be965be72c9420.tar.bz2
odr-dab-cir-5310fe8830ac25667daa332118be965be72c9420.zip
Normalise CIR against TF power
-rwxr-xr-xcorrelate_with_ref.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/correlate_with_ref.py b/correlate_with_ref.py
index 193fa8c..a587165 100755
--- a/correlate_with_ref.py
+++ b/correlate_with_ref.py
@@ -78,12 +78,17 @@ def calc_cir(channel, start_ix):
corr_start_ix = t_null + T_NULL - 50
# In TM1, the longest spacing between carrier components one can allow is
- # around 504 T (246us, or74km at speed of light). This gives us a limit
+ # around 504 T (246us, or 74km at speed of light). This gives us a limit
# on the number of correlations it makes sense to do.
max_component_delay = 500 # T
cir = np.array([np.abs(np.corrcoef(channel[start_ix + corr_start_ix + i:start_ix + corr_start_ix + phase_ref.size + i], phase_ref)[0,1]) for i in range(max_component_delay)])
- return cir
+
+ # In order to be able to compare measurements accross transmission frames,
+ # we normalise the CIR against channel power
+ channel_power = np.abs(channel[start_ix:start_ix+T_TF]).sum()
+
+ return cir / channel_power
num_correlations = int(len(channel_out) / T_TF)
print("Doing {} correlations".format(num_correlations))