summaryrefslogtreecommitdiffstats
path: root/python/dpd/Measure.py
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-12-05 12:12:45 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-12-05 12:12:45 +0100
commite749bd08958a462f57b8492721a04128468656d0 (patch)
tree1c3c7801ccc8985f7f4393daf8d275c5eed4a717 /python/dpd/Measure.py
parent31b65e41043900c0cadd80961f4b22cdfc171e7d (diff)
downloaddabmod-e749bd08958a462f57b8492721a04128468656d0.tar.gz
dabmod-e749bd08958a462f57b8492721a04128468656d0.tar.bz2
dabmod-e749bd08958a462f57b8492721a04128468656d0.zip
Get calibration to work with GUI
Diffstat (limited to 'python/dpd/Measure.py')
-rw-r--r--python/dpd/Measure.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/python/dpd/Measure.py b/python/dpd/Measure.py
index 36b1888..489c4c0 100644
--- a/python/dpd/Measure.py
+++ b/python/dpd/Measure.py
@@ -94,14 +94,15 @@ class Measure:
def get_samples(self):
"""Connect to ODR-DabMod, retrieve TX and RX samples, load
into numpy arrays, and return a tuple
- (txframe_aligned, tx_ts, rxframe_aligned, rx_ts, rx_median)
+ (txframe_aligned, tx_ts, rxframe_aligned, rx_ts, rx_median, tx_median)
"""
txframe, tx_ts, rxframe, rx_ts = self.receive_tcp()
# Normalize received signal with sent signal
rx_median = np.median(np.abs(rxframe))
- rxframe = rxframe / rx_median * np.median(np.abs(txframe))
+ tx_median = np.median(np.abs(txframe))
+ rxframe = rxframe / rx_median * tx_median
du = DU.Dab_Util(self.c, self.samplerate)
txframe_aligned, rxframe_aligned = du.subsample_align(txframe, rxframe)
@@ -111,7 +112,7 @@ class Measure:
% (len(txframe), txframe.dtype, len(rxframe), rxframe.dtype,
len(txframe_aligned), txframe_aligned.dtype, len(rxframe_aligned), rxframe_aligned.dtype) )
- return txframe_aligned, tx_ts, rxframe_aligned, rx_ts, rx_median
+ return txframe_aligned, tx_ts, rxframe_aligned, rx_ts, rx_median, tx_median
# The MIT License (MIT)
#