summaryrefslogtreecommitdiffstats
path: root/dpd/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'dpd/main.py')
-rw-r--r--dpd/main.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/dpd/main.py b/dpd/main.py
index 427bc28..1cb6021 100644
--- a/dpd/main.py
+++ b/dpd/main.py
@@ -1,5 +1,7 @@
-#!/usr/bin/env python
# -*- coding: utf-8 -*-
+"""This Python script calculates and updates the parameter of the digital
+predistortion module of the ODR-DabMod. More precisely the complex
+coefficients of the polynom which is used for predistortion."""
import logging
logging.basicConfig(format='%(asctime)s - %(module)s - %(levelname)s - %(message)s',
@@ -7,16 +9,24 @@ logging.basicConfig(format='%(asctime)s - %(module)s - %(levelname)s - %(message
filename='/tmp/dpd.log',
filemode='w',
level=logging.DEBUG)
+
import src.Measure as Measure
+import src.Model as Model
+import src.Adapt as Adapt
port = 50055
+port_rc = 9400
+coef_path = "/home/andreas/dab/ODR-DabMod/polyCoefsCustom"
num_req = 10240
-m = Measure.Measure(port, num_req)
+meas = Measure.Measure(port, num_req)
+adapt = Adapt.Adapt(port_rc, coef_path)
+coefs = adapt.get_coefs()
+model = Model.Model(coefs)
-logging.info("Do measurement")
-m.get_samples()
-logging.info("Done")
+txframe_aligned, rxframe_aligned = meas.get_samples()
+coefs = model.get_next_coefs(txframe_aligned, rxframe_aligned)
+adapt.set_coefs(coefs)
# The MIT License (MIT)
#