mirror of
https://github.com/romanz/amodem.git
synced 2026-03-23 19:01:00 +08:00
add sampling script invocation
This commit is contained in:
13
sampling.py
13
sampling.py
@@ -56,3 +56,16 @@ class Sampler(object):
|
||||
self.buff[:-1] = self.buff[1:]
|
||||
self.buff[-1] = self.src.next() # throws StopIteration
|
||||
self.index += 1
|
||||
|
||||
if __name__ == '__main__':
|
||||
import common
|
||||
import sys
|
||||
df, = sys.argv[1:]
|
||||
df = float(df)
|
||||
|
||||
_, x = common.load(sys.stdin)
|
||||
sampler = Sampler(x, Interpolator())
|
||||
sampler.freq += df
|
||||
y = np.array(list(sampler), )
|
||||
sys.stdout.write( common.dumps(y*1j) )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user