neurodsp.burst.detect_bursts_dual_threshold¶
- neurodsp.burst.detect_bursts_dual_threshold(sig, fs, dual_thresh, f_range=None, min_n_cycles=3, min_burst_duration=None, avg_type='median', magnitude_type='amplitude', **filter_kwargs)[source]¶
Detect bursts in a signal using the dual threshold algorithm.
- Parameters
- sig1d array
Time series.
- fsfloat
Sampling rate, in Hz.
- dual_threshtuple of (float, float)
Low and high threshold values for burst detection. Units are normalized by the average signal magnitude.
- f_rangetuple of (float, float), optional
Frequency range, to filter signal to, before running burst detection. If f_range is None, then no filtering is applied prior to running burst detection.
- min_n_cyclesfloat, optional, default: 3
Minimum burst duration in to keep. Only used if f_range is defined, and is used as the number of cycles at f_range[0].
- min_burst_durationfloat, optional, default: None
Minimum length of a burst, in seconds. Must be defined if not filtering. Only used if f_range is not defined, or if min_n_cycles is set to None.
- avg_type{‘median’, ‘mean’}, optional
Averaging method to use to normalize the magnitude that is used for thresholding.
- magnitude_type{‘amplitude’, ‘power’}, optional
Metric of magnitude used for thresholding.
- **filter_kwargs
Keyword parameters to pass to filter_signal.
- Returns
- is_burst1d array
Boolean indication of where bursts are present in the input signal. True indicates that a burst was detected at that sample, otherwise False.
Notes
The dual-threshold burst detection algorithm was originally proposed in [1].
References
- 1
Feingold, J., Gibson, D. J., DePasquale, B., & Graybiel, A. M. (2015). Bursts of beta oscillation differentiate postperformance activity in the striatum and motor cortex of monkeys performing movement tasks. Proceedings of the National Academy of Sciences, 112(44), 13687–13692. DOI: https://doi.org/10.1073/pnas.1517629112
Examples
Detect bursts using the dual threshold algorithm:
>>> from neurodsp.sim import sim_combined >>> sig = sim_combined(n_seconds=10, fs=500, ... components={'sim_synaptic_current': {}, ... 'sim_bursty_oscillation' : {'freq': 10}}, ... component_variances=[0.1, 0.9]) >>> is_burst = detect_bursts_dual_threshold(sig, fs=500, dual_thresh=(1, 2), f_range=(8, 12))