Abstract
Background:
Cognitive processes are associated with fast oscillations of the local field potential and electroencephalogram. There is a growing interest in targeting them because these are disrupted by aging and disease. This has proven challenging because they often occur as short-lasting bursts. Moreover, they are obscured by broad-band aperiodic activity reflecting other neural processes. These attributes have made it exceedingly difficult to develop analytical tools for estimating the reliability of detection methods.
New Method:
To address this challenge, we developed an open-source toolkit with four processing steps, that can be tailored to specific brain states and individuals. First, the power spectrum is decomposed into periodic and aperiodic components, each of whose properties are estimated. Second, the properties of the transient oscillatory bursts that contribute to the periodic component are derived and optimized to account for contamination from the aperiodic component. Third, using the burst properties and aperiodic power spectrum, surrogate neural signals are synthesized that match the observed signal’s spectrotemporal properties. Lastly, oscillatory burst detection algorithms run on the surrogate signals are subjected to a receiver operating characteristic analysis, providing insight into their performance.
Results:
The characterization algorithm extracted features of oscillatory bursts across multiple frequency bands and brain regions, allowing for recording-specific evaluation of detection performance. For our dataset, the optimal detection threshold for gamma bursts was found to be lower than the one commonly used.
Comparison with Existing Methods:
Existing methods characterize the power spectrum, while ours evaluates the detection of oscillatory bursts.
Conclusions:
This pipeline facilitates the evaluation of thresholds for detection algorithms from individual recordings.
Keywords: Signal detection, ROC, oscillations, local field potential, electroencephalogram
Introduction
The importance of neural oscillations in brain function, and their disruption by disease, has been apparent for some time [1]. They are thought to coordinate the activities of large ensembles of neurons, allowing them to act either in a concerted [2] or segregated manner [3], and in turn facilitate inter-regional communication [4]. Crucial to understanding the role of oscillations is our ability to detect them.
The starting point is to calculate the power spectral density (PSD) of the local field potential (LFP) or electroencephalogram (EEG). The PSD can be decomposed into two prominent components. The first is a -shaped decrease in the PSD with increasing frequency, sometimes termed ‘noise’ or, recently, as the ‘aperiodic’ component of the LFP [5]. The second is narrowband increases in power at specific frequency bands that ride atop the , representing either persistent or transient oscillations in the LFP. Decades of animal and human research has revealed that these narrowband increases occur consistently in largely specific frequency bands. These canonical bands are termed delta (1-4 Hz), theta (4-8 Hz), alpha (8-12 Hz), beta (12-30 Hz), gamma (30-90 Hz), and ripple (150-300 Hz).
Most high frequency oscillations (>20 Hz) in the brain seemingly occur as brief bursts. Beta and gamma oscillatory bursts typically last for less than 200 ms and have been implicated in top-down and bottom-up cortical information exchange, respectively [6; 7]. Whether the generators of these rhythms are continuous or discrete remains unclear. Gamma and beta can arise from recurrent interactions within local networks of excitatory and inhibitory neurons, and this mechanism shows a nonlinear dependence on the strength of afferent drive or noise levels in the inhibitory population [8] suggesting that bursts are discrete. Moreover, modeling work has found that bursts offer attractive computational properties and in vivo data are consistent with the predictions of these models [6]. On the other hand, the statistical properties of oscillatory bursts in the LFP are also consistent with filtered noise, suggesting that they are the peaks of a continuous process [9; 10]. Nevertheless, since our ability to link these transient oscillations to behavioral phenomena hinges on our ability to detect them, accuracy in their detection is crucial.
High frequency oscillatory bursts also tend to vary in their properties, affecting their function. For instance, the frequency of individual cycles in a gamma burst can vary over a wide range and be influenced by the level of excitability on the previous cycle [11]. This variability prevents their use as a global clock signal [9], but is conducive to dynamically coordinating networks with covarying activity [4; 12]. Burst properties also impact behavior. Longer duration bursts of ripple oscillations in the CA1 region of the hippocampus have been implicated in memory formation [13]. Bidirectional control of beta oscillations revealed that their amplitude impacts locomotion in parkinsonian rats [14]. Moreover, the distribution of burst properties can be meaningful. There has been a growing interest in the prevalence of lognormal distributions across many levels of brain organization, from synapse sizes to the frequencies of neural oscillators [15].
To characterize or act upon (in the case of closed-loop applications) an oscillatory burst, it first must be detected. This usually entails setting a power threshold for a specific frequency band [16; 17]. This choice is fraught with uncertainties. The LFP contains activities at other frequencies that bleed into the range of interest. In addition, the omnipresent aperiodic component necessarily encompasses the frequencies of interest [5]. These additional signals could produce false detections. To counteract this, one may set the detection threshold higher, but that may cause one to miss true bursts [18]. Estimating the occurrence of these errors is crucial if one wants an accurate estimate of how often such bursts occur, and to set a detection threshold in a data-driven manner.
At present, there are no readily available tools that can evaluate oscillatory burst detection algorithms on realistic LFPs. Specifically, we mean a tool that characterizes the spectral and time-domain properties of oscillatory bursts, uses this information to synthesize synthetic LFPs, and uses that synthetic signal to evaluate the performance of a burst detection algorithm. However, advances have been made in the specific stages that comprise such an approach. Take for instance the identification of oscillatory components in the LFP and their detection. Algorithms such as FOOOF can parameterize the periodic (oscillatory) and aperiodic (background) components of LFP and EEG power spectra [5]. However, the spectral profile of the periodic component is fitted to a gaussian, which may not provide an adequate fit. In addition, this approach does not attempt to characterize the properties of bursts in the time domain signal that contribute to the periodic component. Or consider the detection side, where the aperiodic component is accounted for at each time step, facilitating the isolation of oscillatory bursts [19]. Validation of this approach was performed on simulated data that was derived from the parameterization of observed LFP power spectra, and thus lacked information about the properties of oscillatory bursts in the time domain.
There has been growing interest in detecting transient oscillatory bursts in LFP signals [20; 21]. However, the efficacy of detection schemes on in vivo-like LFPs, especially those closely resembling the recordings to be studied, remains under-explored. To address this, we developed two algorithms. The first decomposes the power spectrum of the LFP into oscillatory and background (i.e., aperiodic) activity components. This decomposition allows us to then characterize in the time domain the distribution of oscillatory burst amplitudes, frequencies, and durations. This information, in turn, allows us to synthesize artificial LFPs, i.e., ground truth. The second algorithm then applies a user-designed detection algorithm to the ground truth and estimates a detection threshold that maximizes sensitivity and specificity. These utilities are packaged into a toolkit that can be used by experimenters to determine the efficacy of their burst detection schemes for a particular brain region.
Materials and Methods:
Here we describe the algorithms. For further mathematical details or how to use the software toolkit please consult the manual in supplementary material. All in vivo rodent data used to validate the algorithms (hosted at the links provided) were collected at the Rutgers University following IRB guidelines; IACUC protocol number is PROTO202000145; IBC protocol number is 12-209.
The characterization and synthesis algorithm
We propose a two-part algorithm that first decomposes and characterizes the LFP’s signal and background components (Fig. 1A, red), and then uses their properties to produce a synthetic LFP (Fig. 1A, yellow). The first part of the algorithm separates the PSD of an observed LFP into signal and background components. The background component in an LFP exhibits a characteristic in the frequency domain with the exponent β that characterizes the ‘color’ in type signals [15]. A robust frequency restricted deviation from this is the signal component, comprised of oscillatory bursts whose properties are derived from a filtered version of the observed LFP. In the second part of the algorithm (Fig. 1A, yellow), attributes of the background and oscillatory bursts are used to generate synthetic burst (signal) and background traces. The synthetic background and signal components are then combined to form a synthetic LFP whose PSD will match the PSD of the LFP. This ‘ground-truth’ signal can then be used to evaluate the performance of an oscillatory burst detection algorithm using receiver operating characteristic (ROC) analysis (Fig. 1A, green).
Figure 1:

