aboutsummaryrefslogtreecommitdiffstats
path: root/dpd
diff options
context:
space:
mode:
authorandreas128 <Andreas>2017-09-23 19:16:57 +0200
committerandreas128 <Andreas>2017-09-23 19:16:57 +0200
commit1bcb57fb4ff8bda9fcab9be48bceff5f91f5826b (patch)
tree1ea3f6ab9a219177a53d42618a1cc4162fd2f0a8 /dpd
parentfb27264d4dda6dde7e67338305cd84ac0122e58d (diff)
downloaddabmod-1bcb57fb4ff8bda9fcab9be48bceff5f91f5826b.tar.gz
dabmod-1bcb57fb4ff8bda9fcab9be48bceff5f91f5826b.tar.bz2
dabmod-1bcb57fb4ff8bda9fcab9be48bceff5f91f5826b.zip
Change return to shoulderdiff, peak, shoulder
Diffstat (limited to 'dpd')
-rw-r--r--dpd/src/Measure_Shoulders.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/dpd/src/Measure_Shoulders.py b/dpd/src/Measure_Shoulders.py
index 6b1c7fe..7a165c4 100644
--- a/dpd/src/Measure_Shoulders.py
+++ b/dpd/src/Measure_Shoulders.py
@@ -52,13 +52,13 @@ def calc_shoulder(fft, c):
peak = _calc_peak(fft, c)[0]
shoulder = _calc_shoulder_hight(fft, c)[0]
assert (peak >= shoulder), (peak, shoulder)
- return peak - shoulder
+ return peak, shoulder
def shoulder_from_sig_offset(arg):
signal, offset, c = arg
fft_db = calc_fft_db(signal, offset, c)
- shoulder = calc_shoulder(fft_db, c)
- return shoulder
+ peak, shoulder = calc_shoulder(fft_db, c)
+ return peak-shoulder, peak, shoulder
class Measure_Shoulder:
@@ -117,14 +117,13 @@ class Measure_Shoulder:
)
pool = multiprocessing.Pool(self.c.MS_n_proc)
- shoulders = pool.map(shoulder_from_sig_offset, args)
-
- shoulder = np.mean(shoulders)
+ res = pool.map(shoulder_from_sig_offset, args)
+ shoulders_diff, shoulders, peaks = zip(*res)
if logging.getLogger().getEffectiveLevel() == logging.DEBUG and self.plot:
self._plot(signal)
- return shoulder
+ return np.mean(shoulders_diff), np.mean(shoulders), np.mean(peaks)
# The MIT License (MIT)