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)