aboutsummaryrefslogtreecommitdiffstats
path: root/gui/dpd
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-11-28 15:04:41 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-11-28 15:04:41 +0100
commit8b42d3115db2ecec9031c5d1421463b0191e055c (patch)
tree66c1a9d5864c478ca5026a681963e81db6142e0f /gui/dpd
parentcfa9461f269e616d6d54658d583b37d215f35a7b (diff)
downloaddabmod-8b42d3115db2ecec9031c5d1421463b0191e055c.tar.gz
dabmod-8b42d3115db2ecec9031c5d1421463b0191e055c.tar.bz2
dabmod-8b42d3115db2ecec9031c5d1421463b0191e055c.zip
Use multiprocessing for DPD functionality
Diffstat (limited to 'gui/dpd')
-rw-r--r--gui/dpd/Capture.py2
-rw-r--r--gui/dpd/__init__.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/gui/dpd/Capture.py b/gui/dpd/Capture.py
index 4c0e99c..3b2988b 100644
--- a/gui/dpd/Capture.py
+++ b/gui/dpd/Capture.py
@@ -172,7 +172,7 @@ class Capture:
rxframe = rxframe * self.rx_normalisation
txframe_aligned, rxframe_aligned, coarse_offset = align_samples(txframe, rxframe)
- return tx_ts, tx_median, rx_ts, rx_median, coarse_offset, correlation_coefficient(txframe_aligned, rxframe_aligned)
+ return tx_ts, tx_median, rx_ts, rx_median, np.abs(coarse_offset), correlation_coefficient(txframe_aligned, rxframe_aligned)
def get_samples(self):
"""Connect to ODR-DabMod, retrieve TX and RX samples, load
diff --git a/gui/dpd/__init__.py b/gui/dpd/__init__.py
index 716b8c2..85abe86 100644
--- a/gui/dpd/__init__.py
+++ b/gui/dpd/__init__.py
@@ -57,12 +57,13 @@ class DPD:
def capture_calibration(self):
tx_ts, tx_median, rx_ts, rx_median, coarse_offset, correlation_coefficient = self.capture.calibrate()
result = {'status': "ok"}
- result['length'] = len(txframe_aligned)
result['tx_median'] = "{:.2}dB".format(20*np.log10(tx_median))
result['rx_median'] = "{:.2}dB".format(20*np.log10(rx_median))
result['tx_ts'] = tx_ts
result['rx_ts'] = rx_ts
- result['correlation'] = correlation_coefficient
+ result['coarse_offset'] = int(coarse_offset)
+ result['correlation'] = float(correlation_coefficient)
+ return result
def capture_samples(self):
"""Captures samples and store them in the accumulated samples,