From e6ffca1849a56508245d726185344122bf4f873c Mon Sep 17 00:00:00 2001 From: andreas128 Date: Tue, 29 Aug 2017 10:53:34 +0200 Subject: Add rx_median as return value --- dpd/src/Measure.py | 13 +++---------- 1 file 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) # -- cgit v1.2.3