nigsp.operations.timeseries.median_cutoff_frequency_idx

nigsp.operations.timeseries.median_cutoff_frequency_idx(energy)[source]

Find the frequency that splits the energy of a timeseries in two roughly equal parts.

Parameters:
energynumpy.ndarray

The array representing the energy (power) spectral density of a timeseries. this array can be 1D or 2D - if 2D it’s assumed that the second dimension represents subjects.

Returns:
int

The index of the frequency that splits the spectral power into two (more or less) equal parts.

Raises:
NotImplementedError

If the provided array is 3D or more.