sort_noise

seas.signalanalysis.sort_noise(timecourses: Optional[numpy.ndarray] = None, lag1: Optional[numpy.ndarray] = None, return_logpdf: bool = False, method: str = 'KDE', verbose: bool = False)Tuple[numpy.ndarray, int, numpy.ndarray][source]

Sorts timecourses into two clusters (signal and noise) based on lag-1 autocorrelation.

Parameters
  • timecourses – Input to calculate noise threshold. Should be a np array of shape (n, t).

  • lag1 – Required if the timecourses are not provided. alternate input to calculate noise threshold. Should be a np array of shape (n, t).

  • return_logpdf – Whether to return the KDE log density function.

  • method – The method to calculate the cutoff. Currently only KDE is supported.

  • verbose – Whether to record a verbose output.

Returns

noise_components, a np array with a value of 1 where all noise

timecourses detected. as well as the cutoff value detected.

cutoff: The cutoff index, anything above this value is considered to be noise. log_pdf: Returned only if return_logpdf is True.

The pdf function evaluated between -0.2 and 1.2.