From cedc4708cf73151c6b887198b14851c6adf8fc86 Mon Sep 17 00:00:00 2001 From: andreas128 Date: Wed, 23 Aug 2017 14:19:38 +0200 Subject: Add coefficient nomalization --- dpd/main.py | 3 ++- dpd/src/Model.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'dpd') diff --git a/dpd/main.py b/dpd/main.py index 81e2588..4d2b93d 100755 --- a/dpd/main.py +++ b/dpd/main.py @@ -59,7 +59,8 @@ adapt = Adapt.Adapt(port_rc, coef_path) coefs = adapt.get_coefs() #model = Model.Model(coefs) model = Model.Model([2.2, 0, 0, 0, 0]) -adapt.set_txgain(84) +adapt.set_txgain(79) +adapt.set_rxgain(15+20) tx_gain = adapt.get_txgain() rx_gain = adapt.get_rxgain() 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)) -- cgit v1.2.3