def time_delay_func(x, y): print 'locating ...' c = numpy.correlate(x[:, 0], y[:, 0], "full") C, I = c.max(0), c.argmax(0) out = ((float(len(c))+1.0)/2.0 - I)/44100.0 return out