diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-07-23 12:39:38 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-07-23 12:39:38 +0200 |
commit | c340361c04ab0365284404dc16eaada65d482ea3 (patch) | |
tree | c5988d945f964e3c74ff8b88a5573642740b3b84 /autocorrelate.py | |
parent | 9700ab0038fb3988ea7a95526c4490a4ef1afc60 (diff) | |
download | odr-dab-cir-c340361c04ab0365284404dc16eaada65d482ea3.tar.gz odr-dab-cir-c340361c04ab0365284404dc16eaada65d482ea3.tar.bz2 odr-dab-cir-c340361c04ab0365284404dc16eaada65d482ea3.zip |
Fix correlation against phase ref
Also remove the old autocorrelation scripts, not pursuing this approach
Diffstat (limited to 'autocorrelate.py')
-rwxr-xr-x | autocorrelate.py | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/autocorrelate.py b/autocorrelate.py deleted file mode 100755 index 9a66917..0000000 --- a/autocorrelate.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python -# -# Do a single autocorrelation over the whole test.16.14.25.iq file -# -# Licence: see LICENCE file - -import numpy as np -import matplotlib.pyplot as pp - -file_in = "test.16.14.25.iq" - -channel_out = np.fromfile(file_in, np.complex64) - -print("Autocorrelating") - -correlationlength = 50 - -def autocorrelate(x, length): - return np.array([1] + [np.abs(np.corrcoef(x[:-i], x[i:])[0,1]) for i in range(1, length)]) - -autocorr = autocorrelate(channel_out, correlationlength) - -print("Done") - -numpeaks = 6 -print("The first {} highest peaks are at".format(numpeaks)) -print(" index: amplitude") -for ind in autocorr.argsort()[-numpeaks:][::-1]: - print(" {:4}: {}".format(ind, autocorr[ind])) - -fig = pp.figure() -ax = fig.add_subplot(111) -hi = ax.semilogy(autocorr) - - -pp.show() - - |