API Documentation

API reference for the bycyle module.

Cycle-by-cycle

Feature Functions

compute_features(sig, fs, f_range[, …])

Compute shape and burst features for each cycle.

compute_shape_features(sig, fs, f_range[, …])

Compute shape features for each cycle.

compute_burst_features(df_shape_features, sig)

Compute burst features for each cycle.

compute_cyclepoints(sig, fs, f_range, …)

Compute sample indices of cyclepoints.

Group Feature Functions

compute_features_2d(sigs, fs, f_range[, …])

Compute shape and burst features for a 2 dimensional array of signals.

compute_features_3d(sigs, fs, f_range[, …])

Compute shape and burst features for a 3 dimensional array of signals.

Segmentation Functions

find_extrema(sig, fs, f_range[, boundary, …])

Identify peaks and troughs in a time series.

find_zerox(sig, peaks, troughs)

Find zero-crossings within each cycle, from identified peaks and troughs.

Waveform Phase Estimation Functions

extrema_interpolated_phase(sig, peaks, troughs)

Use extrema and (optionally) zero-crossings to estimate instantaneous phase.

Burst Detection Functions

detect_bursts_cycles(df_features[, …])

Detects bursts based on consistency between cycles.

detect_bursts_amp(df_features[, …])

Detect bursts based on amplitude thresholding.

detect_bursts_dual_threshold(sig, *args, …)

Detect bursts in a signal using the dual threshold algorithm.

recompute_edges(df_features, threshold_kwargs)

Recompute the is_burst column for cycles on the edges of bursts.

Plotting Functions

plot_burst_detect_summary(*args, **kwargs)

Plot the cycle-by-cycle burst detection parameters and burst detection summary.

plot_burst_detect_param(*args, **kwargs)

Plot a burst detection parameter and threshold.

plot_cyclepoints_df(*args, **kwargs)

Plot extrema and/or zero-crossings from a DataFrame.

plot_cyclepoints_array(*args, **kwargs)

Plot extrema and/or zero-crossings from arrays.

plot_feature_hist(*args, **kwargs)

Plot a histogram for a cycle feature.

plot_feature_categorical(*args, **kwargs)

Plot a cycle feature by one or more categories.

Utility Functions

limit_signal(times, sig[, start, stop])

Restrict signal and times to be within time limits.

limit_df(df, fs[, start, stop])

Restrict dataframe to be within time limits.

get_extrema_df(df)

Determine whether cycles are peak or trough centered.

rename_extrema_df(center_extrema, df_features)

Rename a dataframe based on the centered extrema.

split_samples_df(df_features)

Move cyclepoints sample indices columns to a separate dataframe.

drop_samples_df(df_features)

Remove cyclepoints sample columns from a dataframe.

epoch_df(df_features, sig_len, epoch_len)

Reshape a dataframe into a list of dataframes.

flatten_dfs(dfs_features, labels[, column_name])

Flatten a list of dataframes into a single dataframe with a group column(s).