diff options
Diffstat (limited to 'dpd/src')
-rw-r--r-- | dpd/src/Const.py | 16 | ||||
-rw-r--r-- | dpd/src/ExtractStatistic.py | 6 | ||||
-rw-r--r-- | dpd/src/Heuristics.py | 4 | ||||
-rw-r--r-- | dpd/src/TX_Agc.py | 2 | ||||
-rw-r--r-- | dpd/src/Test_data.py | 2 |
5 files changed, 14 insertions, 16 deletions
diff --git a/dpd/src/Const.py b/dpd/src/Const.py index bf46796..ebdfeb2 100644 --- a/dpd/src/Const.py +++ b/dpd/src/Const.py @@ -6,9 +6,8 @@ import numpy as np class Const: - def __init__(self, sample_rate, target_median, n_bins, n_per_bin, n_meas): + def __init__(self, sample_rate, target_median, plot): self.sample_rate = sample_rate - self.n_meas = n_meas self.tx_gain_max = 89 @@ -41,11 +40,11 @@ class Const: self.phase_offset_per_sample = 1. / sample_rate * 2 * np.pi * 1000 # Constants for ExtractStatistic - self.ES_plot = False + self.ES_plot = plot self.ES_start = 0.0 self.ES_end = 1.0 - self.ES_n_bins = n_bins - self.ES_n_per_bin = n_per_bin + self.ES_n_bins = 64 + self.ES_n_per_bin = 128 # Constants for TX_Agc self.TAGC_max_txgain = 89 @@ -53,22 +52,21 @@ class Const: self.TAGC_tx_median_max = self.TAGC_tx_median_target*1.4 self.TAGC_tx_median_min = self.TAGC_tx_median_target/1.4 - self.RAGC_min_rxgain = 25 self.RAGC_rx_median_target = self.TAGC_tx_median_target # Constants for Model - self.MDL_plot = True + self.MDL_plot = True or plot # Override default # Constants for MER - self.MER_plot = False + self.MER_plot = plot # Constants for Model_PM self.MPM_tx_min = 0.1 # Constants for Measure_Shoulder self.MS_enable = False - self.MS_plot = False + self.MS_plot = plot assert sample_rate==8192000 meas_offset = 976 # Offset from center frequency to measure shoulder [kHz] meas_width = 100 # Size of frequency delta to measure shoulder [kHz] diff --git a/dpd/src/ExtractStatistic.py b/dpd/src/ExtractStatistic.py index bf9eba5..9df85bc 100644 --- a/dpd/src/ExtractStatistic.py +++ b/dpd/src/ExtractStatistic.py @@ -126,7 +126,8 @@ class ExtractStatistic: def _rx_value_per_bin(self): rx_values = [] for values in self.rx_values_lists: - rx_values.append(np.mean(np.abs(values))) + mean = np.mean(np.abs(values)) if len(values) > 0 else np.nan + rx_values.append(mean) return rx_values def _tx_value_per_bin(self): @@ -147,7 +148,8 @@ class ExtractStatistic: def _phase_diff_value_per_bin(self, phase_diffs_values_lists): phase_list = [] for values in phase_diffs_values_lists: - phase_list.append(np.mean(values)) + mean = np.mean(values) if len(values) > 0 else np.nan + phase_list.append(mean) return phase_list def extract(self, tx_dpd, rx): diff --git a/dpd/src/Heuristics.py b/dpd/src/Heuristics.py index 467c5da..a32ccff 100644 --- a/dpd/src/Heuristics.py +++ b/dpd/src/Heuristics.py @@ -10,7 +10,7 @@ import numpy as np def get_learning_rate(idx_run): idx_max = 10.0 lr_min = 0.05 - lr_max = 1 + lr_max = 0.4 lr_delta = lr_max - lr_min idx_run = min(idx_run, idx_max) learning_rate = lr_max - lr_delta * idx_run/idx_max @@ -24,5 +24,3 @@ def get_n_meas(idx_run): idx_run = min(idx_run, idx_max) learning_rate = n_meas_delta * idx_run/idx_max + n_meas_min return int(np.round(learning_rate)) - - diff --git a/dpd/src/TX_Agc.py b/dpd/src/TX_Agc.py index 7b74c8f..2602ea6 100644 --- a/dpd/src/TX_Agc.py +++ b/dpd/src/TX_Agc.py @@ -90,7 +90,7 @@ class TX_Agc: # Set new values. # Avoid temorary increase of output power with correct order - if digital_gain_factor < 0: + if digital_gain_factor < 1: self.adapt.set_digital_gain(digital_gain) time.sleep(0.5) txgain = self._set_tx_gain(new_txgain) diff --git a/dpd/src/Test_data.py b/dpd/src/Test_data.py index 67f4dff..bbef282 100644 --- a/dpd/src/Test_data.py +++ b/dpd/src/Test_data.py @@ -40,7 +40,7 @@ class Test_data: plt.plot(np.angle(np.fft.fftshift(np.fft.fft(tx_orig))), 'p') """ - self.c = src.Const.Const(sample_rate) + self.c = src.Const.Const(sample_rate,, False self.du = src.Dab_Util.Dab_Util(sample_rate) self.file_paths = { |