aboutsummaryrefslogtreecommitdiffstats
path: root/dpd/main.py
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-08-25 17:17:02 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-08-25 17:17:02 +0200
commit2b5eac085fa2482fa3ee062d079a03454f05b390 (patch)
tree15b4a995070079273e3eeac8a6c884acf95f9b46 /dpd/main.py
parent7bf3f2b9747a9f49a29a836d7c4b60f3c1070fd8 (diff)
downloaddabmod-2b5eac085fa2482fa3ee062d079a03454f05b390.tar.gz
dabmod-2b5eac085fa2482fa3ee062d079a03454f05b390.tar.bz2
dabmod-2b5eac085fa2482fa3ee062d079a03454f05b390.zip
Put both AM/AM and AM/PM coefs to one file
This partly reverts commit 28462b9d8bb08609810ea9a9882c5fa9205b8b80.
Diffstat (limited to 'dpd/main.py')
-rwxr-xr-xdpd/main.py25
1 files changed, 9 insertions, 16 deletions
diff --git a/dpd/main.py b/dpd/main.py
index 7e1041b..ea570d3 100755
--- a/dpd/main.py
+++ b/dpd/main.py
@@ -38,12 +38,9 @@ parser.add_argument('--rc-port', default='9400',
parser.add_argument('--samplerate', default='8192000',
help='Sample rate',
required=False)
-parser.add_argument('--coefs_am', default='poly_am.coef',
- help='File with DPD Amplitude coefficients, which will be read by ODR-DabMod',
+parser.add_argument('--coefs', default='poly.coef',
+ help='File with DPD 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)
@@ -52,37 +49,33 @@ cli_args = parser.parse_args()
port = int(cli_args.port)
port_rc = int(cli_args.rc_port)
-coef_am_path = cli_args.coefs_am
-coef_pm_path = cli_args.coefs_pm
+coef_path = cli_args.coefs
num_req = int(cli_args.samps)
samplerate = int(cli_args.samplerate)
meas = Measure.Measure(samplerate, port, num_req)
-adapt = Adapt.Adapt(port_rc, coef_am_path, coef_pm_path)
-coefs_am = adapt.get_coefs_am()
-coefs_pm = adapt.get_coefs_pm()
+adapt = Adapt.Adapt(port_rc, coef_path)
+coefs_am, coefs_pm = adapt.get_coefs()
#model = Model.Model(coefs)
-model = Model.Model([2.2, 0, 0, 0, 0], [0, 0, 0, 0, 0])
+model = Model.Model([1, 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_am = adapt.get_coefs_am()
-dpd_coefs_pm = adapt.get_coefs_pm()
+dpd_coefs_am, dpd_coefs_pm = adapt.get_coefs()
logging.info(
"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):
+for i in range(1):
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)
- adapt.set_coefs_am(coefs_am)
- adapt.set_coefs_pm(coefs_pm)
+ adapt.set_coefs(coefs_am, coefs_pm)
# The MIT License (MIT)
#