aboutsummaryrefslogtreecommitdiffstats
path: root/dpd/main.py
diff options
context:
space:
mode:
authorandreas128 <Andreas>2017-08-24 19:28:17 +0200
committerandreas128 <Andreas>2017-08-24 19:28:17 +0200
commitc4f2d4a830890590af16e58e97707b2aa21bc29b (patch)
treeb0bbbfd46c0cbfc3fa2e872e9d69a20dec6db7e8 /dpd/main.py
parent3ca742663b6bf20a89c28a70668f50ceee6a23d0 (diff)
downloaddabmod-c4f2d4a830890590af16e58e97707b2aa21bc29b.tar.gz
dabmod-c4f2d4a830890590af16e58e97707b2aa21bc29b.tar.bz2
dabmod-c4f2d4a830890590af16e58e97707b2aa21bc29b.zip
Add control for dpd phase coefficient
Diffstat (limited to 'dpd/main.py')
-rwxr-xr-xdpd/main.py33
1 files changed, 20 insertions, 13 deletions
diff --git a/dpd/main.py b/dpd/main.py
index 4d2b93d..7e1041b 100755
--- a/dpd/main.py
+++ b/dpd/main.py
@@ -38,9 +38,12 @@ parser.add_argument('--rc-port', default='9400',
parser.add_argument('--samplerate', default='8192000',
help='Sample rate',
required=False)
-parser.add_argument('--coefs', default='poly.coef',
- help='File with DPD coefficients, which will be read by ODR-DabMod',
+parser.add_argument('--coefs_am', default='poly_am.coef',
+ help='File with DPD Amplitude coefficients, which will be read by ODR-DabMod',
required=False)
+parser.add_argument('--coefs_pm', default='poly_am.coef',
+ help='File with DPD Phase coefficients, which will be read by ODR-DabMod',
+ required=False)
parser.add_argument('--samps', default='10240',
help='Number of samples to request from ODR-DabMod',
required=False)
@@ -49,33 +52,37 @@ cli_args = parser.parse_args()
port = int(cli_args.port)
port_rc = int(cli_args.rc_port)
-coef_path = cli_args.coefs
+coef_am_path = cli_args.coefs_am
+coef_pm_path = cli_args.coefs_pm
num_req = int(cli_args.samps)
samplerate = int(cli_args.samplerate)
meas = Measure.Measure(samplerate, port, num_req)
-adapt = Adapt.Adapt(port_rc, coef_path)
-coefs = adapt.get_coefs()
+adapt = Adapt.Adapt(port_rc, coef_am_path, coef_pm_path)
+coefs_am = adapt.get_coefs_am()
+coefs_pm = adapt.get_coefs_pm()
#model = Model.Model(coefs)
-model = Model.Model([2.2, 0, 0, 0, 0])
-adapt.set_txgain(79)
-adapt.set_rxgain(15+20)
+model = Model.Model([2.2, 0, 0, 0, 0], [0, 0, 0, 0, 0])
+adapt.set_txgain(70)
+adapt.set_rxgain(30)
tx_gain = adapt.get_txgain()
rx_gain = adapt.get_rxgain()
-dpd_coefs = adapt.get_coefs()
+dpd_coefs_am = adapt.get_coefs_am()
+dpd_coefs_pm = adapt.get_coefs_pm()
logging.info(
- "TX gain {}, RX gain {}, dpd_coefs {}".format(
- tx_gain, rx_gain, dpd_coefs
+ "TX gain {}, RX gain {}, dpd_coefs_am {}, dpd_coefs_pm {}".format(
+ tx_gain, rx_gain, dpd_coefs_am, dpd_coefs_pm
)
)
for i in range(500):
txframe_aligned, tx_ts, rxframe_aligned, rx_ts = meas.get_samples()
logging.debug("tx_ts {}, rx_ts {}".format(tx_ts, rx_ts))
- coefs = model.get_next_coefs(txframe_aligned, rxframe_aligned)
- adapt.set_coefs(coefs)
+ coefs_am, coefs_pm = model.get_next_coefs(txframe_aligned, rxframe_aligned)
+ adapt.set_coefs_am(coefs_am)
+ adapt.set_coefs_pm(coefs_pm)
# The MIT License (MIT)
#