from pylab import * def rect(a): R = [] for r in a: if abs(r) < 0.5: R.append(float64(1)) else: R.append(float64(0)) R = array(R) return R