diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-08-25 17:26:08 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-08-25 17:26:08 +0200 |
commit | 37b3091eced58f399bd95782bb69eee29333f0eb (patch) | |
tree | 6a4d19a4b7d17d08db3cb6cf2974af4d57379254 /dpd/main.py | |
parent | 2b5eac085fa2482fa3ee062d079a03454f05b390 (diff) | |
download | dabmod-37b3091eced58f399bd95782bb69eee29333f0eb.tar.gz dabmod-37b3091eced58f399bd95782bb69eee29333f0eb.tar.bz2 dabmod-37b3091eced58f399bd95782bb69eee29333f0eb.zip |
DPD CE: Add options for interations and load coefs
Diffstat (limited to 'dpd/main.py')
-rwxr-xr-x | dpd/main.py | 15 |
1 files changed, 12 insertions, 3 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) |