add sampling script invocation

This commit is contained in:
Roman Zeyde
2014-07-04 19:01:23 +03:00
parent 5e30d47f78
commit b49954a7e1

View File

@@ -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) )