bycycle.utils.get_extrema_df

bycycle.utils.get_extrema_df(df)[source]

Determine whether cycles are peak or trough centered.

Parameters:
dfpandas.DataFrame

Dataframe output of compute_features().

Returns:
center_estr

Center extrema, either ‘peak’ or ‘trough’.

side_estr

Side extrema, either ‘peak’ or ‘trough’.

Examples

Confirm that cycles are peak-centered:

>>> from neurodsp.sim import sim_bursty_oscillation
>>> from bycycle.features import compute_features
>>> fs = 500
>>> sig = sim_bursty_oscillation(10, fs, freq=10)
>>> df_features = compute_features(sig, fs, f_range=(8, 12), center_extrema='peak')
>>> center_e, side_e = get_extrema_df(df_features)
>>> center_e
'peak'