Cole Voytek 2019 Cycle by Cycle Analysis of Neural Oscillations
Cole Voytek 2019 Cycle by Cycle Analysis of Neural Oscillations
INNOVATIVE METHODOLOGY
Cole S, Voytek B. Cycle-by-cycle analysis of neural oscillations. J haviors such as movement, sleep, perception, and cognitive
Neurophysiol 122: 849 – 861, 2019. First published July 3, 2019; performance (Hanslmayr et al. 2007; Klimesch 1999; Massi-
doi:10.1152/jn.00273.2019.—Neural oscillations are widely studied mini et al. 2004; Miller et al. 2007). Standard approaches for
using methods based on the Fourier transform, which models data as
sums of sinusoids. This has successfully uncovered numerous links studying these oscillations are based on the Fourier transform,
between oscillations and cognition or disease. However, neural data which decomposes a signal into component stationary sinu-
are nonsinusoidal, and these nonsinusoidal features are increasingly soids. However, brain rhythms are neither strictly stationary
linked to a variety of behavioral and cognitive states, pathophysiol- nor sinusoidal, as they come and go with varying amplitudes,
ogy, and underlying neuronal circuit properties. We present a new frequencies, and waveforms (Cole and Voytek 2017; Jones
analysis framework, one that is complementary to existing Fourier and 2016; Schaworonkow and Nikulin 2018; van Dijk et al. 2010).
Hilbert transform-based approaches, that quantifies oscillatory fea-
Therefore, decomposition of the neural signal using the Fourier
tures in the time domain on a cycle-by-cycle basis. We have released
this cycle-by-cycle analysis suite as “bycycle,” a fully documented, transform does not parsimoniously capture all of the interesting
open-source Python package with detailed tutorials and troubleshoot- structure present in neural signals. This is suboptimal given
ing cases. This approach performs tests to assess whether an oscilla- that nonsinusoidal oscillatory features carry physiological in-
tion is present at any given moment and, if so, quantifies each formation (Bartz et al. 2018; Belluscio et al. 2012; Buzsáki et
oscillatory cycle by its amplitude, period, and waveform symmetry, al. 1986; Cole and Voytek 2017; Cole et al. 2017; Hentschke
the latter of which is missed with the use of conventional approaches. et al. 2007; Jackson et al. 2019; Lee and Jones 2013; Lewis et
In a series of simulated event-related studies, we show how conven- al. 2012; Mazaheri and Jensen 2010; Pietersen et al. 2009;
tional Fourier and Hilbert transform approaches can conflate event- Sherman et al. 2016; Trimper et al. 2014, and nonstationarities
related changes in oscillation burst duration as increased oscillatory
of low-frequency cortical oscillations may reflect different
amplitude and as a change in the oscillation frequency, even though
those features were unchanged in simulation. Our approach avoids physiological processes (Cole and Voytek 2018; Peterson and
these errors. Furthermore, we validate this approach in simulation and Voytek 2017). Not properly accounting for these nonsinusoidal
against experimental recordings of patients with Parkinson’s disease, waveforms makes conventional analyses susceptible to artifac-
who are known to have nonsinusoidal beta (12–30 Hz) oscillations. tual results, such as apparent phase-amplitude and cross-fre-
quency coupling where no such multifrequency interaction
NEW & NOTEWORTHY We introduce a fully documented, open-
source Python package, bycycle, for analyzing neural oscillations on exists (Cole et al. 2017; Gerber et al. 2016; Kramer et al. 2008;
a cycle-by-cycle basis. This approach is complementary to traditional Lozano-Soldevilla et al. 2016; Scheffer-Teixeira and Tort
Fourier and Hilbert transform-based approaches but avoids specific 2016; Vaz et al. 2017).
pitfalls. First, bycycle confirms an oscillation is present, to avoid Methods used to analyze temporal properties of oscillations
analyzing aperiodic, nonoscillatory data as oscillations. Next, it quan- are also usually based on the Fourier and Hilbert transforms.
tifies nonsinusoidal aspects of oscillations, increasingly linked to “Instantaneous” measures of oscillatory amplitude and fre-
neural circuit physiology, behavioral states, and diseases. This ap- quency are widely used to estimate these time-varying prop-
proach is tested against simulated and real data. erties of an oscillation of interest (Canolty et al. 2006; Samaha
Fourier transform; Hilbert transform; neural oscillations; nonsinusoi- and Postle 2015; Voytek et al. 2013, 2015). However, the
dal computation of such instantaneous features does not directly
measure them in the original recording. Instead, values are
imputed from a transformed version of the data in which the
signal is usually limited to a narrow sinusoidal frequency band
INTRODUCTION (Bruns 2004). The mathematical nature of these approaches is
As a prominent feature of brain recordings, neural oscilla- such that they will always give a numerical result; they will
tions are frequently correlated to both pathologies (Uhlhaas always return an instantaneous amplitude, phase, and fre-
and Singer 2010; Voytek and Knight 2015) and healthy be- quency value, even if there is no oscillation present in the
signal (Haller et al. 2018). This is nonoptimal because ampli-
Address for reprint requests and other correspondence: B. Voytek, Dept. of
tude, phase, and frequency (as they are often intuited) should
Cognitive Science, University of California, San Diego, 9500 Gilman Dr., La be undefined if no oscillation is present. To address the issue of
Jolla, CA 92093-0515 (email: [email protected]). identifying periods of oscillation vs. no oscillation, new meth-
www.jn.org 0022-3077/19 Copyright © 2019 the American Physiological Society 849
Downloaded from journals.physiology.org/journal/jn (2604:9CC0:0014:1F89:592B:A77C:BE84:AF9D) on September 12, 2024.
850 CYCLE-BY-CYCLE ANALYSIS OF NEURAL OSCILLATIONS
ods, such as delay differential analysis, have been developed to MATERIALS AND METHODS
identify rhythmic sections of the signal in which oscillatory
analysis is warranted (Sampson et al. 2019). Periods of no All methods described are available in the open-source package
oscillations are common because aggregate electrophysiologi- “bycycle,” available at https://github.com/bycycle-tools/bycycle, with
cal signals such as electroencephalography (EEG), magneto- detailed tutorials at https://bycycle-tools.github.io. All Python code to
replicate the figures in this article are shared at https://github.com/
encephalography (MEG), electrocorticography (ECoG), and voytekresearch/Cole_2018_cyclebycycle. Filtering and Hilbert analy-
local field potential (LFP) contain an aperiodic component ses and signal simulations made use of the neurodsp package (Cole et
(Haller et al. 2018) that likely reflects the relative contributions al. 2019). All tests are nonparametric such that two-sample unpaired
of synaptic currents near the recorded region (Gao et al. 2017; tests are Mann-Whitney U and two-sample paired tests are Wilcoxon
Mazzoni et al. 2015). This means that narrowband analyses signed rank.
(without consideration of the nonstationary dynamics of the Segmentation of signal into cycles. The first step in characterizing
oscillatory signal) can give misleading results. This can lead to individual oscillatory cycles in a neural signal is to segment the entire
mischaracterizations of the data, such as phase slips, oscillatory recording into cycles. First, putative peaks and troughs are identified
frequency fluctuating within a single cycle, or an apparent throughout the recording. The raw data (Fig. 1A) is passed through a
increase in high-frequency amplitude caused by a sharp tran- low-pass filter to reduce higher frequency activity (Fig. 1B) that may
interfere with peak and trough identification. Next, the signal is
sient (Kramer et al. 2008; Nelli et al. 2017). bandpass filtered around the oscillation band of interest, ideally
We recently reviewed that waveform shape is diverse across verified from the power spectral density (Haller et al. 2018). The time
the brain and relates to physiology, pathology, and behavior points of the rise and decay zero-crossings are identified (Fig. 1C),
(Cole and Voytek 2017). The hippocampal theta rhythm (Buz- and the minima and maxima between these zero-crossings are de-
sáki et al. 1985), cortical slow oscillation (Amzica and Steriade clared as putative peaks and troughs from the broadly filtered (not
1998), and mu rhythm (Pfurtscheller et al. 1997) are particu- narrowband filtered) signal (Fig. 1D). Finally, the midpoints of the
larly known to have stereotyped nonsinusoidal waveforms. rise and decay flanks are computed by finding the time point at which
There are a wide variety of circuit activation patterns for the voltage is halfway between the peak and trough voltage (Fig. 1E).
oscillators of each frequency (Womelsdorf et al. 2014), and the Together, the times of the extrema and flank midpoints can be used
specifics of these dynamics may relate to the temporal dynam- to estimate a “waveform phase” time series by linearly interpolating
between their theoretical phases (Siapas et al. 2005). This means that
ics of a single cycle of the recorded oscillation or to its between each extremum and zero-crossing, phase is assumed to be
waveform shape. Therefore, differences in waveform shape linear. For example, because the phase of a peak is 0 and the phase of
may hint at differences in the parameters, conditions, or even the next zero-crossing is /2, if there are 10 time points between a
qualitative mechanisms of the oscillatory generator. One po- peak and the next zero-crossing, then the phase of each time point
tential interpretation of waveform shape is that sharper oscil- between will increase in /20 increments. If the signal is nonsinusoi-
latory extrema may be produced by more synchronous neural dal, this estimate slightly but systematically deviates from the instan-
activity (Cole et al. 2017; Sherman et al. 2016). This may be taneous phase commonly computed by bandpass filtering the signal in
caused by excitatory synaptic currents occurring relatively the oscillatory frequency band and applying the Hilbert transform.
simultaneously in a cortical region and integrating in the local This is because the Hilbert transform can artificially shift phase values
field to yield a sharp waveform, whereas those same currents, in an attempt to fit a sinusoid to a nonsinusoidal signal. This can cause
nonintuitive phase shifts, for example, fitting sinusoidal peaks away
more spread out in time, will result in a smoother LFP. from the true time-domain voltage peak for that cycle. That is, the
In this article we present a time-domain approach, comple- waveform phase estimate more closely matches the locations of the
mentary to traditional frequency-domain analyses, designed to oscillatory peaks and troughs, which can be skewed when a nonsi-
characterize nonsinusoidal and transient brain rhythms to help nusoidal oscillation is filtered in a narrow frequency band (Belluscio
quantify information not easily extracted from conventional, et al. 2012; Dvorak and Fenton 2014).
Fourier-based neural signal processing. For each oscillatory Note that this process of cycle segmentation uses some bandpass
cycle, amplitude and period (frequency) are quantified, as are filtering for localizing extrema (Fig. 1, B and C). This superficially
its waveform (a)symmetries. In contrast to the instantaneous seems in contrast with a proclaimed key advantage of the cycle-by-
features cited above, cycle-by-cycle measures are directly cycle method, where a sinusoidal waveform is not assumed. However,
computed on points of the time series rather than relying on individual cycle statistics are not computed on this narrowband-
filtered signal; filtering here is a tool useful for roughly estimating
transforms that assume a quasi-sinusoidal structure. The only peak and trough times. The low-pass filter is used to remove the high
reliance on more traditional approaches is an initial, very broad frequencies that may make identifying the peaks and troughs of the
filter used to remove the influence of high-frequency, noisy lower frequency rhythm more difficult. However, the filter is poten-
transients on estimating lower frequency oscillation peaks and tially removing some of the oscillatory signal that is especially sharp
troughs. This is followed by a more narrow filter to isolate the and requires high-frequency sine waves to reconstruct. Therefore, the
oscillatory band of interest, solely for the purpose of finding cutoff frequency of the low-pass filter is set to around four times the
zero-crossings. Although these filters are used as simple tools frequency of the oscillations of interest (e.g., 40 Hz for ~10-Hz alpha
to aid in segmenting the signal into cycles and localizing peaks, oscillations) as a compromise between the fidelity of waveform shape
troughs, and zero-crossings, these filters do not significantly and the ability to localize peaks and troughs (Fig. 1, A and B).
bias the waveform of the oscillation of interest. Importantly, Cycle feature computation. After the signal is segmented into
cycles, each cycle is characterized by a few intuitive features (Fig.
the output also specifies whether the oscillation of interest is 1F). In all analyses, cycles are chosen to start and end at consecutive
present or absent in the signal during each “cycle” period, since troughs. The amplitude of the cycle is computed as the average
it is unlikely that the oscillation is present throughout the whole voltage difference between the peak and the two adjacent troughs. The
duration of the signal (Fransen et al. 2015; Jones 2016). This is period is defined as the time between the two troughs. Rise-decay
critical, because estimates of oscillatory features are meaning- symmetry (rdsym) is the fraction of the period that was composed of
less if no oscillation is present (Haller et al. 2018). the rise time. A rise-decay symmetry value of 0.5 would therefore
Fig. 1. Approach for decomposing a neural signal into individual cycles. A: example raw field potential recording from the CA1 layer of rat hippocampus. B:
the raw signal is low pass filtered at 40 Hz (4 times the oscillation frequency) to remove high frequencies while preserving underlying theta waveform shape.
C: zero-crossings are found after the signal has been bandpass filtered in the theta frequency range (4 –10 Hz). D: peaks and troughs are found in the
low-pass-filtered signal by finding the relative maxima and minima between the zero-crossings found in the theta-filtered signal plotted in A. E: flank midpoints
are determined by locating the time points at which the voltage is halfway between the adjacent peak and trough voltages. These points denote the boundaries
between peak and trough. F: demonstration of features computed for a single cycle. The amplitude of the cycle is defined as the average voltage difference
between the trough and adjacent peaks (blue lines). The period is defined as the time between consecutive peaks (red and orange lines together). The rise-decay
symmetry is computed as the fraction of the period that the cycle is in the rise phase (orange line). Similarly, the peak-trough symmetry is defined as the relative
amount of a cycle (both green lines together) comprising the time between the rise midpoint and the subsequent decay midpoint (i.e., the peak; light green line).
G: table showing the values of each cycle feature for each cycle. Each row corresponds to a single cycle whose trough occurs in A–E at the time indicated by
the “trough time” column. ptsym, Peak-trough symmetry; rdsym, rise-decay symmetry.
indicate the cycle had equal durations of rise and decay. Note that cycle is part of an oscillatory rhythm in the signal. The entire signal
while a sinusoid has rdsym ⫽ 0.5, several classes of nonsinusoids can, is preliminarily segmented into putative cycles, even the portions in
as well, such as triangle waves. which no oscillation is present. Therefore, the term “cycle” is used
Peak-trough symmetry (ptsym) is the fraction of the period, en- here not to specifically refer to a cycle of an oscillatory process, but
compassing the previous trough and current peak, that was composed rather a time segment lasting approximately one period of the oscil-
of the peak. Similar to rise-decay symmetry, a peak-trough symmetry lation of interest. Oscillation presence is identified by time periods in
value of 0.5 indicates that the peak and trough were the same duration. which at least three consecutive putative cycles in the time series had
The peak period is defined as the time between a rise midpoint and similar amplitudes, similar periods, and rise and decay flanks that are
subsequent decay midpoint, whereas the trough period is defined as predominantly monotonic. To test this, three additional features are
the time between a decay midpoint and subsequent rise midpoint. The computed for each cycle. First, the amplitude consistency of a cycle is
values of each cycle feature are provided in a table in which each row quantified as the relative difference in the rise and decay voltage (e.g.,
represents an individual cycle. Figure 1G shows the cycle feature 0.5 corresponds to the change in voltage in one flank being 2 times
values for the recording processed throughout Fig. 1. The distributions bigger than the other, 1.0 corresponds to the rise and decay flanks
of these features across all cycles can be computed to compare having equal changes in voltage, etc.). The minimum value is taken
oscillation properties in different neural signals (Fig. 2, G–J). after this measure is computed for each pair of adjacent rise and decay
Detection of oscillatory periods. After the signal is segmented into flanks that includes one of the current cycle’s flanks. The period
putative cycles, an algorithm is applied to determine whether each consistency feature is computed as the maximal relative difference
J Neurophysiol • doi:10.1152/jn.00273.2019 • www.jn.org
Downloaded from journals.physiology.org/journal/jn (2604:9CC0:0014:1F89:592B:A77C:BE84:AF9D) on September 12, 2024.
852 CYCLE-BY-CYCLE ANALYSIS OF NEURAL OSCILLATIONS
Fig. 2. Comparison of two simulated signals using a cycle-by-cycle approach. A–F: 2 neural signals were simulated for 1,000 s each. The first signal (A) was
composed of a nonstationary oscillation (B) and aperiodic noise (C). The second signal (D) is simulated with a slightly larger oscillation (E) that is more
asymmetric (rise shorter than decay) and has slightly less aperiodic noise (F). G–J: distributions of cycle features comparing the signals in A (black) and D (red).
Compared with the signal in A, the cycles in D are generally larger in amplitude (G), have the same period (H), are more asymmetric with a shorter rise (I), and
are equally peak-trough symmetric (J). This shows, using ground-truth simulations, that the cycle-by-cycle approach successfully discriminates signals along the
appropriate dimensions that differ.
between the cycle’s period and the period of the adjacent cycles (e.g., consistent compared with the simulated data. An additional threshold
0.5 corresponds to the previous or subsequent period being twice or was added such that cycle amplitude must be above the twentieth
half the duration of the current cycle). The third and final feature, percentile to avoid aperiodic portions of the signal being considered as
monotonicity, is the fraction of instantaneous voltage changes (dif- a part of an oscillation.
ference between consecutive samples) that are positive during the rise Simulation of oscillations with noise. Voltage time series were
phase and negative during the decay phase (e.g., 0.8 corresponds to simulated using the neurodsp package (Cole et al. 2019) to have
20% of the voltage time series going in the opposite direction of the properties similar to real neural recordings. Four sets of signals were
current flank). simulated for Figs. 2–5. Unless otherwise specified, the oscillation in
These requirements for declaring oscillation presence are based on these simulated signals was in the alpha range (6 –14 Hz) with an
the definition of a periodic process, in which the voltage at time t ⫹ average frequency of 10 Hz.
should be predictable from the voltage at time t, where the process The nonstationary, nonsinusoidal oscillatory signal was simulated
has a period . In order for the future voltage to be reliably predicted as follows:
from the past voltage, the amplitude and period must be conserved 1) A time series of zeroes is created to match the desired length of
from cycle to cycle. The monotonicity requirement was added because the ultimate signal.
it was empirically found to separate periods of apparent periodic and 2) The zeroes time series is broken into windows representing
aperiodic activity. “cycles” of a potential oscillation, where each window length is
For all simulated recordings, amplitude consistency and period the period of the potential oscillation, drawn randomly from a
consistency thresholds were set to 0.6 and the monotonicity threshold normal distribution, here with a mean of 100 ms and SD of 5 ms.
was set to 0.9, because visual inspection of the oscillations detection 3) Each window is defined to be either in an oscillatory state or not.
results showed that these parameters detected oscillations well. For If the prior window is not in an oscillatory state, then the current
the motor cortical beta recordings, oscillation detection parameters window starts oscillating with a probability of 0.1.
were tuned to improve accuracy as judged by visual inspection 4) Once an oscillating cycle occurs, each successive cycle will end
(amplitude consistency threshold ⫽ 0.3, period consistency thresh- the oscillatory state with a probability of 0.1. In other words, if
old ⫽ 0.5, monotonicity threshold ⫽ 0.6). This was necessary be- the signal was currently in an oscillatory state, then it had a 10%
cause the beta oscillations were generally less monotonic and less probability of exiting that state after each cycle.
Fig. 3. Accuracy of measured cycle features in simulated signals with noise. A and B: 2 simulated neural signals with relatively large amounts of noise [A;
signal-to-noise ratio (SNR) ⫽ 0.32] and relatively low amounts of noise (B; SNR ⫽ 3.2). The ground-truth oscillation that was simulated (gray trace) is compared
with the simulated “recording” used to compute cycle features (black trace). These simulated recordings are the result of adding noise to the ground-truth
oscillation, followed by application of a 40-Hz low-pass filter to aid in extrema localization. Note that this recovered oscillatory signal has substantial differences
compared with the generated oscillation due to corruption from the added noise, particularly in A. C–E: comparison between measured and ground-truth cycle
features for the signal plotted in A. Each dot corresponds to 1 cycle for its measured and true amplitude (C), period (D), and rise-decay symmetry (E). F–H: same
as C–E except for the signal plotted in B. Note the stronger correlations between measured and ground-truth cycle features. I: average measurement error of
individual cycle features for simulated signals with SNR ranging from 0.1 to 10. amp, Amplitude; rdsym, rise-decay symmetry.
5) If a window is determined to be in an oscillatory state, a analysis, to remove high-frequency power that would complicate
waveform is simulated as follows: extrema localization.
a) The amplitude of that cycle is sampled from a distribution, To compare cycle feature distributions across recordings, two example
here with a mean of 1 and SD of 0.1 (arbitrary units). recordings (Fig. 2, A and D) were simulated, using the parameters
b) The rdsym of that cycle is sampled from a distribution, here specified above, for 1,000 s each. However, the second signal (Fig. 2D)
with a mean of 0.5 and SD of 0.05. was modified such that the power of the periodic component was twice
Noise was simulated using brown (1/f 2) noise that was high-pass that of the power of the aperiodic component, and the average rise-decay
filtered at 1 Hz (filter order ⫽ 3 s). This brown noise is referred to symmetry was 0.3 instead of 0.5. To determine the accuracy of the cycle
as the “aperiodic” component of the signal, whereas the oscillation features, 41 recordings were simulated for 5 min each in which the
is referred to as the “periodic” component (Haller et al. 2018). This relative variance of the aperiodic and periodic components was varied
noise was added to the periodic oscillatory signal. Unless other- between 0.1 and 10 with equal spacing in logarithmic space (Fig. 3). In
wise specified, the aperiodic component was scaled such that it had this simulation, the standard deviations of cycle features were increased
the same variance as the periodic component. A low-pass filter at to ⫽ 0.2 for amplitude, ⫽ 15 ms for period, and ⫽ 0.1 for rise-
40 Hz (filter order ⫽ 100 ms) was applied before cycle-by-cycle decay symmetry.
J Neurophysiol • doi:10.1152/jn.00273.2019 • www.jn.org
Downloaded from journals.physiology.org/journal/jn (2604:9CC0:0014:1F89:592B:A77C:BE84:AF9D) on September 12, 2024.
854 CYCLE-BY-CYCLE ANALYSIS OF NEURAL OSCILLATIONS
Fig. 4. Comparison of amplitude measurement methods on simulated event-related data. A: 3 different event-related oscillatory changes were simulated for an
event occurring at 0.0 s: 1) a “baseline” condition in which 10-Hz oscillations were randomly added to the data after a simulated event onset (black); 2) a “higher
amp” condition in which the oscillations were 10% larger than in the baseline condition (red), and 3) a “more bursts” condition wherein oscillations were more
common than in the other conditions (blue). Although 1 example trial for each condition is shown, 100 trials were simulated for each condition. B: event-related
instantaneous amplitude profiles, estimated using the conventional approach of filtering and the Hilbert transform, were averaged across the 3 trial types in A.
C: same as B, but amplitude was estimated using the cycle-by-cycle approach. Amplitude estimates were binned at 100-ms intervals. D: same as C but showing
the probability of an oscillation being detected for each condition, binned at 100-ms intervals. Note that this measure is not a standard output for conventional
analyses. E and F: distributions of the average instantaneous amplitude (E) and cycle amplitude (F) between 500 and 1,000 ms for each trial in the baseline (black)
and higher amp (red) conditions. Note that the instantaneous amplitude measure did not significantly differentiate the amplitude across these 2 conditions (P ⫽
0.10). In contrast, the cycle-by-cycle amplitude estimate accurately shows that the amplitude is greater in the higher amp condition compared with the baseline
condition (P ⬍ 10⫺5). G and H: similar to E and F but showing the difference in amplitude distributions between the baseline (black) and more bursts (blue)
conditions. Note that the instantaneous amplitude estimates are larger in the more bursts condition (G; P ⬍ 10⫺7), whereas the cycle-by-cycle amplitude estimate
is relatively unchanged (H; P ⫽ 0.37). a.u., Arbitrary units.
Two additional sets of signals were simulated to compare cycle- Instantaneous amplitude and frequency computation. Instanta-
by-cycle measures with instantaneous amplitude and frequency mea- neous measures of amplitude and frequency were computed using
sures (Figs. 4 and 5). These simulations were modeled after an common methods and applied to the simulated alpha oscillations
event-related design where each simulation is a “trial.” Trials were described in the previous paragraph. Signals were first bandpass
simulated such that a 10-Hz oscillation burst was induced after an filtered (8 –12 Hz), and then the Hilbert transform was applied. The
“event.” Brown noise was simulated throughout the trial (⫺1 to 2 s), magnitude of the resultant time series was computed to obtain the
and a bursting oscillation was simulated from 0 to 2 s in the same instantaneous amplitude estimate, and the angle was computed to
manner as described above. Three conditions of 100 trials each were obtain the instantaneous phase estimate. Instantaneous frequency was
simulated for assessing amplitude measures. The “higher amp” con- computed from the instantaneous derivative of the phase time series
dition induced alpha oscillations with a 20% greater amplitude than in and then iteratively median filtered using 10 window sizes linearly
the “baseline” condition. The “more bursts” condition was 50% more spaced between 10 and 400 ms, as previously described (Samaha and
likely to enter an oscillation and 50% less likely to leave an oscillation Postle 2015).
compared with the other conditions. Similar trials were simulated for Motor cortical beta recordings. ECoG recordings from 23 patients
comparing cycle-by-cycle and instantaneous measures of frequency. with Parkinson’s disease were obtained during surgery for implanta-
For this experiment, a “faster” condition was simulated by using an tion of a deep brain stimulator and publicly released (de Hemptinne et
11-Hz oscillation instead of a 10-Hz oscillation. al. 2015). Briefly, a strip of electrodes with 1-cm contacts was inserted
Fig. 5. Comparison of frequency estimation methods on simulated event-related data. A: 3 different event-related oscillatory changes were simulated for an event
occurring at 0.0 s: 1) a “baseline” condition in which 10-Hz oscillations were randomly added to the data after a simulated event onset (black); 2) a “faster”
condition in which the oscillations were simulated at 11 Hz (red), and 3) a “more bursts” condition wherein oscillations were more common than in the other
conditions (blue). Although 1 example trial for each condition is shown, 100 trials were simulated for each condition. B: event-related instantaneous frequency
profiles, estimated using the conventional approach of filtering and the Hilbert transform, were averaged across the 3 trial types in A. C: same as B, but frequency
was estimated using the cycle-by-cycle approach. Frequency estimates were binned at 100-ms intervals. D and E: distributions of the average instantaneous
frequency (D) and cycle-by-cycle frequency estimate (F) between 500 and 1,000 ms for each trial in the baseline (black) and faster (red) conditions. Note that
both the instantaneous and cycle-by-cycle frequency measures differentiated these conditions (P ⬍ 10⫺4). Also note that the cycle-by-cycle frequency
distributions were accurately around 10 Hz for the baseline condition and 11 Hz for the faster condition, whereas the instantaneous frequency measures were
often estimated to be lower than the ground-truth simulation. F and G: similar to D and E but showing the difference in frequency distributions between the
baseline (black) and more bursts (blue) conditions. Note that the instantaneous frequency estimates are higher in the more bursts condition (F; P ⬍ 10⫺4), whereas
the cycle-by-cycle frequency estimate is appropriately unchanged (G; P ⫽ 0.45). a.u., Arbitrary units.
over the primary motor cortex (M1) and re-referenced using a bipolar ture were compared between the two signals. Signal D in
montage of adjacent contacts. The signals analyzed in this study were general has higher amplitude alpha oscillations (mean peak-to-
from a single channel in which one of the electrodes was over M1. trough voltage ⫽ 3.0) compared with signal A (mean ⫽ 2.6) as
Recordings were collected for 30 s before and during deep brain
stimulation (DBS). For more information on the data collection, see shown in their histograms (Fig. 2G). This is because the two
de Hemptinne et al. (2015). Recording sampling rate was 1,000 Hz. signals were simulated with different ratios of periodic to
Before cycle-by-cycle analysis, signals were low-pass filtered at 200 aperiodic power, before z scoring. However, the two signals
Hz and high-frequency peaks (60 Hz and above) were removed (for were not differentiated by their periods, which were both 100
more information, see Cole et al. 2017). During cycle segmentation, ms on average (Fig. 2H). These signals were detected to have
the narrow bandpass filter cutoff frequencies were 13 and 30 Hz. differences in their rise-decay symmetry (Fig. 2I) but not in
peak-trough symmetry (Fig. 2J). This is because signal A was
RESULTS simulated to have an average rise-decay symmetry of 0.5,
whereas signal D was simulated to have an average rise-decay
Comparison of cycle-by-cycle oscillatory feature distributions. symmetry of 0.3. However, the average measured rise-decay
To demonstrate the general approach of our method, we symmetry for signal D was 0.37. This is because adding noise
applied our cycle-by-cycle analysis technique (Fig. 1; see to the data biased the symmetry measures such that they seem
MATERIALS AND METHODS) to two simulated neural recordings of to be more symmetric.
1,000 s each. These simulated signals (Fig. 2, A and D, signal Accuracy of cycle-by-cycle characterization. To assess the
A and signal D, respectively) are composed of both transient accuracy of our cycle-by-cycle oscillatory characterization, we
10-Hz (alpha) oscillations (Fig. 2, B and E) and aperiodic noise compared cycle features measured in simulated neural signals
(Fig. 2, C and F; see MATERIALS AND METHODS). Periods of the (5 min each) with the ground truth of the simulation. Signals
signal in which alpha oscillations were present were deter- were simulated at a variety of signal-to-noise (SNR) levels by
mined, and the features of these cycles were computed (see controlling the relative power of the simulated periodic com-
MATERIALS AND METHODS). The distributions of each cycle fea- ponent (“oscillation”, e.g., Fig. 2B) and the simulated aperiodic
J Neurophysiol • doi:10.1152/jn.00273.2019 • www.jn.org
Downloaded from journals.physiology.org/journal/jn (2604:9CC0:0014:1F89:592B:A77C:BE84:AF9D) on September 12, 2024.
856 CYCLE-BY-CYCLE ANALYSIS OF NEURAL OSCILLATIONS
component (“noise”, e.g., Fig. 2C). Example traces are plotted tude may not be distinguishable from an inconsistent oscilla-
for an example signal with a high amount of noise (SNR ⫽ tion at a higher amplitude.
0.32; Fig. 3A) and one with a lower amount of noise (SNR ⫽ In contrast, the cycle-by-cycle amplitude measure was ap-
3.2; Fig. 3B). Traces are the simulated periodic component and propriately increased specifically only for the higher amp
the combination of the periodic and aperiodic components after condition (Fig. 4C). Additionally, the cycle-by-cycle approach
a 40-Hz low-pass filter, applied to improve peak and trough quantifies how often the signal was in an oscillatory state, and
localization. Sensibly, there is a greater correspondence be- so we can observe that the more bursts condition was oscillat-
tween the simulated oscillations and the measured oscillation ing more than the other two conditions (Fig. 4D). In this
in the signal with higher SNR, as shown by the stronger simulated experiment, the cycle-by-cycle measures better dis-
correlation between traces in Fig. 3B than between traces in criminate the appropriate features of oscillatory amplitude
Fig. 3A. compared with instantaneous methods.
Furthermore, we examined how well these two approaches
The error between the measured amplitude, period, and
perform with regard to measuring oscillatory amplitude. To do
rise-decay symmetry estimates of each cycle was computed for
this, amplitude was averaged from 500 to 1,000 ms in each
these signals. For the noisier signal (SNR ⫽ 0.32), there was trial. Across trials, this mean instantaneous amplitude did not
larger variance between the measured cycle features and the significantly differentiate the baseline and higher amp condi-
ground truth. The correlations between the measurements and tions (Fig. 4E; U ⫽ 4480, P ⫽ 0.10), whereas the mean cycle
the ground truth were low for all cycle features, namely, amplitude did significantly differentiate these conditions (Fig. 4F;
amplitude (Fig. 3C, Pearson r ⫽ 0.19), period (Fig. 3D; U ⫽ 182, P ⬍ 10⫺5). Additionally, instantaneous amplitude anal-
r ⫽ 0.25), and rise-decay symmetry (Fig. 3E; r ⫽ 0.06). For ysis falsely resulted in a significant difference in oscillation
the signal with less noise (SNR ⫽ 3.2), the correlations were amplitude between the baseline and more bursts conditions (Fig.
higher for amplitude (Fig. 3F; r ⫽ 0.52), period (Fig. 3G; 4G; U ⫽ 2781, P ⬍ 10⫺7), whereas the cycle-by-cycle amplitude
r ⫽ 0.46), and rise-decay symmetry (Fig. 3H; r ⫽ 0.30). For analysis successfully found no significant difference (Fig. 4H;
each feature, the average error was computed across simulated U ⫽ 819, P ⫽ 0.37).
signals with SNR varying from 0.1 to 10. The error of each Similarly, we simulated an experiment to determine the
cycle feature estimate was normalized by the ground truth to difference in the efficacy of oscillation frequency estimates
compute a normalized error measurement. Figure 3I shows that obtained from the conventional instantaneous approach and the
this error decreases as signal SNR increases. Note that these cycle-by-cycle approach (Fig. 5A). Rather than simulating a set
errors are computed for individual cycles, but analyses are of trials with increased amplitude, in this case a faster condi-
intended be performed on cycle feature averages over trials or tion was added in which an 11-Hz oscillation was simulated,
resting-state recordings. In these cases, as more cycles are whereas the oscillations in the other conditions had a frequency
sampled, the error between the ground-truth and measured of 10 Hz. The instantaneous frequency was averaged across
cycle feature means will decrease. trials for each condition (Fig. 5B). Similarly, frequency was
Cycle-by-cycle estimates versus instantaneous measures of computed from the cycle-by-cycle period measures and aver-
amplitude and frequency. It is possible that estimating ampli- aged across trials (Fig. 5C). Both instantaneous and cycle-by-
tude and frequency on a cycle-by-cycle basis could provide a cycle approaches were able to differentiate between the base-
more precise estimate of these properties compared with con- line and faster conditions (Fig. 5, D and E; instantaneous:
ventional “instantaneous” approaches that first apply a narrow U ⫽ 3351, P ⬍ 10⫺4; cycle: U ⫽ 100, P ⬍ 10⫺7). However,
bandpass filter, followed by the Hilbert transform. We com- the instantaneous frequency estimates were considerably lower
pared how these measures could differentiate conditions in a than the simulated ground truth frequencies such that the
simulated experiment that elicit oscillations with differing average instantaneous frequency for each trial was 9.3 Hz for
amplitude and frequency (see MATERIALS AND METHODS). This the baseline condition and 9.9 Hz for the faster condition. In
hypothetical experiment resulted in a 10-Hz oscillation appear- contrast, the cycle-by-cycle estimates of frequency were ap-
ing after an event. There were three conditions: baseline, propriately around 10 Hz for the baseline condition and 11 Hz
higher amp, and more bursts (Fig. 4A). The oscillations in the for the faster condition.
higher amp condition were 10% greater in amplitude than in Furthermore, there was a spurious increase in instantaneous
the other conditions. The more bursts condition was 50% more frequency in the more bursts condition compared with the
likely to enter an oscillatory state and 50% less likely to leave baseline condition (Fig. 5F; U ⫽ 3389, P ⬍ 10⫺4). This again
it compared with the other conditions. Instantaneous and cycle- can be attributed to the fact that the instantaneous measures do
by-cycle amplitudes were computed for the simulated trials not account for whether the oscillation is present in the signal,
(100 per condition) and averaged across each condition. and so these estimates can be biased by aperiodic portions of
The average instantaneous amplitude trace for the higher the signal. These aperiodic portions of the signal will have an
amp condition was appropriately greater compared with the average frequency corresponding to the power-weighted aver-
baseline condition (Fig. 4B). However, the instantaneous am- age frequency component in the frequency band of interest (in
plitude for the more bursts trials was even greater, even though this case alpha, 6 –14 Hz). Like real neural signals, the power
the simulated oscillations were the same size as for the baseline in these simulated signals decreases as a function of frequency,
trials. This undesirable trait of conflating more (or longer) and so the power-weighted average frequency during an ape-
bursts as higher average amplitude is the result of averaging riodic segment would lie somewhere below 10 Hz, the mid-
nonstationary processes across many trials (Jones 2016; La- point of the defined oscillation frequency band of interest. This
timer et al. 2015). This means that with the use of traditional means that with the use of traditional Hilbert approaches, the
Hilbert approaches, a consistent oscillation at a lower ampli- prevalence of an oscillation may confound an apparent change
J Neurophysiol • doi:10.1152/jn.00273.2019 • www.jn.org
Downloaded from journals.physiology.org/journal/jn (2604:9CC0:0014:1F89:592B:A77C:BE84:AF9D) on September 12, 2024.
CYCLE-BY-CYCLE ANALYSIS OF NEURAL OSCILLATIONS 857
in frequency. In contrast to the instantaneous frequency mea- with the previously published sharpness ratio results (Cole et
sure, there was no difference in the cycle-by-cycle frequency al. 2017). Note that peak-trough asymmetry in this case is
estimates measured in the baseline and more bursts conditions measured as the difference from a symmetric oscillation such
(Fig. 5G; U ⫽ 769, P ⫽ 0.45). that 0 represents equal duration peaks and troughs and 0.1
Cycle-by-cycle analysis of motor cortical beta oscillations in represents an oscillation in which the average cycle was 60%
Parkinson’s disease. In addition to simulated data, we applied peak or 60% trough (i.e., 0.6 ⫺ 0.5 ⫽ 0.1 and 0.4 ⫺ 0.5 ⫽
the cycle-by-cycle approach to analyze motor cortical ECoG ⫺0.1). This was done because the polarity was not consistent
recordings. We have previously shown that motor cortical beta across recordings.
oscillations are “sharper” in patients with Parkinson’s disease
(Cole et al. 2017; Jackson et al. 2019) and that this sharpness
DISCUSSION
is decreased with DBS treatment (Cole et al. 2017) or dopa-
minergic medication (Jackson et al. 2019). The current “peak- We have presented a novel framework and technique for
trough asymmetry” measure was designed to measure the same analyzing the properties of oscillations in neural signals. This
intuitive sense of sharpness reported in the previous studies, cycle-by-cycle analysis approach is complementary to, and
but it differs in that it is computed as a temporal ratio, as offers advantages when used in addition to, conventional
opposed to differences in voltages (Fig. 1F; see MATERIALS AND approaches based solely on the Fourier and Hilbert transforms.
METHODS). This new metric is used because the previously used Our method offers an alternative, and arguably more intuitive,
“sharpness asymmetry” intrinsically, and undesirably, scaled estimate of an oscillation’s amplitude and frequency on a
with amplitude. cycle-by-cycle basis. These estimates are incorporated in the
Figure 6, A and B, shows recordings from an example same framework that has previously been used to estimate
subject before and during DBS. In this subject, DBS decreased rise-decay symmetry (Cole et al. 2017). We have expanded this
the amplitude (Fig. 6C) and period (Fig. 6D) of beta oscilla- framework to offer a novel peak-trough symmetry measure,
tions but did not affect their rise-decay symmetry (Fig. 6E). which quantifies the sharpness of an oscillatory waveform.
Across the patient population (n ⫽ 23), there was no consistent Using empirical recordings from human patients, we showed
effect of DBS on amplitude (Wilcoxon signed-rank test, this symmetry measure differentiates between treatment con-
W ⫽ 84, P ⫽ 0.10), period (W ⫽ 90, P ⫽ 0.14), or rise-decay ditions. Furthermore, using simulated data, we showed that our
asymmetry (W ⫽ 102, P ⫽ 0.27). However, DBS did elongate new amplitude and frequency estimates can be more sensitive
the relative peak time in the example subject (Fig. 6F) and and specific than conventional techniques.
consistently caused the beta oscillations to become more peak- This technique offers further analytic possibilities, beyond
trough symmetric (Fig. 6G; W ⫽ 71, P ⫽ 0.019), consistent what is demonstrated in this article. In addition to comparing
Fig. 6. Changes in motor cortical beta oscillation shape with deep brain stimulation (DBS) treatment of Parkinson’s disease. A and B: motor cortical
electrocorticography recordings from 1 subject before (A) and during (B) DBS. C–F: comparison of amplitude (C), period (D), rise-decay symmetry (E), and
peak-trough symmetry (F) of beta oscillations in the same subject before (black) and during (red) DBS. G: comparison of peak-trough asymmetry of beta
oscillations before and during DBS. This value is computed as the absolute difference between the peak-trough symmetry and 0.5 (equal peak and trough
duration). Each dot represents 1 subject. The diagonal line represents the same peak-trough asymmetry before and during DBS. These results replicate previous
work showing that peak-trough asymmetry is reduced during DBS treatment in most patients, in this case using methods that focus only on recording segments
in an oscillation.
distributions of cycle features from separate recordings (e.g., tion. Setting thresholds for defining oscillation presence may
DBS on vs. DBS off), cycles can be analyzed in an event- require parameter tuning to achieve sensible classification.
related manner to examine the effects of task conditions or That said, visual inspection confirmed that the same hyperpa-
correlates to behavioral responses, such as reaction time, or rameter settings worked reasonably across the simulations and
physiological features, such as local spiking (Cole and Voytek experimental data analyzed here. Hyperparameters are not only
2018). This framework additionally allows for studying the present in the current method, but other oscillation detection
temporal dynamics by which oscillatory features change over methods benefit from tuning amplitude thresholds and filter
time, similar to studies looking at changes to oscillatory power lengths because they will significantly impact the results (Fe-
or frequency. Furthermore, if a signal contains multiple oscil- ingold et al. 2015). We recommend that the user runs the
lations of interest, then the analysis can be run multiple times analysis with multiple hyperparameter choices to test the ro-
using distinct frequency bands. Additionally, the oscillatory bustness of the results.
detection algorithm allows for quantifying features of oscilla- A key feature of the oscillation detection method used here
tion presence, such as burst duration or burst rate, that may is that it does not need to set an amplitude threshold to define
correlate meaningfully to experimental parameters. oscillatory periods, as is the case for previously published
Caveats of cycle-by-cycle analysis and comparisons to ex- algorithms for oscillatory burst detection (Feingold et al. 2015;
isting methods. As for Fourier-based analysis, there are also Hughes et al. 2012; Watrous et al. 2017). This makes the
caveats of this cycle-by-cycle technique that need to be con- current oscillation detection algorithm especially suitable for
sidered to minimize confounds. In a recent paper, we showed detecting oscillators that may occur at both small and large
that cycle features are significantly autocorrelated for the amplitudes or that may vary greatly in stationarity between
rodent hippocampal theta rhythm (Cole and Voytek 2018). recordings. In contrast, use of an amplitude threshold based on
Because of this autocorrelation, it is therefore invalid to treat scaling the median oscillatory power (Feingold et al. 2015)
each cycle as independent in statistical tests. This is a similar inherently defines an upper limit on the fraction of the signal
caveat to trial-wise analyses, in which consecutive trials are that can be classified as oscillatory. This may not be suitable,
often not independent. To bypass this issue and assess signif- for example, in a set of hippocampal recordings in which theta
icance within a recording, the recording can be split into oscillations can be present in more than 50% of the recording.
multiple nonoverlapping segments, and a statistical test can be Other complementary tools exist for extracting information
performed on a metric of each segment (e.g., mean difference from neural signals that Fourier-based analyses do not con-
in rdsym between conditions A and B). cisely capture. Matching pursuit is a tool for decomposing a
It is also important to keep in mind that these cycle features signal using a dictionary of functions and has been used to
are likely not independent of one another. For instance, the analyze transient components of brain signals (Chandran KS et
higher amplitude hippocampal theta rhythms tend to have al. 2016; Ray et al. 2003). However, this approach has only so
shorter periods and are more rise-decay asymmetric and peak- far been applied with a basis of Gaussian-modulated sinusoids,
trough asymmetric (Cole and Voytek 2018). Therefore, these and it is nontrivial to decide how to parametrize the output to
features may capture physiologically redundant information. compare experimental conditions. Another approach, empirical
To tease apart some interdependencies, multiple features could mode decomposition (EMD), decomposes signals without
be incorporated into a model to predict a condition or behavior forcing a basis function, such as the sinusoidal basis assumed
of interest (e.g., general linear model or logistic regression), in Fourier-based approaches (Liang et al. 2005; Pittman-Pol-
and the unique contribution of each feature can be assessed. letta et al. 2014). However, applications of EMD in neural
For example, if oscillatory amplitude is greater in condition A signals have been limited by critical issues such as “mode
vs. B, and amplitude is correlated with symmetry, then we will mixing,” in which an oscillation of interest is split among
also observe that symmetry differs between conditions. How- multiple components, and difficulty in identifying analogous
ever, a multidimensional model could detect whether symme- components across different recordings (Park et al. 2013).
try contains any additional information beyond that provided More complicated methods have been developed to help par-
by amplitude. tially overcome these issues, but EMD has rarely been applied
Because extrema localization is nontrivial, caution is neces- to neural signals beyond providing features for machine learn-
sary when analyses that consider the precise times of peaks and ing algorithms (Bajaj and Pachori 2012; Diez et al. 2009;
troughs are performed. For example, an aperiodic process Orosco et al. 2009).
could delay the algorithm’s trough localization, and so if a Few analysis techniques have been designed specifically for
neuron fires most at the trough, it will appear that it fires at an characterizing the time-domain waveform shape of brain os-
earlier phase when the decay period is artificially elongated. cillations. Characterizations of oscillation waveform shape
However, a rat’s position could be better decoded by using have mostly been limited to locating peaks and troughs and
extrema interpolation compared with the conventional Hilbert quantifying the relative durations of rises and decays. In the
transform-based method (Belluscio et al. 2012). If it is difficult hippocampal gamma oscillation, for example, the amplitude of
to filter the signal to achieve reasonable extrema localization a cycle is positively correlated with the period of the subse-
and symmetry fidelity, then the oscillation may not be suitable quent cycle, which has been interpreted as reflecting synaptic
for cycle-by-cycle analysis. For example, it is likely not rea- excitation being counterbalanced by proportional inhibition
sonable to analyze the beta frequency band in the visual cortex (Atallah and Scanziani 2009). The asymmetry of hippocampal
because the presence of this rhythm is usually not evident in theta oscillations has been characterized by the relative dura-
the time series, whereas alpha is prominent. tions of the rise and decay periods and is correlated to memory
Hyperparameter selection is another notable challenge, but it and spatial representation (Amemiya and Redish 2018; Bellus-
is not a new one, nor is it unique to oscillation parameteriza- cio et al. 2012; Dvorak and Fenton 2014; Trimper et al. 2014).
J Neurophysiol • doi:10.1152/jn.00273.2019 • www.jn.org
Downloaded from journals.physiology.org/journal/jn (2604:9CC0:0014:1F89:592B:A77C:BE84:AF9D) on September 12, 2024.
CYCLE-BY-CYCLE ANALYSIS OF NEURAL OSCILLATIONS 859
Because of its notable asymmetry, researchers studying hip- initial transients as bursts of activity by a few local neurons and
pocampal theta have designed an alternative instantaneous that this activity spread out as the transient discharges merged
phase estimate that involves identifying extrema in each cycle into a quasi-sinusoid. Therefore, each cycle could be consid-
(Belluscio et al. 2012; Siapas et al. 2005). Additionally, two ered as a “packet” of neural activity that can be characterized
algorithms were recently developed to extract the waveform of distinctly from the previous and subsequent cycles using a
the prominent oscillation in a neural signal (Gips et al. 2017; cycle-by-cycle analysis framework. This view of each cycle as
Jas et al. 2017), but these approaches do not capture changes in an informative physiological unit differs substantially from
waveform shape within a recording. modern work on oscillations.
Instantaneous and cycle-by-cycle measure comparison. In It is important to note that the specific methods and ap-
addition to its ability to quantify waveform symmetry, we proaches we introduce in this article may not be the final best
believe that the cycle-by-cycle framework’s measures of am- approaches, but they are a step toward more careful parame-
plitude and period also offer an advantage over current, widely terization of the signals of interest. As we have shown, without
used methods for estimating instantaneous amplitude and fre- more careful parameterization, it is easy to conflate one phys-
quency. An important step in computing instantaneous ampli- iological process, such as increased burst probability, with
tude is convolution with a kernel of the frequency of interest. another entirely different process of oscillation amplitude
This means that the amplitude measure at any given point in change. Because our package is open source, the methods can
time is actually computed using data from several cycles be refined as new physiological data are collected and as
around that point (depending on the filter length). Because simulations are refined. For example, the cycle-detection ap-
convolution is a linear operation, it is not specifically sensitive proach introduced in this study is but one of many, and future
to oscillatory amplitude, but it will be strongly biased by studies may show that one approach performs best for one class
nonoscillatory sharp transients. Instantaneous frequency, de- of data, whereas a second approach performs best for another.
rived from instantaneous phase, is similarly based on this Software modularity promotes flexibility in the light of new
convolution and fluctuates within a cycle due to the cycle’s data. In addition, because we quantify how the bycycle ap-
temporal dynamics. However, when applied to a relatively proach is susceptible to noise, some low-pass filtering is
stationary nonsinusoidal oscillation (e.g., hippocampal theta), necessary to balance time-domain extrema localization with
instantaneous measures will cause fluctuating within-cycle noise transient confounding. Future approaches to denoise the
frequency estimates, which do not actually reflect a change in data, perhaps through dynamic removal of the aperiodic signal,
the theta frequency, but rather reflects its sawtooth-like wave- might prove more effective. Finally, although we only covered
form. In addition, these approaches conflate periodic and ape- four cycle features in this article (amplitude, period, rise-decay
riodic activity, because every moment in the signal is assumed symmetry, and peak-trough symmetry), additional features can
to represent an oscillation. As we demonstrated in simulation, be designed and easily added to this workflow, such as
conflating these two processes introduces noise. Perhaps an monotonicity of the flanks or gamma power (Lopes-dos-
even more pernicious concern is one caused by the nonrandom, Santos et al. 2018). This modularity is important because we
1/f-like relationship between neural frequency and power, do not know which features optimally characterize the
wherein event-related changes in the aperiodic signal, as has physiology of waveforms. It is clear that no one feature is
recently been demonstrated (Podvalny et al. 2015; Gao et al. sufficient (for example, rdsym ⫽ 0.5 for both sinusoids and
2017), can be mischaracterized as changes in instantaneous triangle waves); thus several cycle features are parameter-
frequency. ized to better classify waveforms.
In contrast to the widely used instantaneous measures, the In summary, we have demonstrated a novel approach to
time-resolved estimates of amplitude and period (frequency) analyzing neural oscillations using a cycle-by-cycle frame-
using cycle-by-cycle estimates are more direct and intuitive work. This technique has advantages over conventional ap-
measurements of the oscillation. Specifically, the amplitude proaches that rely solely on Fourier-based techniques, includ-
measures the mean rise and decay voltages, and the period is ing its ability to characterize oscillatory waveform symmetry
computed as the time between consecutive peaks of a cycle in and its inherent detection of whether an oscillation is present in
a putative oscillation. This method does not over-promise the data or not. We additionally demonstrate its application on
temporal resolution that it cannot reliably account for, and it is an experimental data set of Parkinson’s disease recordings and
robust to issues that plague instantaneous measures such as a simulated data set with a simulated event-related alteration of
sharp transients and nonsinusoidal waveforms. Additionally, alpha oscillation features. This method is well suited to analyze
we showed that the cycle-by-cycle measures of amplitude and not only motor cortical beta rhythms but also any oscillation
frequency are more robust and better at differentiating these that is prominent in the raw data, such as the mu rhythm, visual
properties in simulated oscillations (Figs. 4 and 5). Specifi- cortical alpha, hippocampal theta, visual cortical gamma,
cally, instantaneous measures of both amplitude and frequency thalamocortical spindles, cortical slow oscillation, and respira-
are biased by the proportion of the signal in which the oscil- tory rhythms. Although this open-source analysis framework is
lation is present, so this could underlie some past reports of unique in its focus on oscillatory symmetry, it is also comple-
changes in instantaneous amplitude and frequency. mentary to conventional analysis of oscillatory amplitude and
There is some empirical precedence for analyzing individual period, and, as such, should be a standard part of the neural
cycles of brain rhythms. Adrian and Matthews (1934) studied oscillation analysis toolbox.
the evolution of a gamma oscillation in response to injury to
the cortex of a cat. Initially, they observed rhythmic transient ACKNOWLEDGMENTS
discharges, which gradually became more frequent and broad, We thank Richard Gao, Tammy Tran, and Tom Donoghue for invaluable
producing a more sinusoidal-like rhythm. They interpreted the discussion and comments on the manuscript.
GRANTS Cole SR, Donoghue T, Gao R, Voytek B. NeuroDSP: a package for neural
digital signal processing. J Open Source Softw 4: 1272, 2019. doi:10.21105/
S. Cole is supported by the National Science Foundation Graduate Research
joss.01272.
Fellowship Program and the University of California, San Diego Chancellor’s
Cole SR, van der Meij R, Peterson EJ, de Hemptinne C, Starr PA, Voytek
Research Excellence Scholarship. B. Voytek is supported by a Sloan Research
Fellowship, Whitehall Foundation Grant 2017-12-73, and National Science B. Nonsinusoidal beta oscillations reflect cortical pathophysiology in Par-
Foundation Grant 1736028. kinson’s disease. J Neurosci 37: 4830, 2017. doi:10.1523/JNEUROSCI.
2208-16.2017.
Cole SR, Voytek B. Brain oscillations and the importance of waveform shape.
DISCLOSURES Trends Cogn Sci 21: 137–149, 2017. doi:10.1016/j.tics.2016.12.008.
Cole SR, Voytek B. Hippocampal theta bursting and waveform shape reflect
No conflicts of interest, financial or otherwise, are declared by the authors. CA1 spiking patterns (Preprint). bioRxiv 452987, 2018. doi:10.1101/
452987.
de Hemptinne C, Swann NC, Ostrem JL, Ryapolova-Webb ES, San
AUTHOR CONTRIBUTIONS Luciano M, Galifianakis NB, Starr PA. Therapeutic deep brain stimula-
S.C. and B.V. conceived and designed research; S.C. performed experi- tion reduces cortical phase-amplitude coupling in Parkinson’s disease. Nat
ments; S.C. analyzed data; S.C. and B.V. interpreted results of experiments; Neurosci 18: 779 –786, 2015. doi:10.1038/nn.3997.
S.C. and B.V. prepared figures; S.C. and B.V. drafted manuscript; S.C. and Diez PF, Mut V, Laciar E, Torres A, Avila E. Application of the empirical
B.V. edited and revised manuscript; S.C. and B.V. approved final version of mode decomposition to the extraction of features from EEG signals for
manuscript. mental task classification. Conf Proc IEEE Eng Med Biol Soc 2009:
2579 –2582, 2009. doi:10.1109/IEMBS.2009.5335278.
Dvorak D, Fenton AA. Toward a proper estimation of phase-amplitude
ENDNOTE coupling in neural oscillations. J Neurosci Methods 225: 42–56, 2014.
doi:10.1016/j.jneumeth.2014.01.002.
At the request of the authors, readers are herein alerted to the fact that
Feingold J, Gibson DJ, DePasquale B, Graybiel AM. Bursts of beta
additional materials related to this manuscript may be found at: https://
oscillation differentiate postperformance activity in the striatum and motor
github.com/voytekresearch/Cole_2018_cyclebycycle. These materials are not
a part of this manuscript, and have not undergone peer review by the American cortex of monkeys performing movement tasks. Proc Natl Acad Sci USA
Physiological Society (APS). APS and the journal editors take no responsibil- 112: 13687–13692, 2015. doi:10.1073/pnas.1517629112.
ity for these materials, for the website address, or for any links to or from it. Fransen AM, van Ede F, Maris E. Identifying neuronal oscillations using
rhythmicity. Neuroimage 118: 256 –267, 2015. doi:10.1016/j.neuroimage.
2015.06.003.
REFERENCES Gao R, Peterson EJ, Voytek B. Inferring synaptic excitation/inhibition
balance from field potentials. Neuroimage 158: 70 –78, 2017. doi:10.1016/
Adrian ED, Matthews BH. The interpretation of potential waves in the j.neuroimage.2017.06.078.
cortex. J Physiol 81: 440 – 471, 1934. doi:10.1113/jphysiol.1934.sp003147. Gerber EM, Sadeh B, Ward A, Knight RT, Deouell LY. Non-sinusoidal
Amemiya S, Redish AD. Hippocampal theta-gamma coupling reflects state- activity can produce cross-frequency coupling in cortical signals in the
dependent information processing in decision making. Cell Reports 22:
absence of functional interaction between neural sources. PLoS One 11:
3328 –3338, 2018. [Erratum in Cell Reports 25: 3894 –3897, 2018.] doi:10.
e0167351, 2016. doi:10.1371/journal.pone.0167351.
1016/j.celrep.2018.02.091.
Gips B, Bahramisharif A, Lowet E, Roberts MJ, de Weerd P, Jensen O,
Amzica F, Steriade M. Electrophysiological correlates of sleep delta waves.
Electroencephalogr Clin Neurophysiol 107: 69 – 83, 1998. doi:10.1016/ van der Eerden J. Discovering recurring patterns in electrophysiological
S0013-4694(98)00051-0. recordings. J Neurosci Methods 275: 66 –79, 2017. doi:10.1016/j.jneumeth.
Atallah BV, Scanziani M. Instantaneous modulation of gamma oscillation 2016.11.001.
frequency by balancing excitation with inhibition. Neuron 62: 566 –577, Haller M, Donoghue T, Peterson E, Varma P, Sebastian P, Gao R, Noto T,
2009. doi:10.1016/j.neuron.2009.04.027. Knight RT, Shestyuk A, Voytek B. Parameterizing neural power spectra
Bajaj V, Pachori RB. Classification of seizure and non-seizure EEG signals (Preprint). bioRxiv 299859, 2018. doi:10.1101/299859.
using empirical mode decomposition. IEEE Trans Inf Technol Biomed 16: Hanslmayr S, Aslan A, Staudigl T, Klimesch W, Herrmann CS, Bäuml
1135–1142, 2012. doi:10.1109/TITB.2011.2181403. KH. Prestimulus oscillations predict visual perception performance between
Bartz S, Avarvand FS, Leicht G, Nolte G. Analyzing the waveshape of brain and within subjects. Neuroimage 37: 1465–1473, 2007. doi:10.1016/j.
oscillations with bicoherence. Neuroimage 188: 145–160, 2019. doi:10. neuroimage.2007.07.011.
1016/j.neuroimage.2018.11.045. Hentschke H, Perkins MG, Pearce RA, Banks MI. Muscarinic blockade
Belluscio MA, Mizuseki K, Schmidt R, Kempter R, Buzsáki G. Cross- weakens interaction of gamma with theta rhythms in mouse hippocampus.
frequency phase-phase coupling between and ␥ oscillations in the hip- Eur J Neurosci 26: 1642–1656, 2007. doi:10.1111/j.1460-9568.2007.
pocampus. J Neurosci 32: 423– 435, 2012. doi:10.1523/JNEUROSCI.4122- 05779.x.
11.2012. Hughes AM, Whitten TA, Caplan JB, Dickson CT. BOSC: a better oscil-
Bruns A. Fourier-, Hilbert- and wavelet-based signal analysis: are they really lation detection method, extracts both sustained and transient rhythms from
different approaches? J Neurosci Methods 137: 321–332, 2004. doi:10.1016/ rat hippocampal recordings. Hippocampus 22: 1417–1428, 2012. doi:10.
j.jneumeth.2004.03.002. 1002/hipo.20979.
Buzsáki G, Czopf J, Kondákor I, Kellényi L. Laminar distribution of Jackson N, Cole SR, Voytek B, Swann NC. Characteristics of waveform
hippocampal rhythmic slow activity (RSA) in the behaving rat: current- shape in Parkinson’s disease detected with scalp electroencephalography.
source density analysis, effects of urethane and atropine. Brain Res 365: eNeuro 6: ENEURO.0151-19.2019, 2019. doi:10.1523/ENEURO.0151-
125–137, 1986. doi:10.1016/0006-8993(86)90729-8. 19.2019.
Buzsáki G, Rappelsberger P, Kellényi L. Depth profiles of hippocampal Jas M, Tour T, Şimşekli U, Re G. Learning the morphology of brain signals
rhythmic slow activity (‘theta rhythm’) depend on behaviour. Electroen- using alpha-stable convolutional sparse coding (Preprint). arXiv 1705.
cephalogr Clin Neurophysiol 61: 77– 88, 1985. doi:10.1016/0013-4694(85) 08006, 2017.
91075-2. Jones SR. When brain rhythms aren’t ‘rhythmic’: implication for their mech-
Canolty RT, Edwards E, Dalal SS, Soltani M, Nagarajan SS, Kirsch HE, anisms and meaning. Curr Opin Neurobiol 40: 72– 80, 2016. doi:10.1016/
Berger MS, Barbaro NM, Knight RT. High gamma power is phase-locked j.conb.2016.06.010.
to theta oscillations in human neocortex. Science 313: 1626 –1628, 2006. Klimesch W. EEG alpha and theta oscillations reflect cognitive and memory
doi:10.1126/science.1128115. performance: a review and analysis. Brain Res Brain Res Rev 29: 169 –195,
Chandran KS S, Mishra A, Shirhatti V, Ray S. Comparison of matching 1999. doi:10.1016/S0165-0173(98)00056-3.
pursuit algorithm with other signal processing techniques for computation of Kramer MA, Tort AB, Kopell NJ. Sharp edge artifacts and spurious coupling
the time-frequency power spectrum of brain signals. J Neurosci 36: 3399 – in EEG frequency comodulation measures. J Neurosci Methods 170: 352–
3408, 2016. doi:10.1523/JNEUROSCI.3633-15.2016. 357, 2008. doi:10.1016/j.jneumeth.2008.01.020.
Latimer KW, Yates JL, Meister ML, Huk AC, Pillow JW. Single-trial spike positions. J Neurosci Methods 226: 15–32, 2014. doi:10.1016/j.jneumeth.
trains in parietal cortex reveal discrete steps during decision-making. Sci- 2014.01.006.
ence 349: 184 –187, 2015. doi:10.1126/science.aaa4056. Podvalny E, Noy N, Harel M, Bickel S, Chechik G, Schroeder CE, Mehta
Lee S, Jones SR. Distinguishing mechanisms of gamma frequency oscillations AD, Tsodyks M, Malach R. A unifying principle underlying the extracel-
in human current source signals using a computational model of a laminar lular field potential spectral responses in the human cortex. J Neurophysiol
neocortical network. Front Hum Neurosci 7: 869, 2013. doi:10.3389/fnhum. 114: 505–519, 2015. doi:10.1152/jn.00943.2014.
2013.00869. Ray S, Jouny CC, Crone NE, Boatman D, Thakor NV, Franaszczuk PJ.
Lewis LD, Weiner VS, Mukamel EA, Donoghue JA, Eskandar EN, Human ECoG analysis during speech perception using matching pursuit: a
Madsen JR, Anderson WS, Hochberg LR, Cash SS, Brown EN, Purdon comparison between stochastic and dyadic dictionaries. IEEE Trans Biomed
PL. Rapid fragmentation of neuronal networks at the onset of propofol- Eng 50: 1371–1373, 2003. doi:10.1109/TBME.2003.819852.
induced unconsciousness. Proc Natl Acad Sci USA 109: E3377–E3386, Samaha J, Postle BR. The speed of alpha-band oscillations predicts the
2012. doi:10.1073/pnas.1210907109. temporal resolution of visual perception. Curr Biol 25: 2985–2990, 2015.
Liang H, Bressler SL, Desimone R, Fries P. Empirical mode decomposition: doi:10.1016/j.cub.2015.10.007.
a method for analyzing neural data. Neurocomputing 65– 66: 801– 807, Sampson AL, Lainscsek C, Gonzalez CE, Ulbert I, Devinsky O, Fabó D,
2005. doi:10.1016/j.neucom.2004.10.077. Madsen JR, Halgren E, Cash SS, Sejnowski TJ. Delay differential
Lopes-dos-Santos V, van de Ven GM, Morley A, Trouche S, Campo- analysis for dynamical sleep spindle detection. J Neurosci Methods 316:
Urriza N, Dupret D. Parsing hippocampal theta oscillations by nested 12–21, 2019. doi:10.1016/j.jneumeth.2019.01.009.
spectral components during spatial exploration and memory-guided behav- Schaworonkow N, Nikulin VV. Spatial neuronal synchronization and the
ior. Neuron 100: 940 –952.e7, 2018. doi:10.1016/j.neuron.2018.09.031. waveform of oscillations: implications for EEG and MEG (Preprint).
Lozano-Soldevilla D, Ter Huurne N, Oostenveld R. Neuronal oscillations bioRxiv 401091, 2018. doi:10.1101/401091.
with non-sinusoidal morphology produce spurious phase-to-amplitude cou- Scheffer-Teixeira R, Tort AB. On cross-frequency phase-phase coupling
pling and directionality. Front Comput Neurosci 10: 87, 2016. doi:10.3389/ between theta and gamma oscillations in the hippocampus. Elife 5: e20515,
fncom.2016.00087. 2016. doi:10.7554/eLife.20515.
Massimini M, Huber R, Ferrarelli F, Hill S, Tononi G. The sleep slow Sherman MA, Lee S, Law R, Haegens S, Thorn CA, Hämäläinen MS,
oscillation as a traveling wave. J Neurosci 24: 6862– 6870, 2004. doi:10. Moore CI, Jones SR. Neural mechanisms of transient neocortical beta
1523/JNEUROSCI.1318-04.2004. rhythms: converging evidence from humans, computational modeling, mon-
Mazaheri A, Jensen O. Rhythmic pulsing: linking ongoing brain activity with keys, and mice. Proc Natl Acad Sci USA 113: E4885–E4894, 2016. doi:10.
evoked responses. Front Hum Neurosci 4: 177, 2010. doi:10.3389/fnhum. 1073/pnas.1604135113.
2010.00177. Siapas AG, Lubenov EV, Wilson MA. Prefrontal phase locking to hippocam-
Mazzoni A, Lindén H, Cuntz H, Lansner A, Panzeri S, Einevoll GT. pal theta oscillations. Neuron 46: 141–151, 2005. doi:10.1016/j.neuron.
Computing the local field potential (LFP) from integrate-and-fire network 2005.02.028.
models. PLoS Comput Biol 11: e1004584, 2015. doi:10.1371/journal.pcbi. Trimper JB, Stefanescu RA, Manns JR. Recognition memory and theta-
1004584. gamma interactions in the hippocampus. Hippocampus 24: 341–353, 2014.
Miller KJ, Leuthardt EC, Schalk G, Rao RPN, Anderson NR, Moran DW, doi:10.1002/hipo.22228.
Miller JW, Ojemann JG. Spectral changes in cortical surface potentials Uhlhaas PJ, Singer W. Abnormal neural oscillations and synchrony in
during motor movement. J Neurosci 27: 2424 –2432, 2007. doi:10.1523/ schizophrenia. Nat Rev Neurosci 11: 100 –113, 2010. doi:10.1038/nrn2774.
JNEUROSCI.3886-06.2007. van Dijk H, van der Werf J, Mazaheri A, Medendorp WP, Jensen O.
Nelli S, Itthipuripat S, Srinivasan R, Serences JT. Fluctuations in instan- Modulations in oscillatory activity with amplitude asymmetry can produce
taneous frequency predict alpha amplitude during visual perception. Nat cognitively relevant event-related responses. Proc Natl Acad Sci USA 107:
Commun 8: 2071, 2017. doi:10.1038/s41467-017-02176-x. 900 –905, 2010. doi:10.1073/pnas.0908821107.
Orosco L, Laciar E, Correa AG, Torres A, Graffigna JP. An epileptic Vaz AP, Yaffe RB, Wittig JH Jr, Inati SK, Zaghloul KA. Dual origins of
seizures detection algorithm based on the empirical mode decomposition of measured phase-amplitude coupling reveal distinct neural mechanisms un-
EEG. Conf Proc IEEE Eng Med Biol Soc 2009: 2651–2654, 2009. doi:10. derlying episodic memory in the human cortex. Neuroimage 148: 148 –159,
1109/IEMBS.2009.5332861. 2017. doi:10.1016/j.neuroimage.2017.01.001.
Park C, Looney D, ur Rehman N, Ahrabian A, Mandic DP. Classification Voytek B, D’Esposito M, Crone N, Knight RT. A method for event-related
of motor imagery BCI using multivariate empirical mode decomposition. phase/amplitude coupling. Neuroimage 64: 416 – 424, 2013. doi:10.1016/j.
IEEE Trans Neural Syst Rehabil Eng 21: 10 –22, 2013. doi:10.1109/TNSRE. neuroimage.2012.09.023.
2012.2229296. Voytek B, Kayser AS, Badre D, Fegen D, Chang EF, Crone NE, Parvizi J,
Peterson EJ, Voytek B. Alpha oscillations control cortical gain by modulating Knight RT, D’Esposito M. Oscillatory dynamics coordinating human
excitatory-inhibitory background activity (Preprint). bioRxiv 185074, 2017. frontal networks in support of goal maintenance. Nat Neurosci 18: 1318 –
doi:10.1101/185074. 1324, 2015. doi:10.1038/nn.4071.
Pfurtscheller G, Stancák A Jr, Edlinger G. On the existence of different Voytek B, Knight RT. Dynamic network communication as a unifying neural
types of central beta rhythms below 30 Hz. Electroencephalogr Clin basis for cognition, development, aging, and disease. Biol Psychiatry 77:
Neurophysiol 102: 316 –325, 1997. doi:10.1016/S0013-4694(96)96612-2. 1089 –1097, 2015. doi:10.1016/j.biopsych.2015.04.016.
Pietersen AN, Patel N, Jefferys JG, Vreugdenhil M. Comparison between Watrous AJ, Miller J, Qasim SE, Fried I, Jacobs J. Phase-tuned neuronal
spontaneous and kainate-induced gamma oscillations in the mouse hip- firing encodes human contextual representations for navigational goals
pocampus in vitro. Eur J Neurosci 29: 2145–2156, 2009. doi:10.1111/j. (Preprint). bioRxiv 202374, 2017. doi:10.1101/202374.
1460-9568.2009.06771.x. Womelsdorf T, Valiante TA, Sahin NT, Miller KJ, Tiesinga P. Dynamic
Pittman-Polletta B, Hsieh WH, Kaur S, Lo MT, Hu K. Detecting phase- circuit motifs underlying rhythmic gain control, gating and integration. Nat
amplitude coupling with high frequency resolution using adaptive decom- Neurosci 17: 1031–1039, 2014. doi:10.1038/nn.3764.