Fix prefix decoding by scaling signal using prefix amplitude

This commit is contained in:
Roman Zeyde
2014-08-01 11:38:00 +03:00
parent b8f486dd65
commit 4f0279ccd3
2 changed files with 24 additions and 12 deletions

View File

@@ -43,6 +43,7 @@ class Sampler(object):
self.offset = self.interp.width + 1
self.buff = np.zeros(self.interp.coeff_len)
self.index = 0
self.gain = 1.0
def __iter__(self):
return self
@@ -52,7 +53,7 @@ class Sampler(object):
self.offset += offset
def next(self):
res = self._sample()
res = self._sample() * self.gain
self.offset += self.freq
return res