Python, Cross Correlation, Geophysics, Time Series Analysis, Time Series Data.
compute_shift is simply: def cross_correlation_using_fft(x, y): f1 = fft(x) f2 = fft(np.flipud(y)) cc = np.real(ifft(f1 * f2)) return fftshift(cc) def compute_shift(x, y): assert len(x) == len(y) c = cross_correlation_using_fft(x, y) assert len(c) == len(x) zero_index = int(len(x) / 2) - 1 shift =