From aa0dd2c2c8645903542771f19cba3a59f142193e Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Thu, 15 Jan 2015 18:18:28 +0200 Subject: [PATCH] fix pep8 --- amodem/detect.py | 3 +-- amodem/recv.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/amodem/detect.py b/amodem/detect.py index 5674a7c..978ab68 100644 --- a/amodem/detect.py +++ b/amodem/detect.py @@ -56,8 +56,7 @@ class Detector(object): x = np.concatenate(tuple(bufs)[-self.CARRIER_THRESHOLD:-1]) Hc = dsp.exp_iwt(-self.omega, len(x)) - Zc = np.dot(Hc, x) / (0.5*len(x)) - amplitude = abs(Zc) + amplitude = np.abs(np.dot(Hc, x) / (0.5 * len(x))) start_time = begin * self.Tsym / self.Nsym log.info('Carrier detected at ~%.1f ms @ %.1f kHz:' ' coherence=%.3f%%, amplitude=%.3f', diff --git a/amodem/recv.py b/amodem/recv.py index ea948b6..2fc137f 100644 --- a/amodem/recv.py +++ b/amodem/recv.py @@ -211,9 +211,8 @@ def main(config, src, dst, dump_audio=None, pylab=None): reader = stream.Reader(src, data_type=common.loads) signal = itertools.chain.from_iterable(reader) - to_skip = int(config.skip_start * config.Fs) log.debug('Skipping %.3f seconds', config.skip_start) - common.take(signal, to_skip) + common.take(signal, int(config.skip_start * config.Fs)) pylab = pylab or common.Dummy() detector = detect.Detector(config=config, pylab=pylab)