From 1fff3ceab051fc795b0b09f451c2f8c4ffa59fcf Mon Sep 17 00:00:00 2001 From: andreas128 Date: Wed, 27 Sep 2017 12:43:40 +0200 Subject: Make Model_Lut compatible --- dpd/src/Model_Lut.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'dpd/src/Model_Lut.py') diff --git a/dpd/src/Model_Lut.py b/dpd/src/Model_Lut.py index 453ae55..d0f15df 100644 --- a/dpd/src/Model_Lut.py +++ b/dpd/src/Model_Lut.py @@ -1,22 +1,37 @@ +# -*- coding: utf-8 -*- +# +# DPD Calculation Engine, model implementation using polynomial +# +# http://www.opendigitalradio.org +# Licence: The MIT License, see notice at the end of this file + +import os +import logging + +logging_path = os.path.dirname(logging.getLoggerClass().root.handlers[0].baseFilename) + +import numpy as np + + class Lut: """Implements a model that calculates lookup table coefficients""" def __init__(self, c, - SA, - MER, learning_rate=1., plot=False): + """ + + :rtype: + """ logging.debug("Initialising LUT Model") self.c = c - self.SA = SA - self.MER = MER self.learning_rate = learning_rate self.plot = plot self.reset_coefs() def reset_coefs(self): - self.scalefactor = 0xFFFFFFFF # max uint32_t value + self.scalefactor = 0xFFFFFFFF # max uint32_t value self.lut = np.ones(32, dtype=np.complex64) def train(self, tx_abs, rx_abs, phase_diff): @@ -47,4 +62,3 @@ class Lut: # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. - -- cgit v1.2.3