summaryrefslogtreecommitdiffstats
path: root/dpd/src
diff options
context:
space:
mode:
Diffstat (limited to 'dpd/src')
-rw-r--r--dpd/src/Adapt.py8
-rw-r--r--dpd/src/Const.py2
-rw-r--r--dpd/src/Model_AM.py1
-rw-r--r--dpd/src/Model_PM.py1
-rw-r--r--dpd/src/Model_Poly.py6
5 files changed, 11 insertions, 7 deletions
diff --git a/dpd/src/Adapt.py b/dpd/src/Adapt.py
index 84b65f6..b17f059 100644
--- a/dpd/src/Adapt.py
+++ b/dpd/src/Adapt.py
@@ -137,7 +137,8 @@ class Adapt:
def get_predistorter(self):
"""Load the coefficients from the file in the format given in the README,
- return ("poly", [AM coef], [PM coef]) or ("lut", scalefactor, [LUT entries])"""
+ return ("poly", [AM coef], [PM coef]) or ("lut", scalefactor, [LUT entries])
+ """
f = open(self.coef_path, 'r')
lines = f.readlines()
predistorter_format = int(lines[0])
@@ -155,7 +156,7 @@ class Adapt:
else:
raise ValueError(
"Incorrect coef file format: too many coefficients in {}, should be {}, coefs are {}"
- .format(path, n_coefs, coefs))
+ .format(self.coef_path, n_coefs, coefs))
i += 1
f.close()
return ("poly", coefs_am_out, coefs_pm_out)
@@ -206,8 +207,7 @@ class Adapt:
self.send_receive("set memlesspoly coeffile {}".format(self.coef_path))
def dump(self, path=None):
- if path is None:
- dt = datetime.datetime.now().isoformat()
+ dt = datetime.datetime.now().isoformat()
path = logging_path + "/" + dt + "_adapt.pkl"
d = {
"txgain":self.get_txgain(),
diff --git a/dpd/src/Const.py b/dpd/src/Const.py
index 2504c1e..2f9e151 100644
--- a/dpd/src/Const.py
+++ b/dpd/src/Const.py
@@ -10,6 +10,8 @@ class Const:
self.sample_rate = sample_rate
self.n_meas = n_meas
+ self.tx_gain_max = 89
+
# Time domain
self.T_F = sample_rate / 2048000 * 196608 # Transmission frame duration
self.T_NULL = sample_rate / 2048000 * 2656 # Null symbol duration
diff --git a/dpd/src/Model_AM.py b/dpd/src/Model_AM.py
index 2704255..4b88e08 100644
--- a/dpd/src/Model_AM.py
+++ b/dpd/src/Model_AM.py
@@ -13,7 +13,6 @@ logging_path = os.path.dirname(logging.getLoggerClass().root.handlers[0].baseFil
import numpy as np
import matplotlib.pyplot as plt
-from sklearn import linear_model
def check_input_get_next_coefs(tx_dpd, rx_received):
diff --git a/dpd/src/Model_PM.py b/dpd/src/Model_PM.py
index eab5ec5..75fb055 100644
--- a/dpd/src/Model_PM.py
+++ b/dpd/src/Model_PM.py
@@ -13,7 +13,6 @@ logging_path = os.path.dirname(logging.getLoggerClass().root.handlers[0].baseFil
import numpy as np
import matplotlib.pyplot as plt
-from sklearn import linear_model
def check_input_get_next_coefs(tx_dpd, phase_diff):
diff --git a/dpd/src/Model_Poly.py b/dpd/src/Model_Poly.py
index 6a74bea..78bab91 100644
--- a/dpd/src/Model_Poly.py
+++ b/dpd/src/Model_Poly.py
@@ -62,7 +62,11 @@ class Poly:
return self.coefs_am, self.coefs_pm
def train(self, tx_abs, rx_abs, phase_diff):
- # type: (np.ndarray, np.ndarray, np.ndarray) -> (str, np.ndarray, np.ndarray)
+ """
+ :type tx_abs: np.ndarray
+ :type rx_abs: np.ndarray
+ :type phase_diff: np.ndarray
+ """
_check_input_get_next_coefs(tx_abs, rx_abs, phase_diff)
coefs_am_new = self.model_am.get_next_coefs(tx_abs, rx_abs, self.coefs_am)