def showTransfer(**kwargs): xVals = linspace(0, dur, sr*dur) #data = sin(xVals* linspace(0, sampr*2, sampr*dur)) data = random.normal(size=sr*dur) data2 = NiDAQ.lowpass(data, **kwargs) pw.plot(y=data, x=xVals, clear=True) pw.plot(y=data2, x=xVals, pen=mkPen((255, 0, 0)))
def run(ds): pw.plot(data, clear=True) for m, c in zip(methods, colors): d1 = data.copy() t = time.clock() d2 = NiDAQ.downsample(d1, ds, method=m) print "Method %d: %f" % (i, time.clock()-t) p = pw.plot(y=d2, x=linspace(0, len(d2)*ds, len(d2)), pen=mkPen(c)) p.setZValue(10000)
def showDownsample(**kwargs): d1 = data.copy() d2 = NiDAQ.downsample(d1, **kwargs) xv2 = xVals[::kwargs['ds']][:len(d2)] pw.plot(y=d1, x=xVals, clear=True) pw.plot(y=d2[:len(xv2)], x=xv2, pen=mkPen((255, 0, 0)))