def fftsurr(x): """ Compute an FFT phase randomized surrogate of x """ z = fft(x) a = 2.*pi*1j phase = a*rand(len(x)) z = z*exp(phase) return inverse_fft(z).real
def fftsurr(x, detrend=detrend_none, window=window_none): """ Compute an FFT phase randomized surrogate of x """ x = window(detrend(x)) z = fft(x) a = 2.*pi*1j phase = a*rand(len(x)) z = z*exp(phase) return inverse_fft(z).real
def fftsurr(x, detrend=detrend_none, window=window_none): """ Compute an FFT phase randomized surrogate of x """ x = window(detrend(x)) z = fft(x) a = 2. * pi * 1j phase = a * rand(len(x)) z = z * exp(phase) return inverse_fft(z).real