From 30d138dcbce022545eebf065cb107ddca0447a50 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Tue, 19 Aug 2014 17:52:56 +0300 Subject: [PATCH] dsp: stop Demux iteration if samples are over --- amodem/dsp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/amodem/dsp.py b/amodem/dsp.py index 17de93c..b6b11b9 100644 --- a/amodem/dsp.py +++ b/amodem/dsp.py @@ -121,7 +121,10 @@ class Demux(object): def next(self): frame = self.sampler.take(size=Nsym) - return np.dot(self.filters, frame) + if len(frame) == Nsym: + return np.dot(self.filters, frame) + else: + raise StopIteration __next__ = next