diff options
Diffstat (limited to 'python/dpd')
-rw-r--r-- | python/dpd/Measure.py | 7 | ||||
-rw-r--r-- | python/dpd/RX_Agc.py | 5 |
2 files changed, 6 insertions, 6 deletions
diff --git a/python/dpd/Measure.py b/python/dpd/Measure.py index 36b1888..489c4c0 100644 --- a/python/dpd/Measure.py +++ b/python/dpd/Measure.py @@ -94,14 +94,15 @@ class Measure: def get_samples(self): """Connect to ODR-DabMod, retrieve TX and RX samples, load into numpy arrays, and return a tuple - (txframe_aligned, tx_ts, rxframe_aligned, rx_ts, rx_median) + (txframe_aligned, tx_ts, rxframe_aligned, rx_ts, rx_median, tx_median) """ txframe, tx_ts, rxframe, rx_ts = self.receive_tcp() # Normalize received signal with sent signal rx_median = np.median(np.abs(rxframe)) - rxframe = rxframe / rx_median * np.median(np.abs(txframe)) + tx_median = np.median(np.abs(txframe)) + rxframe = rxframe / rx_median * tx_median du = DU.Dab_Util(self.c, self.samplerate) txframe_aligned, rxframe_aligned = du.subsample_align(txframe, rxframe) @@ -111,7 +112,7 @@ class Measure: % (len(txframe), txframe.dtype, len(rxframe), rxframe.dtype, len(txframe_aligned), txframe_aligned.dtype, len(rxframe_aligned), rxframe_aligned.dtype) ) - return txframe_aligned, tx_ts, rxframe_aligned, rx_ts, rx_median + return txframe_aligned, tx_ts, rxframe_aligned, rx_ts, rx_median, tx_median # The MIT License (MIT) # diff --git a/python/dpd/RX_Agc.py b/python/dpd/RX_Agc.py index 2a2f548..48ef7f3 100644 --- a/python/dpd/RX_Agc.py +++ b/python/dpd/RX_Agc.py @@ -48,7 +48,7 @@ class Agc: self.adapt.set_rxgain(self.rxgain) # Measure - txframe_aligned, tx_ts, rxframe_aligned, rx_ts, rx_median=self.measure.get_samples() + txframe_aligned, tx_ts, rxframe_aligned, rx_ts, rx_median, tx_median = self.measure.get_samples() # Estimate Maximum rx_peak = self.peak_to_median * rx_median @@ -89,8 +89,7 @@ class Agc: axs = axs.ravel() for j in range(5): - txframe_aligned, tx_ts, rxframe_aligned, rx_ts, rx_median =\ - self.measure.get_samples() + txframe_aligned, tx_ts, rxframe_aligned, rx_ts, rx_median, tx_median = self.measure.get_samples() rxframe_aligned_abs = np.abs(rxframe_aligned) |