summaryrefslogtreecommitdiffstats
path: root/dpd
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-08-25 17:26:08 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-08-25 17:26:08 +0200
commit37b3091eced58f399bd95782bb69eee29333f0eb (patch)
tree6a4d19a4b7d17d08db3cb6cf2974af4d57379254 /dpd
parent2b5eac085fa2482fa3ee062d079a03454f05b390 (diff)
downloaddabmod-37b3091eced58f399bd95782bb69eee29333f0eb.tar.gz
dabmod-37b3091eced58f399bd95782bb69eee29333f0eb.tar.bz2
dabmod-37b3091eced58f399bd95782bb69eee29333f0eb.zip
DPD CE: Add options for interations and load coefs
Diffstat (limited to 'dpd')
-rwxr-xr-xdpd/main.py15
-rw-r--r--dpd/poly.coef20
2 files changed, 22 insertions, 13 deletions
diff --git a/dpd/main.py b/dpd/main.py
index ea570d3..1682a59 100755
--- a/dpd/main.py
+++ b/dpd/main.py
@@ -44,6 +44,12 @@ parser.add_argument('--coefs', default='poly.coef',
parser.add_argument('--samps', default='10240',
help='Number of samples to request from ODR-DabMod',
required=False)
+parser.add_argument('-i', '--iterations', default='1',
+ help='Number of iterations to run',
+ required=False)
+parser.add_argument('-l', '--load-poly',
+ help='Load existing polynomial',
+ action="store_true")
cli_args = parser.parse_args()
@@ -52,13 +58,16 @@ port_rc = int(cli_args.rc_port)
coef_path = cli_args.coefs
num_req = int(cli_args.samps)
samplerate = int(cli_args.samplerate)
+num_iter = int(cli_args.iterations)
meas = Measure.Measure(samplerate, port, num_req)
adapt = Adapt.Adapt(port_rc, coef_path)
coefs_am, coefs_pm = adapt.get_coefs()
-#model = Model.Model(coefs)
-model = Model.Model([1, 0, 0, 0, 0], [0, 0, 0, 0, 0])
+if cli_args.load_poly:
+ model = Model.Model(coefs_am, coefs_pm)
+else:
+ model = Model.Model([1, 0, 0, 0, 0], [0, 0, 0, 0, 0])
adapt.set_txgain(70)
adapt.set_rxgain(30)
@@ -71,7 +80,7 @@ logging.info(
)
)
-for i in range(1):
+for i in range(num_iter):
txframe_aligned, tx_ts, rxframe_aligned, rx_ts = 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)
diff --git a/dpd/poly.coef b/dpd/poly.coef
index d1e9967..f65e369 100644
--- a/dpd/poly.coef
+++ b/dpd/poly.coef
@@ -1,11 +1,11 @@
5
-0.9999999999999999
-0.013989416705029524
--0.17875129566117912
-1.189037605717911
--1.7871717414839607
--0.005118865951385803
-0.06831365867284998
--0.32196849299538066
-0.6598790120324084
--0.5099783166759195
+1
+0
+0
+0
+0
+0
+0
+0
+0
+0