fooof.analysis.get_band_peak_fm¶
-
fooof.analysis.
get_band_peak_fm
(fm, band, select_highest=True, threshold=None, thresh_param='PW', attribute='peak_params')[source]¶ Extract peaks from a band of interest from a FOOOF object.
- Parameters
- fmFOOOF
Object to extract peak data from.
- bandtuple of (float, float)
Frequency range for the band of interest. Defined as: (lower_frequency_bound, upper_frequency_bound).
- select_highestbool, optional, default: True
Whether to return single peak (if True) or all peaks within the range found (if False). If True, returns the highest power peak within the search range.
- thresholdfloat
A minimum threshold value to apply.
- thresh_param{‘PW’, ‘BW’}
Which parameter to threshold on. ‘PW’ is power and ‘BW’ is bandwidth.
- attribute{‘peak_params’, ‘gaussian_params’}
Which attribute of peak data to extract data from.
- Returns
- 1d or 2d array
Peak data. Each row is a peak, as [CF, PW, BW].
Examples
Select an alpha peak from an already fit FOOOF object ‘fm’, selecting the highest power alpha:
>>> alpha = get_band_peak_fm(fm, [7, 14], select_highest=True) # doctest:+SKIP
Select beta peaks from a FOOOF object ‘fm’, extracting all peaks in the range:
>>> betas = get_band_peak_fm(fm, [13, 30], select_highest=False) # doctest:+SKIP