Core Functions


whiten.whiten(data, Nfft, delta, freqmin, freqmax, plot=False)

This function takes 1-dimensional data timeseries array, goes to frequency domain using fft, whitens the amplitude of the spectrum in frequency domain between freqmin and freqmax and returns the whitened fft.

  • data (numpy.ndarray) – Contains the 1D time series to whiten
  • Nfft (int) – The number of points to compute the FFT
  • delta (float) – The sampling frequency of the data
  • freqmin (float) – The lower frequency bound
  • freqmax (float) – The upper frequency bound
  • plot (bool) – Whether to show a raw plot of the action (default: False)
Return type:



The FFT of the input trace, whitened between the frequency bounds


myCorr.myCorr(data, maxlag, plot=False)

This function takes ndimensional data array, computes the cross-correlation in the frequency domain and returns the cross-correlation function between [-maxlag:maxlag].

  • data (numpy.ndarray) – This array contains the fft of each timeseries to be cross-correlated.
  • maxlag (int) – This number defines the number of samples (N=2*maxlag + 1) of the CCF that will be returned.
Return type:



The cross-correlation function between [-maxlag:maxlag]

Moving-Window Cross-Spectral method

MWCS.mwcs(ccCurrent, ccReference, fmin, fmax, sampRate, tmin, windL, step, plot=False)


  • ccCurrent (numpy.ndarray) – The “Current” timeseries
  • ccReference (numpy.ndarray) – The “Reference” timeseries
  • fmin (float) – The lower frequency bound to compute the dephasing
  • fmax (float) – The higher frequency bound to compute the dephasing
  • sampRate (float) – The sample rate of the input timeseries
  • tmin (float) – The leftmost time lag (used to compute the “time lags array”)
  • windL (float) – The moving window length
  • step (float) – The step to jump for the moving window
  • plot (bool) – If True, plots the MWCS result for each window. Defaults to False
Return type:



[Taxis,deltaT,deltaErr,deltaMcoh]. Taxis contains the central times of the windows. The three other columns contain dt, error and mean coherence for each window.