From 37b3091eced58f399bd95782bb69eee29333f0eb Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 25 Aug 2017 17:26:08 +0200 Subject: DPD CE: Add options for interations and load coefs --- dpd/main.py | 15 ++++++++++++--- dpd/poly.coef | 20 ++++++++++---------- 2 files changed, 22 insertions(+), 13 deletions(-) (limited to 'dpd') 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 -- cgit v1.2.3