summaryrefslogtreecommitdiffstats
path: root/dpd/main.py
diff options
context:
space:
mode:
authorandreas128 <Andreas>2017-09-14 11:21:10 +0200
committerandreas128 <Andreas>2017-09-14 11:21:10 +0200
commit0718c0390d9f05ef21ec202be2ce7ea6e2a6a31d (patch)
treea9762c215a4dc9dfc1c0044b9582617e55224966 /dpd/main.py
parent426671f4af2a5d1d5d01225194eb66b2edb8c059 (diff)
downloaddabmod-0718c0390d9f05ef21ec202be2ce7ea6e2a6a31d.tar.gz
dabmod-0718c0390d9f05ef21ec202be2ce7ea6e2a6a31d.tar.bz2
dabmod-0718c0390d9f05ef21ec202be2ce7ea6e2a6a31d.zip
Add Model_PM
Diffstat (limited to 'dpd/main.py')
-rwxr-xr-xdpd/main.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/dpd/main.py b/dpd/main.py
index 99bcf31..320c291 100755
--- a/dpd/main.py
+++ b/dpd/main.py
@@ -43,6 +43,7 @@ import traceback
import src.Measure as Measure
import src.Model as Model
import src.Model_AM as Model_AM
+import src.Model_PM as Model_PM
import src.ExtractStatistic as ExtractStatistic
import src.Adapt as Adapt
import src.Agc as Agc
@@ -115,6 +116,7 @@ else:
coefs_am, coefs_pm = [[1.0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]
model = Model.Model(c, SA, MER, coefs_am, coefs_pm, plot=True)
model_am = Model_AM.Model_AM(c, plot=True)
+model_pm = Model_PM.Model_PM(c, plot=True)
adapt.set_coefs(model.coefs_am, model.coefs_pm)
adapt.set_digital_gain(digital_gain)
adapt.set_txgain(txgain)
@@ -145,10 +147,11 @@ while i < num_iter:
# Measure
if state == "measure":
txframe_aligned, tx_ts, rxframe_aligned, rx_ts, rx_median = meas.get_samples()
- tx, rx, n_per_bin = extStat.extract(txframe_aligned, rxframe_aligned)
+ tx, rx, phase_diff, n_per_bin = extStat.extract(txframe_aligned, rxframe_aligned)
n_use = int(len(n_per_bin) * 0.6)
tx = tx[:n_use]
rx = rx[:n_use]
+ phase_diff = phase_diff[:n_use]
if all(c.ES_n_per_bin == np.array(n_per_bin)[0:n_use]):
state = "model"
else:
@@ -157,6 +160,7 @@ while i < num_iter:
# Model
elif state == "model":
coefs_am = model_am.get_next_coefs(tx, rx, coefs_am)
+ coefs_pm = model_pm.get_next_coefs(tx, phase_diff, coefs_pm)
del extStat
extStat = ExtractStatistic.ExtractStatistic(c, plot=True)
state = "adapt"