Skip to main content

features.lf

features.lf(data, fs, bands=None, decay_features=True)

Compute LF features from a numpy array.

Computes the local field potential (LF) features from electrophysiological data including RMS values and power spectral density across different frequency bands.

Args: data (np.ndarray): Data array with shape (channels, samples). fs (float): Sampling frequency in Hz. bands (dict, optional): Dictionary with frequency bands to compute. Defaults to BANDS constant. decay_features (bool, optional): Also fit the PSD decay (aperiodic) features, see get_psd_decay_features. Defaults to True. csd sets it to False for the CSD / BPR traces.

Returns: pd.DataFrame: DataFrame with columns [‘channel’, ‘rms_lf’, ‘psd_delta’, ‘psd_theta’, ‘psd_alpha’, ‘psd_beta’, ‘psd_gamma’, ‘psd_lfp’].

Note: The function computes RMS values and power spectral density for each frequency band defined in the BANDS constant.