diff options
author | andreas128 <Andreas> | 2017-08-18 16:46:56 +0200 |
---|---|---|
committer | andreas128 <Andreas> | 2017-08-18 16:46:56 +0200 |
commit | 4d2def2aba436e3ab706ffef98fa8a1e1dea5634 (patch) | |
tree | 019378e73ccd6f6fb833eb4ea115446b653472d1 /dpd | |
parent | 4f1956a30847f53c1638dfbe02595ad8ce640357 (diff) | |
download | dabmod-4d2def2aba436e3ab706ffef98fa8a1e1dea5634.tar.gz dabmod-4d2def2aba436e3ab706ffef98fa8a1e1dea5634.tar.bz2 dabmod-4d2def2aba436e3ab706ffef98fa8a1e1dea5634.zip |
Add logging for synchronized frames
Diffstat (limited to 'dpd')
-rw-r--r-- | dpd/src/Measure.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/dpd/src/Measure.py b/dpd/src/Measure.py index 2662159..0f90a44 100644 --- a/dpd/src/Measure.py +++ b/dpd/src/Measure.py @@ -110,18 +110,40 @@ class Measure: np.median(np.abs(rxframe)), rxframe_path)) + dt = datetime.datetime.now().isoformat() + tx_rx_frame_path = ('/tmp/tx_rx_sync0_' + dt + '.pdf') + plt.plot(np.abs(rxframe[:128]), label="rxframe") + plt.plot(np.abs(txframe[:128]), label="txframe") + plt.xlabel("Samples") + plt.ylabel("Real Part") + plt.legend() + plt.savefig(tx_rx_frame_path) + plt.clf() + logging.debug("Disconnecting") s.close() du = DU.Dab_Util(self.samplerate) txframe_aligned, rxframe_aligned = du.subsample_align(txframe, rxframe) + if logging.getLogger().getEffectiveLevel() == logging.DEBUG: + tx_rx_frame_path = ('/tmp/tx_rx_sync1_' + + datetime.datetime.now().isoformat() + + '.pdf') + plt.plot(np.abs(rxframe_aligned[:128]), label="rxframe") + plt.plot(np.abs(txframe_aligned[:128]), label="txframe") + plt.xlabel("Samples") + plt.ylabel("Real Part") + plt.legend() + plt.savefig(tx_rx_frame_path) + plt.clf() + logging.info( "Measurement done, tx %d %s, rx %d %s, tx aligned %d %s, rx aligned %d %s" % (len(txframe), txframe.dtype, len(rxframe), rxframe.dtype, len(txframe_aligned), txframe_aligned.dtype, len(rxframe_aligned), rxframe_aligned.dtype) ) - return txframe_aligned, None, rxframe_aligned, None + return txframe_aligned, tx_ts, rxframe_aligned, rx_ts # The MIT License (MIT) # |