aboutsummaryrefslogtreecommitdiffstats
path: root/gui/dpd
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-09-25 12:41:41 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-09-25 12:41:41 +0200
commite84f532b9e97dc2ad53ad96cc9543a178d6f20fd (patch)
treeedcf5bd3290e18597e02cbde77f78b4329d5d95b /gui/dpd
parentd5afedae5f31a6b4c8052b12af9279e609ac5f20 (diff)
downloaddabmod-e84f532b9e97dc2ad53ad96cc9543a178d6f20fd.tar.gz
dabmod-e84f532b9e97dc2ad53ad96cc9543a178d6f20fd.tar.bz2
dabmod-e84f532b9e97dc2ad53ad96cc9543a178d6f20fd.zip
gui: add input to RC page, improve predistortion page
Diffstat (limited to 'gui/dpd')
-rw-r--r--gui/dpd/Capture.py4
-rw-r--r--gui/dpd/__init__.py11
2 files changed, 4 insertions, 11 deletions
diff --git a/gui/dpd/Capture.py b/gui/dpd/Capture.py
index 31fa78d..de428cb 100644
--- a/gui/dpd/Capture.py
+++ b/gui/dpd/Capture.py
@@ -163,9 +163,9 @@ class Capture:
tx_median = np.median(np.abs(txframe))
if self.median_max < tx_median:
- raise ValueError("Median {} too high, decrease digital_gain!".format(tx_median))
+ raise ValueError("TX median {} too high, decrease digital_gain!".format(tx_median))
elif tx_median < self.median_min:
- raise ValueError("Median {} too low, increase digital_gain!".format(tx_median))
+ raise ValueError("TX median {} too low, increase digital_gain!".format(tx_median))
else:
rx_median = np.median(np.abs(rxframe))
rxframe = rxframe / rx_median * tx_median
diff --git a/gui/dpd/__init__.py b/gui/dpd/__init__.py
index 16017ee..8dd0807 100644
--- a/gui/dpd/__init__.py
+++ b/gui/dpd/__init__.py
@@ -24,13 +24,6 @@
from . import Capture
-class DPDError:
- def __init__(self, reason):
- self.reason = reason
-
- def __str__(self):
- return "DPD Error: {}".format(self.reason)
-
class DPD:
def __init__(self, samplerate=8192000):
self.samplerate = samplerate
@@ -56,7 +49,7 @@ class DPD:
def capture_samples(self):
"""Captures samples and store them in the accumulated samples,
- returns a string with some info"""
+ returns a dict with some info"""
try:
txframe_aligned, tx_ts, tx_median, rxframe_aligned, rx_ts, rx_median = self.capture.get_samples()
self.last_capture_info['length'] = len(txframe_aligned)
@@ -66,7 +59,7 @@ class DPD:
self.last_capture_info['rx_ts'] = rx_ts
return self.last_capture_info
except ValueError as e:
- raise DPDError("Capture failed: {}".format(e))
+ raise ValueError("Capture failed: {}".format(e))
# tx, rx, phase_diff, n_per_bin = extStat.extract(txframe_aligned, rxframe_aligned)
# off = SA.calc_offset(txframe_aligned)