mirror of
https://github.com/romanz/amodem.git
synced 2026-03-17 15:16:00 +08:00
Created defaultInterpolator to speed up recv().
This commit is contained in:
@@ -59,7 +59,8 @@ def recv(config, src, dst, dump_audio=None, pylab=None):
|
||||
gain = 1.0 / amplitude
|
||||
log.debug('Gain correction: %.3f', gain)
|
||||
|
||||
sampler = sampling.Sampler(signal, sampling.Interpolator(), freq=freq)
|
||||
sampler = sampling.Sampler(signal, sampling.defaultInterpolator,
|
||||
freq=freq)
|
||||
receiver.run(sampler, gain=1.0/amplitude, output=dst)
|
||||
return True
|
||||
except BaseException:
|
||||
|
||||
@@ -30,6 +30,9 @@ class Interpolator(object):
|
||||
assert len(self.filt) == resolution
|
||||
|
||||
|
||||
defaultInterpolator = Interpolator()
|
||||
|
||||
|
||||
class Sampler(object):
|
||||
def __init__(self, src, interp=None, freq=1.0):
|
||||
self.freq = freq
|
||||
|
||||
Reference in New Issue
Block a user