Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def run_cic1(args, inf, decim, wavdiv, scaleboost, doplot, wavfn = None):
rate = F/decim
newrate = rate / wavdiv
w = openwav(wavfn, newrate) if wavfn else None
play = Player(newrate, INCHUNK)
decoder = cic.cic_n4m2(decim)
if args.bitex:
ins = bitexstream(inf, INCHUNK)
else:
ins = demuxone(inf, INCHUNK, TESTMIC)
for chunk, insamps in enumerate(ins):
first = (chunk == 0)
if first:
print("insamps mean %f rms %f" % (np.mean(insamps), np.mean(insamps**2)**0.5))
print("insamps min %f max %f" % (np.min(insamps), np.max(insamps)))
maxamp = decoder.getmaxamp()
maxbits = np.log2(maxamp)
def decodestream(f, chunk):
decoders = [decimater() for _ in range(NSTREAMS)]
for a in demuxstream(f, chunk):
yield [decode(x) for (decode, x) in zip(decoders, a)]
def decodeone(f, chunk, decim):
decoder = decimater(decim)
for a in demuxstream(f, chunk):
yield decoder(a[NSTREAMS-1-TESTMIC])
def main():
t = Tracks(None, 1000, 0)
n = np.zeros(5)
n[:] = range(5)
t.add(n, 'five')
n = np.zeros(4)
n[:] = range(4)
t.add(n[:5], 'four')
n = np.zeros(6)
n[:] = range(6)
t.add(n, 'six')
print(t.tracks)