summaryrefslogtreecommitdiffstats
path: root/dpd/main.py
diff options
context:
space:
mode:
authorandreas128 <Andreas>2017-08-29 10:54:35 +0200
committerandreas128 <Andreas>2017-08-29 10:54:35 +0200
commitd3d5de2dac2defc41cd9ea13825914a70c976eb5 (patch)
treeb24cafea7ce6c062e9e2263d4d1521eaf63e1496 /dpd/main.py
parent11d79073f3301d85e6c4314fcca60db30afc0138 (diff)
downloaddabmod-d3d5de2dac2defc41cd9ea13825914a70c976eb5.tar.gz
dabmod-d3d5de2dac2defc41cd9ea13825914a70c976eb5.tar.bz2
dabmod-d3d5de2dac2defc41cd9ea13825914a70c976eb5.zip
Add Automatic gain control
Diffstat (limited to 'dpd/main.py')
-rwxr-xr-xdpd/main.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/dpd/main.py b/dpd/main.py
index 19460dd..8af6700 100755
--- a/dpd/main.py
+++ b/dpd/main.py
@@ -27,6 +27,7 @@ import traceback
import src.Measure as Measure
import src.Model as Model
import src.Adapt as Adapt
+import src.Agc as Agc
import argparse
parser = argparse.ArgumentParser(description="DPD Computation Engine for ODR-DabMod")
@@ -82,8 +83,8 @@ else:
adapt.set_txgain(txgain)
adapt.set_rxgain(rxgain)
-tx_gain = adapt.get_txgain()
-rx_gain = adapt.get_rxgain()
+tx_gain = adapt.get_txgain()
+rx_gain = adapt.get_rxgain()
dpd_coefs_am, dpd_coefs_pm = adapt.get_coefs()
logging.info(
"TX gain {}, RX gain {}, dpd_coefs_am {}, dpd_coefs_pm {}".format(
@@ -91,15 +92,19 @@ logging.info(
)
)
+# Automatic Gain Control
+agc = Agc.Agc(meas, adapt)
+agc.run()
+
for i in range(num_iter):
try:
- txframe_aligned, tx_ts, rxframe_aligned, rx_ts = meas.get_samples()
+ txframe_aligned, tx_ts, rxframe_aligned, rx_ts, rx_median = meas.get_samples()
logging.debug("tx_ts {}, rx_ts {}".format(tx_ts, rx_ts))
coefs_am, coefs_pm = model.get_next_coefs(txframe_aligned, rxframe_aligned)
adapt.set_coefs(coefs_am, coefs_pm)
except Exception as e:
- logging.info("Iteration {} failed.".format(i))
- logging.info(traceback.format_exc())
+ logging.warning("Iteration {} failed.".format(i))
+ logging.warning(traceback.format_exc())
# The MIT License (MIT)
#