summaryrefslogtreecommitdiffstats
path: root/dpd/src/Model.py
diff options
context:
space:
mode:
authorandreas128 <Andreas>2017-08-23 14:19:38 +0200
committerandreas128 <Andreas>2017-08-23 14:19:38 +0200
commitcedc4708cf73151c6b887198b14851c6adf8fc86 (patch)
tree1a74084ad14a2e89f468af4f919967c60207ff6e /dpd/src/Model.py
parent559aec7d224afd86f1612f0c5177e508fae10665 (diff)
downloaddabmod-cedc4708cf73151c6b887198b14851c6adf8fc86.tar.gz
dabmod-cedc4708cf73151c6b887198b14851c6adf8fc86.tar.bz2
dabmod-cedc4708cf73151c6b887198b14851c6adf8fc86.zip
Add coefficient nomalization
Diffstat (limited to 'dpd/src/Model.py')
-rw-r--r--dpd/src/Model.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/dpd/src/Model.py b/dpd/src/Model.py
index aef112c..8df3925 100644
--- a/dpd/src/Model.py
+++ b/dpd/src/Model.py
@@ -23,6 +23,9 @@ class Model:
self.errs = [0,]
def get_next_coefs(self, txframe_aligned, rxframe_aligned):
+ dt = datetime.datetime.now().isoformat()
+ txframe_aligned.tofile(logging_path + "/txframe_" + dt + ".iq")
+ rxframe_aligned.tofile(logging_path + "/rxframe_" + dt + ".iq")
rx_abs = np.abs(rxframe_aligned)
rx_A = np.vstack([rx_abs,
rx_abs**3,
@@ -39,6 +42,7 @@ class Model:
a_delta = np.linalg.lstsq(rx_A, err)[0]
new_coefs = self.coefs - 0.1 * a_delta
+ new_coefs = new_coefs * (self.coefs[0] / new_coefs[0])
logging.debug("a_delta {}".format(a_delta))
logging.debug("new coefs {}".format(new_coefs))