mirror of
https://github.com/romanz/amodem.git
synced 2026-04-17 11:45:58 +08:00
Fix prefix decoding by scaling signal using prefix amplitude
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user