Overview of analytical framework. (A) Flow chart of the calculations performed to determine oscillatory burst properties and generate synthetic LFP signals. Major stages of the analytical pipeline grouped by color coded borders. (B) Example PSD recorded in BLA with prominent gamma oscillatory bump. Fit to is red dashed line. Blue dashed line is predicted over oscillatory frequency range. Green dashed line captures the signal frequency range of the oscillatory power over the dB threshold from . (C) From the same recording used in B, upper plot is the raw LFP trace with gamma bursts interleaved with other activities. Below is the same trace filtered in the gamma band. Periods with salient power are shaded in red. (D) Distribution of gamma burst properties from the recording in D. (E) Demonstration of the necessity for optimizing the burst amplitude peak distribution. Using the observed distribution (red line), there is an overabundance of low amplitude peaks in the synthetic LFP. Following optimization of the amplitude distribution, blue line, the synthetic distribution now matches that observed in the original LFP.
Separating background and oscillatory signal components.
We estimate the LFP (1kHz sampling rate) PSD using Welch’s method with a Hamming window of size N=8192 and 50% overlap between windows. The PSD is then smoothed using a moving average filter with a 2 Hz sliding rectangular window (Fig. 1B). The smoothed PSD is then fit by a straight line in log-log scale ln α – β ln f to obtain a fit of the background component using an algorithm which requires two preselected settings: a signal frequency band, e.g., 30-100 Hz for gamma oscillation, and a dB threshold (0.95 dB was used for our datasets). Two versions of this algorithm are provided. Version-1 requires manual specification of the frequency range for fitting, while version-2 determines this range automatically (see supplemental figure S1 and table S1). In the pre-processing part of both versions, the sample points for fitting are chosen and evenly-spaced to the extent possible in log scale to avoid bias toward high frequency samples. Version-1 then iteratively fits the samples using least squares, and finds the upward outliers with error above the dB threshold (above the green line in Fig. 1B). Of these, the target outliers, defined as the segments of outliers which overlap with the signal frequency band, are removed from the sample points for fitting in the next iteration, and the process continued until no target outliers remain. Details for version-2 are in supplemental figure S1. After either version of the fit algorithm, the signal frequency range is determined by the range of the target outliers (range of the green line denoting ‘signal frequency range’ in Fig. 1B). Random fluctuations in the PSD curve with respect to the fit necessitate specification of the dB threshold for robust determination of the signal frequency range. Deviations from the fitted background in the signal frequency range reflect the putative oscillatory signal component.
Characterizing oscillatory bursts.
The observed LFP is bandpass filtered by a zero-phase 6-th order Butterworth filter with cutoff frequencies corresponding to the boundaries of the signal frequency range obtained from the PSD (Fig. 1C). Taking the magnitude of the analytic signal (obtained by MATLAB’s hilbert function) yields an amplitude time series. To extract the properties of oscillatory bursts, periods when the amplitude exceeded 2 Z-score were deemed significant. These periods were used to obtain the following attributes. Amplitude peak is defined as the peak value of the amplitude of a burst. The burst duration is defined as a continuous period when the amplitude stays above 25% of the amplitude peak. Burst main frequency is defined as the frequency at which the maximum peak occurs in the discrete Fourier transform (DFT) magnitude of a burst within the signal frequency range. A 4096-point DFT of a burst under 1000 Hz sampling rate is obtained from the raw LFP within the burst duration using a Tukey window of the same size as the duration. Zero padding is used if the duration is shorter than the length of DFT and the duration is truncated if the opposite. The number of cycles is defined as the duration multiplied by the burst main frequency. When the durations of two bursts overlap, the one with lower amplitude peak is omitted. A burst is also omitted when there is no peak in its DFT magnitude within the signal frequency range. The empirical distributions of number of cycles per burst and burst main frequency are obtained during significant periods (Fig. 1D). To obtain the distribution of amplitude peaks, all peaks in the amplitude time series were included. We found this provided a better bound for the scheme used to optimize the distribution parameters later. The correlation coefficients between the three attributes in logarithm scale of the bursts in significant periods were also obtained.
Generating a synthetic LFP.
In the second part of the algorithm, the synthetic signal and background components of the LFP are generated (Fig. 1A, yellow). These are then summed to form a synthetic LFP whose PSD matches that of the observed LFP.
Synthetic background component.
The synthetic background is generated by passing Gaussian white noise through a Type I linear phase FIR filter (MATLAB’s fir2 function) whose frequency-magnitude characteristics matched the background PSD by linearly interpolating the desired frequency response onto a dense grid and then using the inverse Fourier transform and a Hamming window to obtain the filter coefficients. The length of the FIR filter is selected to achieve a frequency resolution of 1 Hz. The output is then scaled to match the background power in the frequency range between the two points where the smoothed PSD curve and fit intersect (blue line ‘fit background component’ in Fig. 1B).
Synthetic signal component.
We generate individual bursts as Gabor atoms [22] for the i-th atom (sinusoids modulated by Gaussian envelopes) and add them up to form the synthetic signal . The variables Ai Fi, and denote the amplitude peak, main frequency, phase, and peak time of each atom, respectively. The width parameter of the Gaussian envelope determines the burst atom duration and depends on the number of cycles Ci and the burst main frequency, and is a constant such that which follows the definition of burst duration cutoff at 25% amplitude peak for characterization of the observed bursts. The attribute triplet of each Gabor atom is generated in two steps. First, use the empirical correlation coefficient matrix (in log-scale) of the observed burst attributes to generate a three-dimensional Gaussian copula [23]. This is performed in two steps. First, sample from a three-dimensional normal distribution with the given covariance matrix, and then transform the samples using the cumulative distribution function on each component, whose underlying marginal distribution is uniform on the interval [0,1]. Second, transform the random samples from the Gaussian copula to those following a joint distribution with the desired marginal distributions, by applying the inverse cumulative probability function on each component. Empirical distributions are used for the marginal distributions of cycle number and burst frequency, while the marginal for amplitude peak has a parametric form, typically a gamma distribution, with probability density function where is the gamma function. Since individual bursts are assumed to occur independently of each other and of the background, they are added to the background trace with independently and uniformly distributed on with being the total duration of the synthetic signal to be generated. The phase ’s are also assumed to independently follow a uniform distribution. Our empirical checks indicate that the signal amplitude and phase are independent, and the phase at amplitude peak was found to follow uniform distribution, i.e., without preference. Bursts are accumulated until the total power equals that in the signal portion of the observed LFP PSD. This can be verified by calculating the sum of individual burst energy. The energy of each individual burst can be calculated as where Ri is the proportion of energy remaining after bandpass filtered in the signal frequency range . Since the Fourier transform magnitude of a Gabor atom is a Gaussian function, we can estimate it by
where and is the error function. Then the condition for matching the signal power is where is the smoothed PSD of the observed LFP and is the fitted background PSD.
The resulting trace is then filtered in the signal frequency range and termed the synthetic (1compositej signal. However, this synthetic signal is biased because the amplitude peak distribution of the observed LFP is influenced by the background, which contains an overabundance of small amplitude peaks. When these bursts are generated in the synthetic trace, together with the background trace, they skew the amplitude peak distribution to the low end (Fig. 1E, red).
To address this problem, we optimize the match between the synthetic composite and observed amplitude peak distributions. Specifically, we optimize the parameters for the amplitude peaks distribution used to generate synthetic burst atoms so that the synthetic composite amplitude peak distribution matches the observed. Formally, we define the synthetic burst atom amplitude distribution parameters as independent variables and the Kullback–Leibler divergence measure DKL [24] between the observed and synthetic composite amplitude peak distributions as the cost. Optimization is performed using the particle swarm algorithm [25]. Bounds of the parameters for the optimization are set to some multiples (0.2 for the lower bound and 3 for the upper bound) of the parameters estimated from the observed amplitude peak distribution. To avoid multiple solutions that may exist due to degrees of freedom in the background distribution, we assume that the background trace follows a Gaussian distribution.
The detection algorithm – Using the synthetic ground truth to evaluate the ROC of oscillatory burst detection
The purpose of the characterization algorithm was to generate a synthetic LFP that matched the features of the observed LFP. Consequently, the synthetic LFP can serve as a ground truth for evaluating the detection of oscillatory bursts using ROC analysis [26]. The detection problem has two parts. The first is to use the characteristics of the synthetic background and signal traces to determine appropriate limits for the classification of salient oscillatory bursts in the synthetic composite LFP. With this ‘ground truth,’ the second task is to determine the optimal detection threshold using ROC analysis.
Detection of salient burst peaks in the synthetic signal trace.
Since the synthesis algorithm provides separate background and signal traces, these can be used to generate ground truth data for evaluating the detection of salient oscillatory burst peaks in the composite trace. By salient, we are referring to oscillatory events in the synthetic signal trace whose amplitude deviates from the synthetic background trace by some predefined degree.
One may wonder why salient oscillatory events must be defined, given that the synthetic signal trace was constructed using burst atoms with known peak times and amplitudes. At first glance, just knowing these burst times should provide sufficient information for determining whether an oscillatory burst was present or not. However, the synthetic signal trace often contains many overlapping low amplitude burst atoms, obscuring their peak in the signal trace. Due to such overlap, every burst will not have its own distinct amplitude peak in the synthetic signal trace. This arises from the fact that at any given time t, the signal trace can be modeled as where each is a burst atom with amplitude peak Ai. If all Ai’s are small and there is significant overlap at n, x(n) will approach a Gaussian distribution (by the central limit theorem), with constructive and destructive interference of the burst amplitude peaks. To address this, we define a low amplitude bound, , in the synthetic signal trace below which bursts are not distinguishable from background.
If the signal trace is composed of sparsely distributed high amplitude bursts, then it may be desirable to define a high amplitude bound, θU, to specifically detect these events. Consider the case where there is one burst atom having a large amplitude Ak. We should be able to detect the amplitude of the k-th atom, even in the presence of other atoms . Extending this idea, in general, if we use a high amplitude bound in the signal trace to define the true burst activity, the occurrence of the burst atoms with significant amplitude peaks higher than will be sparse.
Selection of the lower bound θL in the synthetic signal trace.
Oscillatory bursts in the signal trace with expected instantaneous power lower than the average background power are difficult to distinguish, highlighting the need to define a lower bound (Fig. 2A). The average power in the background trace with standard deviation is . Equating the expectation of instantaneous power in the signal trace to average background power leads to the value of the bound as , as follows:
Figure 2:

Illustration of oscillatory burst detection criteria and subsequent ROC analyses. (A) The low threshold boundary, θL, is determined using the synthetic background. Peaks above that threshold, a red dashed line, are denoted with red triangles, while those below have blue triangles. (B) Periods of salient oscillatory bursts are calculated using the synthetic signal trace. Those below are shaded in blue, while those above an upper threshold, , are shaded in yellow. (C) Using the composite trace, a threshold is set, here 1 Z-score, and amplitude peaks are labeled as True or False Positives based on the scoring in B. (D) Probability of peaks being True, False, or Intermediate varies as a function of amplitude and is probabilistic, with overlapping distributions. (E) Varying the detection threshold systematically allows construction of an ROC curve and determination of the optimal detection threshold using Youden’s Index.
Denote the analytic signal of the signal trace as , where is the Hilbert transform of the signal trace x and j is the imaginary unit. Since the phase , is independent of amplitude Ai for burst atoms, the phase and the amplitude of the analytic signal are uncorrelated, so the real part x(n) and the imaginary part follow identical distributions. Then, if the amplitude is given, the conditional expectation of amplitude over random phase is , where is the expectation of the instantaneous power. If , then . The analytic signal amplitude of the background trace follows the Rayleigh distribution with parameter . The probability of the background amplitude below is 0.632. Or, equivalently, the background trace is below for 63.2% of the total duration. Consequently, only bursts in the signal trace with amplitude above are defined as salient.
Selection of an upper bound in the synthetic signal trace.
An additional, more stringent, threshold can be used for defining salient bursts. Two approaches are proposed for the selection of the upper bound for amplitude peaks in the synthetic signal trace (Fig. 2B). The first determines using a data-driven criterion. In the first approach, the value of is set so that the average power of the signal trace with amplitude below equals the power of the signal component within the signal frequency range below the dB threshold in the PSD. We divided the power in the time domain using in the synthetic signal (Fig. 2B) and in frequency domain in the PSD of the observed data (Fig. 1B), hypothesizing that the period below contributes to the power below the dB threshold in the PSD which is within the fluctuation level. If this value of , it is set to . To account for a small random error between the total power of the synthetic signal trace and the corresponding total power in the signal component in the PSD of the observed data, instead of equating the powers, we equate the proportion of powers for a better estimate of , as follows:
where is the is the period when the amplitude is below (formal definition of TL, TU, TI is in the next section). is the number of time points in the period, M is the number of discrete time points over the duration T of the synthetic data, H is the frequency response of the bandpass filter and r is the dB threshold. The left-hand side is the ratio of the power in period to the total power in the synthetic signal trace. The right-hand side is ratio of the power above the background and below the dB threshold (the area between the blue and green lines in Fig. 1B), to the total power in the signal component in the PSD of the observed data. The magnitude response is used to correct the effect of power reduction by the filter. Only the numerator on the left-hand side depends on , which is found by searching over the cumulative sum of sorted .
A second approach uses an expected rate of occurrence of oscillatory burst events in the observed data. This rate can be represented either as a burst rate (in Hz) in either the signal or the composite trace, or as the percent time spent in a burst state. The algorithm will then pick a that results in the expected rate of oscillatory bursts.
When using the bounds and , bursts can be categorized as follows for developing an ROC: bursts above (salient), bursts below (insignificant), and intermediate bursts, which will be ignored in the ROC analysis.
Identifying true and false peaks in the synthetic composite signal.
Based on the specification of upper and lower bounds in the synthetic signal trace, we propose an approach to define true and false peaks as follows (Fig. 2C). The discrete time points are partitioned into three subsets , and . The set TL denotes the period when the signal trace amplitude is below and TU the period when the amplitude is above · The remaining period is TI with I denoting ‘intermediate’.
Consider now the synthetic composite trace obtained by adding the background trace to the signal trace. A peak in the synthetic composite signal can be classified as either true, false, or intermediate, depending on whether it is detected within the TU, TL or TI time periods, respectively (Fig. 2C). Since these periods are defined with respect to the signal trace, but the amplitudes are evaluated on the composite trace, the distribution of amplitudes labeled as salient, insignificant, and intermediate will overlap (Fig. 2D). Then, peaks above or below the detection threshold are labeled positive, or negative, respectively. From this, ROC curves for the detection of bursts can be calculated.
ROC analysis of burst detection threshold.
By systematically varying the detection threshold, it is possible to optimize the detection of oscillatory bursts using ROC analysis. In general, ROC analysis systematically varies the detection threshold while tracking the rate of True Positives (TP) and False Positives (FP, Fig. 2E). When detection is random, the TP rate (TPR) equals the FP rate (FPR), while an optimal detection threshold maximizes TP and minimizes FP. Here TPR = TP/(TP+FN) and FPR = FP/(TN+FP). Specific to the current task, detection of oscillatory bursts can be carried out in two ways. One is to detect their peak times, which is appropriate for offline analysis of pre-recorded LFP data. The second is to detect moments of elevated instantaneous power in the burst frequency range, which is useful for real-time processing applications where the burst peak is ambiguous. Both ways determine whether a detected event is a TP or FP by whether it occurs within the time periods TU or TL, which are determined by θL and θU in the synthetic signal trace. In addition, the ground truth with labeled time periods allows ROC analysis for other detection methods not subject to only the two approaches we proposed.
Detection of salient oscillatory peaks:
In the first approach, only amplitude peaks in the synthetic composite trace are identified, and are detected if they exceed the detection threshold.
Detection of salient oscillatory burst periods:
In the second approach, instantaneous amplitude at every time sample point in the synthetic composite trace is compared with the detection threshold, i.e., time periods are identified, contrasting with the detection of only peaks, as in approach 1.
Criteria for optimal burst detection thresholds:
Once the ROC curve is calculated, a criterion is used to determine the optimal detection threshold. One wants to maximize the TP rate (TPR), while minimizing the FP rate (FPR). The Youden index J = TPR-FPR, identifies this by finding the point where the ROC curve maximally deviates from chance, that is where TPR=FPR (Fig. 2E).
Automated open-source toolkit for analysis of in vivo LFP records
We developed an open-source MATLAB toolkit graphical user interface that implements the characterization, synthesis, and detection algorithms. The toolkit, together with a detailed user’s manual and video, is available for download [27]. All analytical steps mentioned above are provided. In addition, the user can override default parameters and explore other analysis schemes. More specifically, the user can use FOOOF algorithm for PSD decomposition as the first step in the characterization and synthesis algorithm. In the detection algorithm, the user can export the synthetic data and the labeled time periods for use in alternative burst detection algorithms, and import their output for our ROC analysis step. Each step is performed in a user-guided sequence, culminating in the determination of an optimal burst detection threshold.
Results
We first report comparison with other algorithms and then illustrate the application of the two algorithms to the characterization and detection of oscillatory bursts. Evaluating characterization is important insomuch as it is necessary for the synthesis step used in measuring the performance of a detection scheme.
Comparison with other algorithms. As mentioned in the Introduction, Donoghue et al. [5] report a different method to fit the ‘background’ component of the signal which the authors term the ‘aperiodic’ component. Their algorithm, titled FOOOF, fits the aperiodic component with either a straight line or a nonlinear curve with a knee (Fig. S2). It then fits the signal part of the PSD with a mixture of Gaussians, with the overall objective of finding the powers of various oscillatory peaks in the PSD. Albeit using a different approach and with minor differences, the FOOOF method compares well with our method in decomposing the PSD (Fig. S2). For that reason, our tool incorporates the FOOOF algorithm as an alternative for realizing the decomposition of the PSD. After decomposing the PSD, our algorithm characterizes the attributes of the bursts within a local frequency band of interest (e.g., beta, gamma) and generates ground truth and determine optimal thresholds in the ROC for the detection of oscillatory bursts in that band. Our algorithm is designed for automation. Since burst detection technique per se is not the focus of our paper, we did not compare our method with other burst detections algorithms such as fBOSC (10.1111/ejn.15829) and SPRiNT (10.7554/eLife.77348). However, the synthetic burst data that our algorithm generates can serve as a testbed for the design of burst detection schemes.
Three datasets were used to illustrate our algorithms. Dataset-1 is a 4-hour recording (8x8 silicon probe array) of LFP from the rat basolateral amygdala (BLA) with prominent gamma oscillations(hosted at [27]); Datatset-2 contains LFP recordings (microwire implant) from the BLA across multiple behaving rats(hosted at [27]); and Dataset-3 is a 6-hour LFP recording from BLA and dorsal hippocampus of a rat provided by the Buzsaki Lab [28]. The codes associated with the analyses for all the example cases can also be found with our open-source software toolkit freely available for download [27].
Characterization of oscillatory bursts.
To demonstrate the performance and insights gained by the characterization and synthesis algorithms, we applied them to Dataset-1 and Dataset-3.
Characterizing BLA gamma of a single subject.
The BLA LFP power spectrum in Dataset-1 exhibits a prominent bump in the gamma frequency range (Fig. 3A). Typical of LFPs recorded throughout the brain, a characteristic curve was evident, which appears as a straight line on a log-log plot. The exponent β in the fit was 2.73, which is comparable to other reports [29; 30]. As the PSD deviates at the low and high frequency ends of the fit, the best frequency range for the fit was automatically found to be from 9.9-211.3 Hz. The frequency range of the that separates the background and signal was 46.0 to 113.9 Hz. Using 0.95 dB threshold, the gamma signal frequency range was determined to be 53.0 to 102.7 Hz. Integrating over the gamma frequency range for the curve gives the background power in the gamma band as 302.6 μV2. Subtracting this value from the integrated power of the observed PSD in the gamma band yields 519.3 μV2.
Figure 3:

Demonstration of characterization and synthesis of a BLA LFP with a prominent bump (same example as seen in Figure 1B). (A). PSD with overlaid curves demonstrating the fitting of the and determination of the frequency range for the oscillatory bump in the gamma band. (B) Time domain signals illustrating the raw LFP (upper), bursts in the gamma band (middle), and their difference that captures some aspects of the synthetic background (bottom). (C) Distribution of burst properties. Empirical distribution is blue bars, while curve fits are overlaid in red. (D) Time domain plots of the synthetic BLA LFP. (E) The synthetic composite LFP (light blue line), closely matches the observed (black line). The synthetic background (red line) shows no contribution from the oscillatory bump in the gamma band.
Once the gamma frequency range was established, the observed LFP could be filtered in that band and gamma bursts detected (Fig. 3B). Burst frequency and cycle number were fit by lognormal distributions, while amplitude peaks were best captured by a gamma distribution (Fig. 3C). The preponderance of log-normal distributions was not surprising given their ubiquity in neural systems [15]. These fits revealed that on average salient gamma bursts had an amplitude of 44.2 μV, lasted for 7.0 cycles, and had a frequency of 69.5 Hz (Table 1). Moreover, these properties were not correlated across bursts, suggesting that they are independent of one another. This lack of relationship at the burst level contrasts with the well-established within burst cycle-to-cycle correlation in amplitude and frequency [11].
Table 1.
Characterization of amplitude peak, cycle number and burst frequency distributions using in vivo LFP data for the gamma (top) and ripple (bottom) cases.
| Amplitude peak distribution | ||||
|---|---|---|---|---|
| Distribution type | Parameters | Initial fit | Optimized | KL divergence, DKL |
| Gamma | Shape k | 4.15 | 0.44 | 0.0014 |
| Scale 0 (μV) | 10.6 | 12.7 | ||
| Cycle number and burst frequency distributions | ||||
| Distribution type | Parameters | Cycle number | Burst frequency (Hz) | |
| Log-normal | Mean | 7.03 | 69.5 | |
| Mean (log scale) | 1.82 | 4.23 | ||
| S.D. (log scale) | 0.510 | 0.105 | ||
| Correlation coefficients | ||||
| Amplitude peak / Cycle number | Amplitude peak / Burst frequency | Cycle number / Burst frequency | ||
| 0.004 | 0.060 | −0.010 | ||
| Amplitude peak distribution | ||||
| Distribution type | Parameters | Initial fit | Optimized | KL divergence, DKL |
| Gamma | Shape k | 1.98 | 0.42 | 0.0088 |
| Scale 0 (μV) | 8.85 | 26.4 | ||
| Cycle number and burst frequency distributions | ||||
| Distribution type | Parameters | Cycle number | Burst frequency (Hz) | |
| Log-normal | Mean | 7.12 | 146.0 | |
| Mean (log scale) | 1.89 | 4.97 | ||
| S.D. (log scale) | 0.384 | 0.105 | ||
| Correlation coefficients | ||||
| Amplitude peak / Cycle number | Amplitude peak / Burst frequency | Cycle number / Burst frequency | ||
| 0.0042 | 0.0072 | 0.0093 | ||
Having obtained estimates of the burst property distributions, we generated synthetic traces (Fig. 3D). Since the synthetic LFP background is isolated from the gamma signal, we optimized the amplitude peak distribution to account for the contribution of the background. This resulted in a synthetic signal trace that when added to the synthetic background trace mimicked the observed LFP PSD (Fig. 3E).
After applying the same method for detecting in vivo bursts to the synthetic LFP, the detection rates for burst amplitude peaks are close to those of the in vivo LFP (Table 2). The characterized burst property distributions of the synthetic LFP are also close to those of the in vivo LFP (Fig. 1E, Fig. S3).
Table 2.
Generation of synthetic LFP. Comparison of in vivo and synthetic LFP characteristics
| Properties\LFP Type | In vivo gamma | Synthetic LFP | In vivo ripple | Synthetic LFP |
|---|---|---|---|---|
| Total duration (seconds) | 14588 | 5000 | 6835 | 5000 |
| Detection threshold (μV) (Z-score) | 74.45 (2.00) | 74.45 (2.03) | 41.7 (2.00) | 41.7 (2.00) |
| Background power (μV2) | 302.6 | 301.0 | 130.7 | 32.3 |
| Signal power (μV2) | 519.3 | 517.1 | 73.1 | 169.8 |
| Signal noise ratio | 1.72 (2.35dB) | 1.72 (2.35dB) | 0.559 (−2.53dB) | 5.26 (7.21dB) |
| Amplitude peak rate (Hz) | 26.37 | 25.86 | 36.50 | 32.34 |
| Amplitude peaks above threshold (Hz) | 2.28 (100%) | 2.18 (100%) | 2.02 (100%) | 2.11 (100%) |
| Valid burst rate (Hz) | 1.78 (78.75%) | 1.71 (78.66%) | 1.49 (73.78%) | 1.77 (84.06%) |
| Reduction due to overlap (Hz) | 0.48 (20.99%) | 0.46 (20.95%) | 0.49 (24.32%) | 0.33 (15.71%) |
| Reduction due to freq. out of range (Hz) | 0.01 (0.64%) | 0.01 (0.39%) | 0.04 (1.90%) | 0.01 (0.24%) |
Characterizing hippocampal sharp wave ripples of a single subject.
The exponent β of the hippocampal LFP in the fit was 1.83, with a best fit range of 23.3-462.7 Hz (Fig. 4A). The frequency range of the that separates background and signal was 108.5 to 210.6 Hz. Using 0.95 dB threshold, the ripple signal frequency range was determined to be 120.8 to 180.4 Hz. The background power in the ripple band is 130.7 μV2, with ripple bump having a power of 73.1 μV2.
Figure 4:

Characterization and synthesis of hippocampal LFP with a bump in the ripple band. The same organization as Figure 3 is repeated here. (A) Power spectral density of observed LFP with fits. (B) Time domain plots of raw and ripple filtered LFP. (C) Distribution of ripple burst properties. (D) Time domain plots of synthetic hippocampal LFP. (E) Synthetic power spectral density fit overlaid on observed.
Filtering in the ripple band revealed that bursts occurred sparsely (Fig. 4B). On average, significant ripple bursts had an amplitude peak of 17.6 μV, lasted for 7.1 cycles, and had a frequency of 146 Hz (Fig. 4C, Table 1). Like gamma, these properties were not correlated across bursts. The synthetic signal and power spectrum were similar to the observed (Fig. 4D, E).
Gamma burst characteristics vary across subjects in the same brain state.
We characterized gamma bursts in the BLA for seven subjects during quiet waking from DataSet-2 (Table 3). They exhibited variation in their power spectrum and gamma bump. For instance, the gamma bump bandwidth varied from 16 Hz (subject-4) to 68 Hz (subject-2) and the exponent varied from 2.22 to 2.9. By taking the ratio of power in the gamma frequency range to that predicted by the fit, we could estimate the signal to noise ratio (SNR) of excess power in the gamma band. This varied from −5.49 to 1.33 dB. Note that a negative SNR in decibels means that the power under the oscillatory component is lower than that in the background. It does not mean there is no segment above the dB threshold in the PSD. The dB threshold we used for our examples was 0.95 dB, which corresponds to 1.24 times the power of the background. That means a minimum power in the oscillatory component of only 0.24 times the background power (corresponding to −6.1 dB SNR) is required to detect that segment in the PSD.
Table 3.
Characterization of individual variability among 7 subjects in DataSet-2 during quiet waking.
| Properties\Subjects | BLA 1 | BLA 2 | BLA 3 | BLA 4 | BLA 5 | BLA 6 | BLA 7 |
|---|---|---|---|---|---|---|---|
| Total duration (second) | 2978 | 5353 | 5530 | 3979 | 6425 | 10746 | 7578 |
| Frequency range (Hz) | 52.1.116.0 | 34.8.102.7 | 46.0.87.4 | 53.1.69.0 | 46.1.94.8 | 50.9.82.3 | 51.0.87.6 |
| Pink noise exponent | 2.65 | 2.9 | 2.65 | 2.28 | 2.3 | 2.22 | 2.42 |
| Signal noise ratio (dB) | 1.29 | −0.16 | −1.07 | −5.49 | 1.33 | −3.3 | −3.85 |
| Total amplitude peak rate (Hz) | 34.9 | 36.4 | 23.6 | 10.1 | 28 | 18.9 | 22.1 |
| Mean amplitude peak (μV) | 60.9 | 71.1 | 38.2 | 16.3 | 13.7 | 23.5 | 23.4 |
| Gamma fit (k, θ) | 4.3.14.0 | 4.0.17.7 | 4.0.9.6 | 4.2.3.9 | 3.5.4.0 | 4.4.5.3 | 4.4.5.4 |
| Lognormal fit (mean, S.D.) | 4.0.0.5 | 4.1.0.5 | 3.5.0.5 | 2.7.0.5 | 2.5.0.6 | 3.0.0.5 | 3.0.0.5 |
| Mean cycle number | 5.2 | 3.6 | 5.8 | 12.6 | 7.2 | 7.1 | 6.2 |
| Lognormal fit (mean, S.D.) | 1.5.0.5 | 1.1.0.6 | 1.6.0.5 | 2.4.0.5 | 1.8.0.5 | 1.8.0.5 | 1.7.0.5 |
| Mean burst frequency (Hz) | 72.1 | 56.6 | 59.8 | 60.2 | 64.7 | 62.4 | 64.4 |
| Lognormal fit (mean, S.D.) | 4.3.0.1 | 4.0.0.3 | 4.1.0.1 | 4.1.0.1 | 4.1.0.2 | 4.1.0.1 | 4.1.0.1 |
| Optimal threshold (Z) | 0.61 | 0.73 | 0.9 | 1.75 | 0.69 | 1.01 | 1.32 |
Algorithms generalize to other frequency bands.
The algorithms can be used to quantify oscillatory bursts in other frequency bands and brain regions. To explore this, we apply them to recordings from the BLA and hippocampus with oscillatory bursts at beta, gamma, and ripple frequencies, one band at a time. Recordings from Dataset-3 hosted by the Buzsaki Lab [28] contained multiple oscillatory bumps across different frequency bands in LFP recordings from a specific rodent (#8) during various states. Specifically, in rodent #8 we analyzed the LFP from channels #17 located in the dorsal hippocampus (dHPC), and channels #79 and #95 located in the BLA. The PSD plots of the LFPs exhibited significant bumps at multiple frequency bands including beta, gamma, and ripple, revealing the presence of oscillatory bursts in those bands (Fig. 5). The characterization and detection schemes enabled successful characterization across these distinct frequency bands (Table 4), demonstrating the flexibility of our approach.
Figure 5:

Detection of oscillatory bumps in non-gamma frequency bands. (A) Detection of a broad oscillatory bump in the ripple band. (B) Power spectral densities with multiple oscillatory bumps can be analyzed with our algorithm. In this case, the oscillatory bump in the beta band is analyzed separately from the one in the adjoining gamma band.
Table 4.
Characterization using DataSet-3 (Buzsaki et al.). Sleep states are given by the labels in the dataset. Channels #17 is located in the hippocampus (dHPC). Channels #79 and #95 are located in the amvsdala.
| Properties Channel & State | Ch.17, Wake | Ch.79, Wake | Ch.79, Wake | Ch.95, Wake | Ch.95, Wake |
|---|---|---|---|---|---|
| Oscillation type | SPW-R | Beta | Gamma | Beta | Gamma |
| Total duration (second) | 6835 | 13434 | 13434 | 13434 | 13434 |
| Frequency range (Hz) | 120.8,180.4 | 15.0,23.3 | 42.6,95.0 | 15.6,19.9 | 29.8,90.0 |
| Pink noise exponent | 1.83 | 1.24 | 1.97 | 0.47 | 1.84 |
| Signal noise ratio (dB) | 5.72 | −3.15 | −1.26 | −4.97 | 2.27 |
| Total amplitude peak rate (Hz) | 36.5 | 5.2 | 31.3 | 3.3 | 32.4 |
| Mean amplitude peak (μV) | 17.6 | 46.3 | 47.2 | 22 | 52.9 |
| Gamma fit (k, θ) | 2.0,8.9 | 3.2,14.4 | 4.0,11.8 | 2.3,9.4 | 3.3,16.0 |
| Lognormal fit (mean, S.D.) | 2.6,0.7 | 3.7,0.6 | 3.7,0.5 | 2.9,0.8 | 3.8,0.6 |
| Mean cycle number | 7.1 | 6.7 | 5.9 | 11.4 | 5.8 |
| Lognormal fit (mean, S.D.) | 1.9,0.4 | 1.8,0.4 | 1.6,0.6 | 2.3,0.4 | 1.5,0.7 |
| Mean burst frequency (Hz) | 146 | 18.5 | 57.4 | 17.7 | 48.5 |
| Lognormal fit (mean, S.D.) | 5.0,0.1 | 2.9,0.1 | 4.0,0.2 | 2.9,0.1 | 3.9,0.1 |
| Optimal threshold (Z) | 1.78 | 2.09 | 0.96 | 3.96 | 0.51 |
Gamma burst amplitude distribution is fitted equally well by multiple parametric curves.
Throughout this study, we use the gamma distribution for generating burst amplitude peaks, but other distributions were tried. Using the BLA gamma LFP across multiple subjects (Dataset 2), we examined how the type of analytical distribution affected fit quality. Optimizing burst amplitude peak distributions with exponential or lognormal forms (instead of gamma) provided similar fits for the distributions (ANOVA on DKL, F(2,18)=0.38, p=0.69) and similar match for the gamma signal bump in the PSD). The fact that multiple forms of synthetic burst amplitude peak distributions perform equally well suggests that the number of burst atoms and their amplitude peak distribution cannot be determined uniquely from gamma power expressed in the PSD.
Detection of oscillatory bursts
We now demonstrate the synthesis algorithm and ROC analysis to evaluate oscillatory burst detection. We use the data already presented in Figure 2 as our example.
Detection of gamma bursts in the BLA.
The BLA recording from a subject in DataSet-1 was used to demonstrate the algorithm for evaluating the detection of oscillatory bursts in the LFP. Figure 2 shows the three key synthetic traces generated from this data set: background trace (Fig. 2A), signal trace (Fig. 2B), and the composite trace formed by combining them (Fig. 2C). For determination of salient bursts in the signal trace, the lower bound, θL, was 23.6μV, while for illustrative purposes the upper bound, θU, was set to 42.7μV (Fig. 2B; 2 Z-score of background instantaneous amplitude). Using a 1 Z-score detection threshold on the composite trace captured most of the TP peaks, but also some FP peaks (Fig. 2C). Peaks classified as true, false, and intermediate could overlap in their amplitude, but with a greater proportion of false peaks having a low amplitude, true peaks a high amplitude, and intermediate peaks in between (Fig. 2D). This plot highlights the probabilistic nature of classification. ROC analysis uncovered that the optimal detection threshold yielded over 80% TP and less than 20% FP for both burst amplitude peaks and instantaneous amplitude (Fig. 2E).
Comparing optimal detection thresholds for BLA gamma across subjects.
Next, we compared optimal detection thresholds for gamma bursts across subjects. All subjects showed ROC curves that deviated substantially from chance performance across a range of Z-score detection thresholds (Fig. 6). It is common for studies to use a 2 Z-score threshold, so we evaluated where these fell on the ROC curve and the corresponding true and false positive rates. While the false positive rate was quite low, with all subjects less than 10%, the true positive rate varied over a large range, from 20 to 80%. More than half of the subjects had a true positive rate less than 45%, meaning more than half the salient gamma bursts were missed, suggesting that the 2 Z-score criterion may be overly conservative. To optimize the detection threshold, we used Youden’s index, which maximizes the true positive rate and minimizes the false positive rate. For all subjects it suggested a Z-score threshold that was less than 2, varying from 0.61 to 1.75. This more permissive threshold did increase the false positive rate, which now ranged between 9 and 25%. But it substantially increased the true positive rate, which exceeded 65% in all subjects. Thus, a common cutoff for detecting salient gamma bursts is overly restrictive and individually tailored, lower Z-score thresholds should be used.
Figure 6:

ROC curves for gamma detection from the recordings in Dataset 1. Each solid-colored line is the ROC curve from a different subject. These substantially deviate from the black dashed chance detection line. The point on the ROC curve corresponding to a 2 Z-score threshold of gamma burst detection is indicated with a solid-colored circle. The corresponding True Positive and False Positive values associated with these points are projected onto the axes with blue hash marks. The point on the ROC curve corresponding to the maximum Youden’s Index is plotted as a hollow diamond. Their True Positives and False Positives are denoted with red hash marks.
Discussion
The detection of oscillatory bursts in the LFP and EEG is fundamental to the study of neural systems and the development of future therapies. Here we considered characterization and detection as related problems, using a constructive approach. First, we outline a data-driven methodology to estimate the distribution of burst properties such that a synthetic LFP is generated with a power spectrum that mimics the one observed experimentally. Second, the synthetic LFP serves as a ‘ground-truth’ signal for the detection of salient oscillatory bursts. This allows us to construct an ROC for the detection of bursts and optimize detection power and specificity. The algorithms and software are bundled into an open-source toolkit that is available for public download [27].
Novel algorithms to generate ground truth and ROC for detection of LFP bursts.
We propose a methodology that first decomposes the LFP power spectrum into oscillatory and background components. Donoghue et al. [5] reported a scheme titled FOOOF to separate the background and signal components along similar lines. Their goal was to estimate parameters of the background and signal (referred to in their study as aperiodic and periodic, respectively) components of the PSD, and correlate those with task conditions or pathologies. To isolate the background and signal, they performed an initial fit on the PSD, fit several gaussian curves to the residual, and then subtract those gaussians from the original PSD and refit the . An advantage of this approach over the one proposed here is that by fitting several gaussians, multiple signal components at different frequencies could be detected. On the other hand, ours fits only a single frequency component within a user determined range. However, our approach does not assume a particular parametric curve for the signal component, instead estimating an empirical distribution of power vs. frequency. This accounts for skewness and other deviations from gaussian. While a mixture of gaussians could be used to approximate a single non-gaussian bump in the PSD, FOOOF does not exploit this.
Another approach separates the background and signal components by coarse-graining to model the PSD as the sum of a scale-free/fractal component and a harmonic/oscillatory component, respectively [31]. This approach considers the entire frequency range and can be used to identify multiple oscillatory bands, but it does not identify the properties of each of these oscillatory bands, while our approach does.
Neither of these approaches characterizes oscillatory bursts or considers the synthesis problem. Once the signal frequency range is obtained, we filter the observed LFP and measure the distributions of oscillatory burst properties. Our first algorithm uses these to create a synthetic LFP trace with statistical properties that match those of the original LFP recording. In addition, the generation of the synthetic LFP can be used as part of an optimization scheme to refine the distributions of the burst characteristics (including correlated properties). The by-product of our constructive approach is a ground truth signal to guide the selection of an optimal detection threshold for oscillatory bursts, the latter being the focus of our second algorithm.
An approach to setting a detection threshold can be found in signal detection theory [18], which is concerned with balancing the number of true and false positives. This entails a tradeoff, whereby one accepts an increase in the rate of false positives to avoid an overabundance of false negatives. One can surely minimize false positives by setting the threshold higher, but that comes at the expense of decreased sensitivity. In many cases this is undesirable, such as a medical test for a life-threatening, but treatable, condition. ROC analysis provides a widely accepted approach to balance these tradeoffs, and we have implemented that as part of our analysis. It is up to the experimenter to decide whether the threshold provided by the ROC analysis, which jointly maximizes sensitivity and specificity, makes sense for their system or goals. Fortunately, the ROC curve returned by our toolbox provides a guide for them to address this issue in a rigorous manner.
Individual variability.
The characterization algorithm helps us better measure the properties of oscillatory bursts, which is important for evaluating the performance of a detection algorithm on specific individuals or brain states. In particular, we get distributions of burst amplitude, frequency, and bandwidth. We found variability in these across individuals for gamma in the BLA. Mean frequency of gamma bursts varied from 57 to 72 Hz, and the bandwidth of gamma ranged from 16 to 68 Hz. These individual differences are not entirely surprising. Indeed, there is a strong non-additive genetic component that influences the expression of gamma. This was examined in a study of monozygotic (identical) and dizygotic (fraternal) twins [32]. It was found that visually evoked gamma oscillations were virtually identical for monozygotic twins, but not so for dizygotic. Given that both sets of twins had the same parents and upbringing, it was suggested that a strong synergistic genetic component determined the properties of gamma. Similar results were obtained with other EEG rhythms [33].
Since gamma has been associated with numerous cognitive processes, this variability may be behaviorally important, [4]. One such process is perceptual binding, where spatially distributed visual features must be integrated to perceive a unitary visual object [34]. Mooney faces, solid black and white images of faces, are stimuli that tap into this ability [35]. Patients with schizophrenia have difficulty recognizing these faces, and this is correlated with diminished gamma oscillations [36]. Moreover, artificially increasing or decreasing gamma power bidirectionally affects memory processing [37].
Besides power and amplitude, variations in oscillatory burst frequency and duration are also important. The frequency of an oscillatory burst is associated with different information processing regimes. Oscillatory bursts in the gamma and beta frequency ranges are induced during distinct phases of a working memory task, with gamma bursts reflecting stimulus encoding and updating, while beta are associated with an idling state [6]. The duration of oscillatory bursts also matters. During quiet resting states and sleep, hippocampal CA1 emits high frequency oscillatory bursts (~150 Hz), known as ripples [38] that are enhanced during cortical communication [39]. Disrupting them experimentally impairs memory consolidation [40]. Importantly, longer duration ripple bursts are associated with memory formation and artificially lengthening them improved spatial working memory [13].
Variability in oscillatory bursts may affect their detection. The ROC analyses revealed just that, with substantial inter-subject variability in the optimal detection threshold. Typically, a consistent threshold is used across subjects (e.g., [6; 16]), or one is chosen based on criteria not tied to the underlying signal properties [37]. Those strategies are suboptimal, given our results. To rectify this, our approach generates simulated LFPs that have the same PSD and oscillatory burst properties as the targeted subject. This provides a ground truth dataset for evaluating the performance of different detection thresholds on the rate of true and false positives. Plotting these on an ROC curve, the ideal threshold is the point that minimizes the false positive rate while maximizing the true positive rate. We found that the optimal Z-score threshold for detecting gamma bursts in the BLA during quiet waking varied from 0.61 to 1.75 across subjects. Notably, this range is below the typical threshold of 2 Z-score, indicating that conventional detection levels were overly conservative and prone to false negatives in our dataset.
Limitation.
Stationarity of the background component is an assumption required for our algorithms. Selection of time periods in the observed data should consider the variation in the component over different brain states.
The observed amplitude peak distribution being more skewed to the right is indicative of a high fraction of low-amplitude peaks. In such cases, the match between the observed and synthetic amplitude peak distributions appears to be not as good after the DKL optimization converges. This happens in the ripple case, but not the gamma or beta cases which do not have high skewness. However, the PSD plots between the observed and synthetic LFP showed a very good match for the ripple case, as for the other frequency bands. Future research could explore what factors may explain the mismatch between the observed and synthetic amplitude distributions. Such factors, perhaps also interacting with each other, could include the low burst rate seemingly associated with high skewness of the amplitude distribution, overestimation of the background power, and the assumption of Gaussian distributed noise in the generation of the background component.
Conclusion.
Oscillatory rhythms have been observed since the earliest electrophysiological recordings. Their association with neural function and impairment in disease is well established. While there is an extensive literature on the processing of oscillatory signals, few studies have determined how to optimally detect them within a traditional signal detection framework. This study fills this gap, providing an open-source toolkit for characterizing oscillatory signals embedded in noise, synthesizing surrogate data for evaluation of detection algorithms, and offering ROC analysis of simple threshold detection schemes. Arising from this approach are important theoretical questions that can be tackled in future studies. For instance, can detection thresholds be derived purely from the properties (e.g., skewness) of the derived signal component and the PSD? This would simplify the real-time updating of algorithms to track oscillatory bursts, which may be important for closed-loop applications [37].
Supplementary Material
Highlights.
Two algorithms facilitate individualized evaluation of oscillatory burst detection schemes
The first parameterizes the LFP for synthesizing a ground truth LFP
The second uses the ground truth to evaluate detection methods using ROC analysis
Found that in our dataset with gamma bursts the optimal detection threshold is lower than what is commonly used
Algorithm pipeline packaged as an open-source Matlab toolbox
Acknowledgements
This work is in part supported by NINDS grant NS123396 to DBH, NIMH grant MH119854 to DP, and NIMH grant MH122023 to SSN.
Abbreviations
- BLA
Basolateral amygdala
- dHPC
dorsal hippocampus
- DFT
discrete Fourier transform
- EEG
electroencephalogram
- LFP
local field potential
- PSD
power spectral density
- ROC
receiver operating characteristic
Footnotes
Publisher's Disclaimer: This is a PDF file of an unedited manuscript that has been accepted for publication. As a service to our customers we are providing this early version of the manuscript. The manuscript will undergo copyediting, typesetting, and review of the resulting proof before it is published in its final form. Please note that during the production process errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain.
Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
REFERENCES
- 1.Voytek B, Knight RT (2015) Dynamic network communication as a unifying neural basis for cognition, development, aging, and disease, Biol Psychiatry 77, 1089–1097. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 2.Headley DB, Weinberger NM (2013) Fear conditioning enhances gamma oscillations and their entrainment of neurons representing the conditioned stimulus, J Neurosci 33, 5705–5717. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3.Zheng C, Bieri KW, Hsiao YT, Colgin LL (2016) Spatial sequence coding differs during slow and fast gamma rhythms in the hippocampus, Neuron 89, 398–408. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4.Fries P (2015) Rhythms for cognition: Communication through coherence, Neuron 88, 220–235. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Donoghue T, Haller M, Peterson EJ, Varma P, Sebastian P, Gao R, Noto T, Lara AH, Wallis JD, Knight RT, Shestyuk A, Voytek B (2020) Parameterizing neural power spectra into periodic and aperiodic components, Nat Neurosci 23, 1655–1665. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6.Lundqvist M, Rose J, Herman P, Brincat Scott L, Buschman Timothy J, Miller Earl K (2016) Gamma and beta bursts underlie working memory, Neuron 90, 152–164. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Lundqvist M, Herman P, Warden MR, Brincat SL, Miller EK (2018) Gamma and beta bursts during working memory readout suggest roles in its volitional control, Nat Commun 9, 394. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 8.Borgers C, Talei Franzesi G, LeBeau FEN, Boyden ES, Kopell NJ (2012) Minimal size of cell assemblies coordinated by gamma oscillations, PLoS Comput Biol 8, e1002362. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 9.Burns SP, Xing D, Shapley RM (2011) Is gamma-band activity in the local field potential of v1 cortex a “clock” or filtered noise?, J Neurosci 31, 9658–9664. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10.Spyropoulos G, Saponati M, Dowdall JR, Schölvinck ML, Bosman CA, Lima B, Peter A, Onorato I, Klon-Lipok J, Roese R, Neuenschwander S, Fries P, Vinck M (2022) Spontaneous variability in gamma dynamics described by a damped harmonic oscillator driven by noise, Nat Commun 13, 2019. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 11.Atallah BV, Scanziani M (2009) Instantaneous modulation of gamma oscillation frequency by balancing excitation with inhibition, Neuron 62, 566–577. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 12.Nikolić D, Fries P, Singer W (2013) Gamma oscillations: Precise temporal coordination without a metronome, Trends Cogn Sci 17, 54–55. [DOI] [PubMed] [Google Scholar]
- 13.Fernández-Ruiz A, Oliva A, Fermino de Oliveira E, Rocha-Almeida F, Tingley D, Buzsaki G (2019) Long-duration hippocampal sharp wave ripples improve memory, Science 364, 1082–1086. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 14.McNamara CG, Rothwell M, Sharott A (2022) Stable, interactive modulation of neuronal oscillations produced through brain-machine equilibrium, Cell Rep 41, 111616. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.Buzsaki G, Mizuseki K (2014) The log-dynamic brain: How skewed distributions affect network operations, Nat Rev Neurosci 15, 264–278. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16.Amir A, Headley DB, Lee SC, Haufler D, Pare D (2018) Vigilance-associated gamma oscillations coordinate the ensemble activity of basolateral amygdala neurons, Neuron 97, 656–669.e657. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.Colgin LL, Denninger T, Fyhn M, Halting T, Bonnevie T, Jensen O, Moser MB, Moser EI (2009) Frequency of gamma oscillations routes flow of information in the hippocampus, Nature 462, 353–357. [DOI] [PubMed] [Google Scholar]
- 18.Green DM, Swets JA (1966) Signal detection theory & psychophysics (Peninsula Publishing; (1989)). [Google Scholar]
- 19.Wilson LE, da Silva Castanheira J, Baillet S (2022) Time-resolved parameterization of aperiodic and periodic brain activity, Elife 11. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 20.Dvorak D, Fenton AA (2014) Toward a proper estimation of phase-amplitude coupling in neural oscillations, J Neurosci Methods 225, 42–56. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 21.Seymour RA, Alexander N, Maguire EA (2022) Robust estimation of 1/f activity improves oscillatory burst detection, Eur J Neurosci. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Gabor_atom (2021) https://enwikipediaorg/wiki/Gabor_atom.
- 23.Schmidt T (2006) Coping with copulas (https://web.archive.org/web/20100705040514/http://www.tuchemnitz.de/mathematik/fima/publikationen/TSchmidt_Copulas.pdf).
- 24.Kullback S, Leibler RA (1951) On information and sufficiency, The Annals of Mathematical Statistics 22, 79–86, 78. [Google Scholar]
- 25.Kennedy J, Eberhart R (1995) Particle swarm optimization In Proceedings of ICNN’95 - International Conference on Neural Networks, pp. 1942–1948 vol.1944. [Google Scholar]
- 26.ROC (2021) Receiver operating characteristic in https://en.Wikipedia.org/wiki/receiver_operating_characteristic.
- 27.Nair SS, Calyam P (2022) Portal for cyber and software automation in neuroscience, http://cyneuro.Org/ (scroll to downloads, ‘oscillatory burst detector toolbox’).
- 28.Buzsaki Lab Data (2021) Data source: Https://buzsakilab.Nyumc.org/datasets/girardeaug/rat08/rat08-20130711/.
- 29.Baranauskas G, Maggiolini E, Vato A, Angotzi G, Bonfanti A, Zambra G, Spinelli A, Fadiga L (2012) Origins of l/f2 scaling in the power spectrum of intracortical local field potential, J Neurophysiol 107, 984–994. [DOI] [PubMed] [Google Scholar]
- 30.Gao R, Peterson EJ, Voytek B (2017) Inferring synaptic excitation/inhibition balance from field potentials, Neuroimage 158, 70–78. [DOI] [PubMed] [Google Scholar]
- 31.He BJ, Zempel JM, Snyder AZ, Raichle ME (2010) The temporal structures and functional significance of scale-free brain activity, Neuron 66, 353–369. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 32.van Pelt S, Boomsma DI, Fries P (2012) Magnetoencephalography in twins reveals a strong genetic determination of the peak frequency of visually induced gamma-band synchronization, J Neurosci 32, 3388–3392. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 33.van Beijsterveldt CE, van Baal GC (2002) Twin and family studies of the human electroencephalogram: A review and a meta-analysis, Biol Psychol 61, 111–138. [DOI] [PubMed] [Google Scholar]
- 34.Gray CM, König P, Engel AK, Singer W (1989) Oscillatory responses in cat visual cortex exhibit inter-columnar synchronization which reflects global stimulus properties, Nature 338, 334–337. [DOI] [PubMed] [Google Scholar]
- 35.Mooney CM, Ferguson GA (1951) A new closure test, Can J Psychol 5, 129–133. [DOI] [PubMed] [Google Scholar]
- 36.Grützner C, Wibral M, Sun L, Rivolta D, Singer W, Maurer K, Uhlhaas PJ (2013) Deficits in high-(>60 hz) gamma-band oscillations during visual processing in schizophrenia, Front Hum Neurosci 7, 88. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 37.Kanta V, Pare D, Headley DB (2019) Closed-loop control of gamma oscillations in the amygdala demonstrates their role in spatial memory consolidation, Nature Communications 10, 3970. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 38.Ylinen A, Bragin A, Nádasdy Z, Jandó G, Szabó I, Sik A, Buzsáki G (1995) Sharp wave-associated high-frequency oscillation (200 hz) in the intact hippocampus: Network and intracellular mechanisms, J Neurosci 15, 30–46. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 39.Headley DB, Kanta V, Paré D (2017) Intra- and interregional cortical interactions related to sharp-wave ripples and dentate spikes, J Neurophysiol 117, 556–565. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 40.Girardeau G, Benchenane K, Wiener SI, Buzsaki G, Zugaro MB (2009) Selective suppression of hippocampal ripples impairs spatial memory, Nat Neurosci 12, 1222–1223. [DOI] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
