summaryrefslogtreecommitdiffstats
path: root/dpd/src/Measure.py
diff options
context:
space:
mode:
authorandreas128 <Andreas>2017-08-29 10:53:34 +0200
committerandreas128 <Andreas>2017-08-29 10:53:34 +0200
commite6ffca1849a56508245d726185344122bf4f873c (patch)
tree68d826c1df1075a13f5f84dfcb9c27528539e8ab /dpd/src/Measure.py
parentb4d9d53c39f5ac6160f84505c76c10949e0f21c3 (diff)
downloaddabmod-e6ffca1849a56508245d726185344122bf4f873c.tar.gz
dabmod-e6ffca1849a56508245d726185344122bf4f873c.tar.bz2
dabmod-e6ffca1849a56508245d726185344122bf4f873c.zip
Add rx_median as return value
Diffstat (limited to 'dpd/src/Measure.py')
-rw-r--r--dpd/src/Measure.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/dpd/src/Measure.py b/dpd/src/Measure.py
index ef9e290..e4fa8a2 100644
--- a/dpd/src/Measure.py
+++ b/dpd/src/Measure.py
@@ -4,16 +4,8 @@ import sys
import socket
import struct
import numpy as np
-import matplotlib
-matplotlib.use('agg')
-import matplotlib.pyplot as plt
-from matplotlib.animation import FuncAnimation
-import argparse
-import os
-import time
import logging
import src.Dab_Util as DU
-import datetime
class Measure:
"""Collect Measurement from DabMod"""
@@ -81,7 +73,8 @@ class Measure:
rxframe = np.array([], dtype=np.complex64)
# Normalize received signal with sent signal
- rxframe = rxframe / np.median(np.abs(rxframe)) * np.median(np.abs(txframe))
+ rx_median = np.median(np.abs(rxframe))
+ rxframe = rxframe / rx_median * np.median(np.abs(txframe))
if logging.getLogger().getEffectiveLevel() == logging.DEBUG:
logging.debug("txframe: min %f, max %f, median %f" %
@@ -105,7 +98,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
+ return txframe_aligned, tx_ts, rxframe_aligned, rx_ts, rx_median
# The MIT License (MIT)
#