diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-12-12 10:56:33 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-12-12 10:56:33 +0100 |
commit | f409d342c5a314f4aa35382bbdd8daa3882172d1 (patch) | |
tree | f50821c8e53652030dc6f3baba19b8dc2c320e3d /python/dpd/Measure.py | |
parent | 47242ec7ccbfc60fd14276e102abe119f1766d95 (diff) | |
download | dabmod-f409d342c5a314f4aa35382bbdd8daa3882172d1.tar.gz dabmod-f409d342c5a314f4aa35382bbdd8daa3882172d1.tar.bz2 dabmod-f409d342c5a314f4aa35382bbdd8daa3882172d1.zip |
Improve DPD calibration
Diffstat (limited to 'python/dpd/Measure.py')
-rw-r--r-- | python/dpd/Measure.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/python/dpd/Measure.py b/python/dpd/Measure.py index eb3c199..e5a72c7 100644 --- a/python/dpd/Measure.py +++ b/python/dpd/Measure.py @@ -90,6 +90,26 @@ class Measure: return txframe, tx_ts, rxframe, rx_ts + def get_samples_unaligned(self, short=False): + """Connect to ODR-DabMod, retrieve TX and RX samples, load + into numpy arrays, and return a tuple + (txframe, tx_ts, rxframe, rx_ts, rx_median, tx_median) + """ + + n_samps = int(self.num_samples_to_request / 4) if short else self.num_samples_to_request + txframe, tx_ts, rxframe, rx_ts = self.receive_tcp(n_samps) + + # Normalize received signal with sent signal + rx_median = np.median(np.abs(rxframe)) + tx_median = np.median(np.abs(txframe)) + rxframe = rxframe / rx_median * tx_median + + + logging.info( + "Measurement done, tx %d %s, rx %d %s" % + (len(txframe), txframe.dtype, len(rxframe), rxframe.dtype)) + + return txframe, tx_ts, rxframe, rx_ts, rx_median, tx_median def get_samples(self, short=False): """Connect to ODR-DabMod, retrieve TX and RX samples, load |