Skip to main content
Journal of Neurophysiology logoLink to Journal of Neurophysiology
. 2021 Aug 18;126(4):1190–1208. doi: 10.1152/jn.00201.2021

Within-cycle instantaneous frequency profiles report oscillatory waveform dynamics

Andrew J Quinn 1,, Vítor Lopes-dos-Santos 2, Norden Huang 3,4,5, Wei-Kuang Liang 5,6, Chi-Hung Juan 5,6, Jia-Rong Yeh 4,5, Anna C Nobre 1,7, David Dupret 2, Mark W Woolrich 1
PMCID: PMC7611760  EMSID: EMS133139  PMID: 34406888

graphic file with name jn-00201-2021r01.jpg

Keywords: EMD, instantaneous frequency, nonsinusoidal, oscillations, waveform shape

Abstract

The nonsinusoidal waveform is emerging as an important feature of neuronal oscillations. However, the role of single-cycle shape dynamics in rapidly unfolding brain activity remains unclear. Here, we develop an analytical framework that isolates oscillatory signals from time series using masked empirical mode decomposition to quantify dynamical changes in the shape of individual cycles (along with amplitude, frequency, and phase) with instantaneous frequency. We show how phase-alignment, a process of projecting cycles into a regularly sampled phase grid space, makes it possible to compare cycles of different durations and shapes. “Normalized shapes” can then be constructed with high temporal detail while accounting for differences in both duration and amplitude. We find that the instantaneous frequency tracks nonsinusoidal shapes in both simulated and real data. Notably, in local field potential recordings of mouse hippocampal CA1, we find that theta oscillations have a stereotyped slow-descending slope in the cycle-wise average yet exhibit high variability on a cycle-by-cycle basis. We show how principal component analysis allows identification of motifs of theta cycle waveform that have distinct associations to cycle amplitude, cycle duration, and animal movement speed. By allowing investigation into oscillation shape at high temporal resolution, this analytical framework will open new lines of inquiry into how neuronal oscillations support moment-by-moment information processing and integration in brain networks.

NEW & NOTEWORTHY We propose a novel analysis approach quantifying nonsinusoidal waveform shape. The approach isolates oscillations with empirical mode decomposition before waveform shape is quantified using phase-aligned instantaneous frequency. This characterizes the full shape profile of individual cycles while accounting for between-cycle differences in duration, amplitude, and timing. We validated in simulations before applying to identify a range of data-driven nonsinusoidal shape motifs in hippocampal theta oscillations.

INTRODUCTION

Frequency, phase, and amplitude have long been reported as important features of neuronal oscillations with behavioral and electrophysiological relevance. Furthermore, neuronal oscillations show nonsinusoidal waveform shapes that span a wide range of spatial and temporal scales (1). Although waveform shape is emerging as a fourth relevant feature of neuronal oscillations, many theories of neuronal oscillations currently assume sinusoidal waveforms. This might be due to the fact that characterizing and quantifying nonsinusoidal waveforms remains a substantial analytic challenge (1, 2). To uncover the role of waveform dynamics in rapidly unfolding brain activity, there is a growing need for novel analysis methods that are able to characterize a wide range of waveform shape features at the single-cycle level.

Waveform shape-related parameters, such as skewness or asymmetry, can be estimated from higher-order Fourier spectra such as the bispectrum or bicoherence (35). These methods require relatively long data segments to have high-frequency resolution and therefore do not provide single-cycle estimates. Alternatively, a set of waveform features for individual cycles can be described by the relative durations of different quartiles of a cycle (68). Control point-based analyses are clear, flexible, and tractable on single cycles but have the drawback that each individual feature must be defined a priori and be based on a limited number of cycle control points such as the extrema and zero-crossings.

The temporal dynamics in oscillatory frequency can be quantified for a given waveform by its instantaneous frequency computed from the differential of the signal’s instantaneous phase (9, 10). Such instantaneous frequency estimates have been used previously in electrophysiology to explore dynamics in oscillatory peak frequency at high temporal resolution (1114). Crucially, any nonsinusoidal waveform features in an oscillation will lead to within-cycle instantaneous frequency modulations in which the frequency of an oscillation changes from moment to moment within a single cycle (15). The degree of nonlinearity of an oscillation is related to the total amount of within-cycle frequency modulation (1619).

Accordingly, here we introduce a novel approach that creates waveform shape profiles to describe nonsinusoidal features in single cycles with high temporal details. To this end, we first operationalize waveform shape as the profile of instantaneous frequency across the cycle’s instantaneous phase. We then identify when and how an ongoing cycle deviates from a sinusoidal waveform by identifying points in the cycle where instantaneous frequency departs from a flat profile. Notably, a cycle with a wide peak has a relatively low instantaneous frequency around the peak, and a cycle with a fast-ascending edge has a relatively high instantaneous frequency between the trough and peak. Moreover, between-cycle comparison requires us to account for how different cycles of an oscillation play out at different speeds, leading to differences in extrema timing and overall duration. To overcome these problems, we thus also introduce the process of “phase-alignment,” which reregisters the instantaneous frequency profiles onto a regularly sampled set of points in the phase space.

To obtain the instantaneous phase time course of each cycle, we use empirical mode decomposition (EMD). EMD decomposes the time series of interest into its oscillatory modes [intrinsic mode functions (IMFs)] that retain the nonstationary and nonlinear signal features. The EMD and instantaneous frequency analysis are a promising tool for neuroscience and electrophysiology (12). The EMD has successfully been applied to electrophysiology data in a range of contexts including (but not limited to) rodent hippocampal theta oscillations (20), epileptic activity in human patients (21), transcranial magnetic stimulation (TMS)-evoked EEG responses (22), and assessment of instantaneous phase synchrony in intracranial EEG (23). We build on this prior work to introduce phase-aligned instantaneous frequency as a general measure of oscillatory waveform shape.

We outline and validate our novel approach in simulated data before applying it to theta-band oscillations recorded in the local field potentials (LFPs) of the mouse hippocampal CA1 during active exploratory behavior. The hippocampal theta rhythm has a characteristic nonsinusoidal waveform shape (6, 24, 25) that is modulated by movement (5) and changes in sleep or drug states (24). Using EMD to identify the theta rhythm, we show that phase-aligned instantaneous frequency is able to robustly characterize a continuous waveform shape profile for hippocampal theta. The results confirm the stereotyped fast-ascending and slow-descending shape in the cycle-wise average. Yet, the shape of single cycles of theta appears to be highly variable. We describe this variability with a set of data-driven shape “motifs.” Finally, we find that cycle-level shape motifs have differential associations with theta amplitude, theta cycle duration, and mouse movement speed. Overall, these findings show that behaviorally relevant dynamics in single-cycle oscillatory waveforms can be accurately and intuitively explored with phase-aligned instantaneous frequency profiles.

MATERIALS AND METHODS

Data and Code Availability Statement

Code for the analyses in this paper is freely available online (https://github.com/OHBA-analysis/Quinn2021_Waveform), and data are available from the MRC BNDU Data Sharing Platform (https://data.mrc.ox.ac.uk/data-set/instantaneous-frequency-profiles-theta-cycles; requires free registration). The analyses in this study were carried out in Python 3.7 with v0.4.0 of the EMD package (Ref. 26; https://emd.readthedocs.io/) and glmtools v0.1.0 for general linear model (GLM) design and fitting (https://pypi.org/project/glmtools/). The wavelet transforms and principal component analysis (PCA) were computed with SAILS v1.1.1 (27). The underlying Python dependencies were NumPy (28) and SciPy (29) for computation and Matplotlib (30) for visualization.

Masked Empirical Mode Decomposition Methods

The EMD is implemented as a sifting algorithm that incrementally extracts the highest-frequency features of a time series into its oscillatory components known as IMFs (15). Once identified, the IMF is subtracted from the signal and the sifting process repeated to find the next-fastest set of oscillatory dynamics. This process is iterated through until only a residual trend remains in the data set, constituting the very slowest dynamics of the signal.

Transient or intermittent oscillatory signals can lead to a mix of different frequency components appearing in a single IMF, an issue known as mode mixing (31, 32). Specifically, the sift algorithm always looks to identify the highest-frequency component in a signal; however, if the high-frequency oscillation is transient, then lower-frequency oscillations may jump into the IMF during time periods when the high-frequency signal is not present. To reduce this mode mixing, we use an adapted version of the mask sift (17, 31). The masked (m)EMD involves the same core process as the original sift outlined above. However, at each iteration, a masking signal is added to the data before all the extrema (maxima and minima) in the masked signal are identified. The mask is a simple sinusoid that acts to prevent lower-frequency components from entering an IMF. During time periods with high-frequency activity, the mask sift will return the sum of the high-frequency signal and the mask. As the mask is known, it can be removed by simple subtraction. When there is no high-frequency activity, the mask sift will return only the mask signal. As such, the mask signal is able to prevent mixing between transient oscillatory components (31, 37). The mask sift algorithm is described in pseudocode and a flowchart in Supplemental Material Section 8.1 (all Supplemental Material is available at https://doi.org/10.6084/m9.figshare.15028986).

The performance of the sift is limited by a number of factors such as accuracy in peak detection and overshoot or edge effects in the envelope interpolation. As such, when applied to real data, the sift may not always perfectly isolate individual oscillations. Specifically, the EMD algorithm depends upon accurate estimation of the local mean of a signal, which is limited by a number of factors in real data analysis. The most critical step is ensuring accurate upper and lower envelope estimation. The cubic spline is typically used for this, although it does not preserve monotonicity between the original and interpolated signal. For example, if three points are strictly ascending in the original signal the cubic spline cannot guarantee that the interpolated signal will also be strictly ascending. This can lead to parts of the interpolation exaggerating dynamics in the envelope by causing overshoot and potentially leading to the upper and lower envelopes crossing over. The monotonic PCHIP (33) interpolation does preserve monotonicity and provides a more stable envelope in noisy data (see Supplemental Fig. S2 for an illustration).

Frequency transformation.

The analytic form of each IMF was constructed with the Hilbert transform and the instantaneous phase set as the angle of the analytic form on the complex plane (see Fig. 3C for an example). To attenuate noise in the phase estimation, the unwrapped phase time course was smoothed with a Savitzky-Golay filter (scipy.signal.savgol_filter; order = 1, window size = 3 samples). The instantaneous frequency (IF) (see Fig. 3D for an example) in hertz is then computed from the derivative of this unwrapped phase:

IF= fs2πd(t)dt

where fs is the sampling frequency, t is time in samples, and Ø(t) is the unwrapped instantaneous phase time course. The instantaneous amplitude time course is computed as the absolute value of the analytic form of each IMF.

Figure 3.

Figure 3.

Instantaneous frequency analysis on a noisy nonsinusoidal oscillation. A simulated 12-Hz oscillation can be extracted from a noisy time series and represented with empirical mode decomposition (EMD), instantaneous frequency, and the Hilbert-Huang transform (HHT). Vertical gray lines denote the starting times of individual cycles across the different panels. A: the simulated noisy nonsinusoidal oscillation. B: intrinsic mode function (IMF)-3 extracted from A containing the simulated oscillation. C: instantaneous phase time course of IMF-3. Cycles excluded from further analysis are indicated in red. In this case, these cycles were below the amplitude threshold. D: instantaneous frequency time course of IMF-3. E: HHT of the simulated data segment. F: continuous wavelet transform (CWT) of the simulated data segment.

The distribution of instantaneous amplitude values by frequency or time and frequency can be computed from these instantaneous frequency metrics. A sparse matrix H ∈ R^(T × F) is filled with the instantaneous amplitude values from the IMFs at their respective time and frequency coordinates. This matrix is the Hilbert-Huang transform (HHT; see Fig. 3E for an example) and provides an alternative time-frequency transform to traditional Fourier-based methods such as the short-time Fourier transform and the wavelet transform (15).

Cycle detection.

The next stage is to segment the IMFs into their constituent cycles and identify which cycles will be included in further analysis. The start and end of theta cycles are located by the differentials greater > 6 in the phase. The start and end point of cycles in this article is the ascending zero-crossing, as this occurs at the point where the phase time course wraps. Once identified, some cycles will be “bad” in the sense that the oscillation captured by the IMF is not well represented, e.g., because the rhythm is not present over that time period or it is poorly estimated, and will be excluded from subsequent analyses. This is important for instantaneous frequency analyses, as the differentiation step (see Frequency transformation) can be very noise sensitive. Included cycles are identified from the wrapped instantaneous phase time course of the IMF containing the oscillation to be analyzed. As the instantaneous phase computation via the Hilbert transform returns a value for every sample regardless of whether a prominent rhythm is present, only “good” theta cycles are retained for further analysis. A good cycle is defined as having a phase with a strictly positive differential (i.e., no phase reversals) that starts with a value 0 ≤ x ≤ π/24 and ends within 2π − π/24 ≤ x ≤ 2π and four control points (peak, trough, ascending edge, and descending edge).

Control point analysis.

One approach to quantifying oscillatory waveforms is to compare the relative timings of the peak, trough, ascending zero-crossing, and descending zero-crossing within each cycle (6, 7). These four control points can be straightforwardly identified in each cycle and used to summarize waveform shape by a range of different metrics. The ratio of temporal durations between these control points can describe large-scale shape features. In the present analyses, the extrema (peaks and troughs) are detected by finding the samples closest to a zero-crossing in the differential of an IMF. It is unlikely that the peak or trough occurs exactly coincident with timing of the sampling during data acquisition, so the extrema locations are refined to a point between samples by parabolic interpolation (34). The zero-crossings are initially identified from sign changes in the IMF time course and refined by linear interpolation between the samples around the zero-crossing. Finally, we use these single-cycle timings to compute the peak-to-trough ratio and the ascent-to-descent ratio for each cycle (7).

Phase-alignment.

We present an alternative approach to control points that ensures that entire waveform profiles can be combined and/or compared across cycles despite cycle-by-cycle differences in progression rate and overall duration. To compare waveforms across cycles that play out at different speeds, we use phase-alignment to register cycles onto a common grid. Phase-alignment is performed on the instantaneous phase of a cycle and a measure of interest, such as the instantaneous frequency, that is observed at the same time intervals. A linear one-dimensional interpolation function is fitted between the instantaneous phase (as x values) and the instantaneous frequency (as y values). The interpolation function is evaluated on a template set of instantaneous phase values with a linear spacing between 0 and 2π; if any points in the template fall outside the fitted range, the interpolator returns an extrapolated value. This interpolated version of instantaneous frequency is then directly comparable across cycles, as each point in the phase will occur at the same time. We compute phase-alignment using a linear interpolation across 48 fixed points across the 0 to 2π phase range.

Once an instantaneous frequency profile has been phase-aligned, we can visualize a normalized waveform by projecting the frequency content back to a phase time course. This is achieved by renormalizing the instantaneous frequency from hertz back to radians in order to create a profile of successive phase differences. The phase time course is then reconstructed from the cumulative summation of these phase differences. An oscillatory waveform can then be computed by taking the sine transform of this phase time course. The resulting waveform has an amplitude of 1 and a consistent time axis for all cycles. This “normalized waveform” allows for visualization of shape between cycles with different durations and amplitudes.

Describing shape with an instantaneous frequency mean vector.

A simplified summary of a cycle’s shape can be computed from a mean vector of the phase-aligned instantaneous frequency according to the following equation:

mean vector= IF¯ei¯

where ¯ is the uniform phase grid used in phase-alignment and IF¯ is the phase-aligned instantaneous frequency. This is similar to the mean vector approach to computing phase-amplitude-coupling (35). The mean vector of a sinusoidal cycle will be 0, whereas a nonsinusoidal cycle will return a complex value whose angle indicates which phase has the highest instantaneous frequency and the magnitude indicates the extent of the frequency modulation through the cycle. This method provides a straightforward summary but is only sensitive to unimodal deviations from a flat instantaneous frequency profile.

The mean vectors of many cycles can be visualized by a scatterplot in a two-dimensional space. The real and imaginary parts of the complex valued mean vector are plotted on the x and y-axes, respectively. A sinusoidal cycle would have a mean vector of 0 and appear at the origin on this space. Nonzero real values on the x-axis indicate the ascending-to-descending edge asymmetry in the cycle, and nonzero imaginary values on the y-axis indicate peak-to-trough asymmetry.

Principal component shape motifs.

The phase-aligned instantaneous frequency profiles provide a detailed description of each cycle’s shape, but additional analyses are required to identify any trends or consistencies across cycles within a data set. Here, we look to take a data-driven approach to describe the main characteristics of oscillatory waveform in our simulated and real data sets.

We used principal component analysis (PCA) to identify the principal modes of variation in shape across the included cycles. Phase-aligned cycles are concatenated into a single matrix of size [n phases × n cycles]. The second dimension of this matrix (across cycles) is reduced to PCA, resulting in a [n phases × n components] matrix of shape “motifs.” Each component motif is defined by the distribution of component weights across phase and an [n components × n cycles] matrix of principal component (PC) scores indicating the presence of each component motif in each individual cycle. The shape of each individual cycle can then be approximated by a linear combination of each shape motif weighted by the cycle’s component scores.

The PCA allows us to straightforwardly visualize the range of shapes within each data set using the components and their dynamics over time using the scores. The shapes represented by each component motif can be visualized by defining a set of scores containing the maximum or minimum observed score for the PC in question and zeros for all others. These scores can be projected back into the original data space to provide exemplar instantaneous frequency profiles for both extremes of the PC axes. These exemplar instantaneous frequency profiles can be projected back into the time domain to generate a normalized waveform that preserves the shape depicted in the exemplar instantaneous frequency profiles. The dynamics of each shape across cycles are represented by the PC scores. The relationship between these dynamics and other factors such as movement speed, theta amplitude, and theta duration are quantified in the general linear model analysis described in Hippocampal Theta Analyses, Cycle detection.

Simulation Analyses

Schematic cycle generation.

To illustrate the relationship between waveform shape, instantaneous phase, and frequency, a set of noise-free oscillations were generated. First, a linearly progressing phase time course is generated, and a sinusoid is created by taking a sine-transform of this wrapped phase. Different nonsinusoidal cycles are generated by modulating the unwrapped phase time course by sine and cosine waves at different phases and frequencies. The cycles with extrema and edge asymmetry are generated by modulating the phase with a 1-Hz sine or cosine, respectively. The extrema curvature examples are generated by modulating the linear phase with a 2-Hz sinusoid. From the computed cycle time courses the instantaneous phase and instantaneous frequency are reestimated with the Hilbert transform. Finally, the waveform shape is represented by phase-aligning the instantaneous frequency time course of each cycle type with its instantaneous phase.

Noisy signal generation.

A more realistic noisy simulation was used for the results in Figs. 3 and 4. A simulated oscillation at 12 Hz was generated using an autoregressive oscillator with the following transfer function:

H(f)= 112r cosθ+ r2

where θ is the angular frequency of the oscillator (in rad/s) and r is the magnitude of the roots of the polynomial (0 < r < 1). For this simulation, we computed H for r = 0.95 and θ equivalent to 12 Hz and used its parameters to filter (a forward and backward filter using scipy.signal.filtfilt) white noise. This generates a noisy sinusoidal oscillation that contains random dynamics in the frequency and amplitude of each oscillatory cycle. Sixty seconds of data was generated at 512 Hz.

Figure 4.

Figure 4.

Methods for comparing waveform across cycles: simulated data illustrating how waveform shape can be quantified with control point ratios, instantaneous frequency, and phase-alignment. A: distribution of the peak-to-trough and ascent-to-descent ratios for the simulated data set. B: the timing of the control points used to create the ratios in A for an illustrative subset of the cycles. C, top: average temporally aligned signal waveform. Bottom: average temporally aligned instantaneous frequency (IF) profiles. D: illustration of single-cycle temporally aligned instantaneous frequency profiles for an illustrative subset of the cycles. E, top: average phase-aligned signal waveform. Bottom: average phase-aligned instantaneous frequency profile. F: illustration of single-cycle phase-aligned instantaneous frequency profiles for an illustrative subset of the cycles. a.u., Arbitrary units; Num Cycles, number of cycles.

This simulated oscillation was then modulated by one of two equations defined in equations 50.24 and 50.25 in section 50-6 in volume 1 of The Feynman Lectures on Physics (36). The first equation defines a linear system that scales the signal by a constant, leaving the waveform shape unchanged:

xout =Kxin+e(t)

and the second equation defines a nonlinear system that includes a term inducing a change in waveform shape as well as scaling the signal:

xout =K[xin+ ϵxin2]+e(t)

The nonlinearity in the second equation makes the peak of the oscillations shorter and widens the trough. Both systems include an additive white noise term.

Finally, a signal with dynamic waveform shape changes was created for the results in Fig. 5. A dynamic oscillation was generated at 12 Hz with the autoregressive oscillator method before phase of this signal was estimated with the Hilbert transform. Each cycle was then randomly assigned to a “sinusoidal,” “fast ascending,” or “fast descending” category. The phase of the nonsinusoidal cycles was modulated by using an additive sinusoid in the same manner as the schematic cycle generation in Schematic cycle generation. Additional Gaussian noise was then added to this dynamically nonsinusoidal signal.

Figure 5.

Figure 5.

Quantifying dynamics in waveform shape. A: a simulated oscillation contains cycles that are sinusoidal or contain a ascending-to-descending edge asymmetry. The raw signal is shown (black line) with the empirical mode decomposition (EMD)-extracted intrinsic mode function (IMF, red) and instantaneous frequency (blue). The principal component analysis (PCA) component score for each cycle is shown in the bar plot. B: normalized waveforms for principal component (PC)-1 of the simulated data. This shows that the component captures a continuum between a fast-ascending and a fast-descending shape. C: the component shape for component 1, showing that the component score leads to a difference in instantaneous frequency between the ascending and descending phases of the cycle. D: the component score distribution for each of the known shape categories. E: the relationship between the data-driven PC score and the a priori-defined ascent-to-descent ratio. a.u., Arbitrary units.

Noisy signal analysis.

The simulations are separated into IMFs with the masked sift. The relatively straightforward dynamics in this simulation allow a simplified mask sift to be applied. To define the mask frequencies, a first IMF is extracted with the standard sift routine. The number of zero-crossings in this IMF defines the frequency of the initial mask, with subsequent masks being applied at half the frequency of the previous one. The mask amplitudes are set equivalent to 1-standard deviation of the previously extracted IMF.

The 12-Hz oscillation is isolated in the third IMF (IMF-3) of this mask sift. The frequency transformation of this IMF is computed with the Hilbert transform (see Frequency transformation). The Hilbert-Huang transform (HHT) is computed using 64 frequency bins between 2 and 35 Hz. A wavelet transform was computed with a 5-cycle Morlet basis computed using the same 64 frequencies as the HHT.

The timing of individual oscillatory cycles is identified using the phase jumps in the instantaneous phase time course where the oscillatory amplitude was above a threshold of 0.04 and instantaneous frequency below 18 Hz. We compute control point ratios (see Control point analysis), time-locked instantaneous frequency profile, and phase-aligned instantaneous frequency profile (see Phase-alignment) across all included cycles (see Masked Empirical Mode Decomposition Methods, Cycle detection) of IMF-3.

The sift, frequency transform, cycle detection, and shape metrics are computed for both the static and dynamic systems defined in Noisy signal generation. The control point metrics and phase-aligned instantaneous frequency profiles are computed from the static signal. Finally, the PCA shape motif method is applied to the phase-aligned instantaneous frequency profiles of the cycles in the dynamic signal. Component scores and normalized waveforms are computed from the first principal component. The component scores are then compared to the known cycle shape categories and with the ascending-to-descending asymmetry control point ratio.

Hippocampal Theta Analyses

Animals.

The data used here were obtained from the previous study by Lopes-dos-Santos et al. (20). Animals were male adult (4–7 mo old) C57BL/6J mice (Charles River, UK) or transgenic heterozygous Cre-driver mice [Jackson Laboratories; obtained from C57BL/6J crossed with CamKIIa-Cre B6.Cg-Tg(Camk2a-cre)T29-1Stl/J, stock number 005359, RRID: IMSR_JAX:005359]. All animals had free access to water and food in a dedicated housing facility with a 12:12-h light-dark cycle (lights on at 7:00), 19–23°C ambient temperature, and 40–70% humidity. All mice were held in individually ventilated cages with wooden chew sticks and nestlets. The experimental procedures performed on these mice were conducted in accordance with the Animals (Scientific Procedures) Act, 1986 (United Kingdom), with final ethical review by the Animals in Science Regulation Unit of the UK Home Office.

Local field potentials.

Local field potentials (LFPs) were recorded from the pyramidal layer of hippocampal CA1 with multichannel tetrodes (20). Recordings were made during open-field exploration in both familiar and novel environments across two recordings taken from each of three mice to make a total of six analyzed data sets. Further data acquisition details can be found in Ref. 20 and the Supplemental Materials (Section 8).

Mask sift and frequency transform.

LFP recordings were each separated into oscillatory components with the mask sift (Fig. 1, A and B), with masks placed at f_m = [350, 200, 70, 40, 30, 7, 1 Hz]. These masks were selected to capture components with frequencies above the mask frequency down to ∼f_m × 0.7 (37, 38). Keeping the masks constant across recordings ensures that the frequency content of each IMF will be comparable across recordings. For instance, we isolate the theta oscillation in IMF-6 with a mask frequency of 7 Hz. These mask frequency parameters were validated by rerunning the phase-aligned instantaneous frequency analyses with jittered mask frequencies (Supplemental Material Section 8.3; Supplemental Fig. S3), showing that the theta waveform description is robust to reasonable changes to the mask frequency values. These mask frequencies were effective in this set of CA1 LFP recordings, but it is expected that a different set of mask frequencies would be needed to analyze time series containing different oscillatory dynamics. Next, a frequency transformation was computed for each IMF with the Hilbert transform and the methods from Frequency transformation (Fig. 1C).

Figure 1.

Figure 1.

Overview of the analysis framework applied to local field potential (LFP) recordings of hippocampal theta. A: the raw input LFP recording. B: the raw signal is split into intrinsic mode functions (IMFs) with a mask sift. C: an instantaneous phase and instantaneous frequency time course is estimated from the theta IMF with the Hilbert transform. D: cycle start and stop times are identified from jumps in the wrapped phase time course, and “bad” cycles with distortions of reversals in phase are identified and removed. E: control points (peaks, troughs, ascending zero-crossings, and descending zero-crossings) are estimated from the good cycles within the theta IMF. Shape is then summarized with peak-to-trough and ascending-to-descending duration ratios. F: the instantaneous frequency of each good cycle is phase-aligned to correct for variability in cycle duration and internal cycle timings. G: the phase-aligned cycles are stacked into a single array to allow for straightforward comparisons between cycles. H: the phase-aligned instantaneous frequency of a group of cycles ready for comparison. I: a set of shape motifs are identified from the matrix in H with principal components analysis (PCA). a.u., Arbitrary units; EMD, empirical mode decomposition.

Cycle detection.

To ensure that the detected theta cycles are physiologically interpretable theta activity, we identified cycles in each recording during times when the speed of movement of the mouse was >1 cm/s. As faster movement is associated with stronger theta oscillations, this restriction increases the probability that our detected cycles represent physiologically interpretable theta events. We additionally restricted analyses to cycles in IMF-6, where cycle duration corresponded to the 4–11 Hz frequency range (i.e., 312 and 113 samples, respectively) and cycle amplitude was above the bottom 10% of the amplitude distribution. Finally, cycles that failed the cycle inclusion checks outlined in Masked Empirical Mode Decomposition Methods, Cycle detection were removed from analysis at this point (Fig. 1D).

Cycle comparisons.

We computed the temporally aligned instantaneous frequency profile, phase-aligned instantaneous frequency profile, and normalized waveform for each included theta cycle. The average waveform shape within each data set was estimated from the averaged phase-aligned instantaneous frequency (Fig. 1, F and G) and a group average constructed from the mean of the six individual runs. Variability in waveform shape across single cycles in the group data is summarized with the instantaneous frequency mean vector (see Describing shape with an instantaneous frequency mean vector) and visualized as a distribution in the complex plane in which the x-axis represents asymmetry between ascending and descending edge frequency and the y-axis represents asymmetry between peak and tough frequency. For comparison, we also identified the control points from each cycle of the theta IMF and constructed the peak-to-trough and ascending-to-descending duration ratios (7).

Waveform motifs and relation to behavior.

We next look to explore the waveform shapes that are present in the phase-aligned instantaneous frequency values. We use PCA (see Principal component shape motifs) to identify the data-driven set of shape components that explain the most variance in the shape of theta cycles in this data set (Fig. 1H). The first four principal components explaining 95% of variance defined our four shape motifs and were retained for further analysis. The reproducibility of the PCA is validated across 500 split-half iterations assessing the proportion of variance explained by each PC and the correspondence between the component shape in the two halves (Supplemental Material Section 8.3, Supplemental Fig. S3).

We next use a general linear model (GLM) to quantify how between-cycle variability in the shape motifs relates to other behavioral and electrophysiological covariates (i.e., cycle amplitude, cycle duration, and mouse movement speed). The GLM was created with a design matrix containing the mean and the three z-transformed covariates. These predictors were used to model the between-cycle variability in the principal component (PC) scores for each shape component in turn. This resulted in four GLMs each fitting four parameter estimates, one mean term and three parametric effects. The GLM parameters were fitted with a ordinary least squares algorithm implemented in Python (https://pypi.org/project/glmtools/). The t statistic of each parameter estimate was computed and statistical significance established with a row-shuffle nonparametric permutation scheme. Each of the three parametric regressors was permuted separately, only shuffling values within the regressor of interest for that permutation while keeping the covariate structure constant. Five thousand permutations were computed for each PC motif and dependent variable before the threshold for statistical significance was determined at P < 0.01. The observed t statistics from the unshuffled data was then compared to this critical value to identify which effects could be considered statistically significant.

RESULTS

Instantaneous Frequency Tracks Waveform Shape

Figure 2 illustrates how instantaneous frequency reflects waveform shape in a set of noiseless simulated cycles (see Schematic cycle generation). A sinusoidal cycle (Fig. 2A) has a monotonically progressing phase time course that, in turn, has a flat instantaneous frequency profile. Analysis of the duration of different segments reveals that the peak, trough, ascending edge, and descending edge all have the same duration. Cycles with a narrow peak, trough, or descending edge show corresponding changes in their instantaneous frequency (Fig. 2, B and C). Specifically, the longer-duration, slower features correspond to a lower instantaneous frequency. These instantaneous frequency profiles can describe a wide range of possible shapes. For example, cycles in which both the peak and trough are widened or pinched lead to instantaneous frequency profiles with multiple extrema (Fig. 2, far right). Although the simple control point metrics used here can track individual waveform features such as peak or trough duration (Fig. 2, bottom), the quantification of more complex shapes would require the definition of additional control points and shape metrics.

Figure 2.

Figure 2.

Instantaneous frequency changes with oscillatory waveform shape. The 4 columns illustrate examples of different simulated oscillatory cycles with distinct waveform shapes. A: the time-domain waveforms for each cycle. The first column shows a sinusoid, and the remaining 3 columns show pairs of cycles with opposite waveform distortions (for reference, a sinusoid is shown as a dotted black line). B: the instantaneous phase time course of the signals in the corresponding column. C: the instantaneous frequency time course of the signals in the corresponding column. D: the durations between different control points for each cycle; the dotted line indicates the expected duration for a sinusoid.

Quantifying and Comparing Waveform Shape in a Simulated Signal

We next use simulations to illustrate how instantaneous frequency analyses can be conducted on a noisy signal with a dynamic 12-Hz oscillation modified by a nonlinearity that widens the trough of each cycle (see Noisy signal generation). This oscillation was isolated from the noisy background by mask sift (Fig. 3B) before the Hilbert transform was used to compute the instantaneous phase time course (Fig. 3C). It is evident that the phase time courses do not progress linearly through all cycles; these deviations from monotonic phase progression are quantified in the instantaneous frequency time course (Fig. 3D). Instantaneous frequency sweeps within a single cycle reflect the nonsinusoidal shapes of the time-domain waveforms. For this simulation, the instantaneous frequency tends to be higher during the first half of the cycle and lower in the second half, reflecting the nonlinearity that shortens the peak and widens the trough of these oscillations.

The HHT of the simulated signal (Fig. 3E) retains the high time-frequency resolution of the instantaneous frequency time course, allowing within-cycle frequency dynamics to be visible. In contrast, although a standard 5-cycle Morlet wavelet transform identifies similar power dynamics, variability in frequency within single cycles is not resolved (Fig. 3F). A further disadvantage is that the nonsinusoidal waveform shape of this simulation introduces a 24-Hz harmonic component into the wavelet transform.

Individual cycles of an oscillation play out at different rates leading to differences in the timing of extrema within cycles and in overall cycle duration. These two sources of variability hamper comparisons between individual oscillatory cycles. As outlined above (Control point analysis), one method to solve this issue is to discretize the cycle using a set of control points before computing the proportion of time spent in different segments of the cycle (6, 7). The cycle phase quartiles (ascending zero-crossing, peak, descending zero-crossing, and trough) of 500 cycles of the simulated signal are shown in Fig. 4A. The ratio between peak and trough duration suggests that these cycles have relatively long troughs, whereas the ratio between ascending and descending duration suggests that the rising and falling phases are approximately equal in duration (Fig. 4B).

An alternative approach for comparing cycles is to align the instantaneous frequency profiles to one of the control points. For example, we aligned the 500 cycles to the ascending zero-crossing and computed their time-locked average (Fig. 4C). The time-locked instantaneous frequency profile of these cycles is not flat, reflecting the presence of nonsinusoidal shape in this simulated signal. However, the precise type of nonsinusoidal shape is ambiguous from this average, because of variability in the location of different waveform features within single cycles. In this case, the instantaneous frequency is highest ∼10 samples after the ascending zero-crossing; however, this time lag might correspond to different points in the waveform in different cycles. In addition, variability in the duration of cycles means that, after a certain point, different numbers of cycles contribute to the average, making the estimate unstable.

Here we present an approach that overcomes these shortcomings. In brief, phase-alignment removes this ambiguity by visualizing the instantaneous frequency of a cycle across a fixed grid of points along its phase (see Control point analysis). For instance, an oscillatory peak is normalized to occur at the same phase value irrespective of the cycle’s duration or shape. This corresponds always to exactly one quarter of the phase of each cycle but not necessarily to one quarter of the duration of each cycle. By aligning the instantaneous frequency to the phase, we remove the temporal distortions caused by varying shapes and cycle durations and express the shape with the phase-aligned instantaneous frequency values. The phase-aligned instantaneous frequency of the simulated cycles (Fig. 4D) now unambiguously shows increased frequency around the peak of the 12-Hz oscillation and decreased frequency around the trough. The average across the phase-aligned cycles is then a smooth representation of the shape of the entire cycle.

Comparisons between sets of cycles is straightforward once waveform shape has been estimated from instantaneous frequency and normalized through phase-alignment. This is illustrated in a simulation containing dynamic changes in oscillatory waveform shape (see Noisy signal generation; Fig. 5A). Differences in the ascending and descending durations can be seen between cycles in both the raw time course and the extracted IMF. Modulations in instantaneous frequency track these dynamics. A principal component analysis of the phase-aligned instantaneous frequency profiles of 60 s of simulated data is able to quantify these dynamics. The component score clearly tracks the differences in waveform, with fast-ascending cycles having large negative scores, fast-descending cycles having large positive scores, and sinusoids having scores close to 0. The normalized waveform and component shape confirm that the first component of this analysis represents a shape dimension ranging between fast-ascending and fast-descending shapes (Fig. 5, B and C). The PC score varies strongly among the three shape categories (Fig. 5D) and shows a very close correspondence to the more targeted ascending-to-descending duration control point ratio (Pearson’s r = 0.945; Fig. 5E). This demonstrates that the phase-aligned instantaneous frequency profile can distinguish different waveform shapes in cycles with rapidly changing shapes. Moreover, it is able to do so in a data-driven way, without prespecification of the potential shape of interest.

Characterizing Waveform Shape in Hippocampal Theta

LFP data recorded from the mouse hippocampus were analyzed to explore the utility of phase-aligned instantaneous frequency as a measure of waveform shape. Figure 6A shows a 3-s LFP recording from the pyramidal layer of the mouse dorsal CA1 (Fig. 6A, black) overlaid with the EMD-extracted theta IMF (Fig. 6A, red; Fig. 6B shows all IMFs). In this case, the theta oscillation was isolated into IMF-6 with minimal disruption to its amplitude or waveform shape dynamics. Many of the theta cycles within this window have prominent nonsinusoidal waveform shapes, which are qualitatively visible in both the raw data trace (24, 39) and the EMD-extracted theta IMF. Importantly, the oscillatory waveform shape varies between successive cycles, although the amplitude and duration of the theta cycles are relatively consistent.

Figure 6.

Figure 6.

Empirical mode decomposition (EMD) analysis of a local field potential (LFP) segment containing hippocampal theta oscillations. A: a segment of a hippocampal LFP recording (black) overlaid with the extracted theta oscillation (red). B: intrinsic mode functions (IMFs) extracted from this data segment with the masked EMD. The theta oscillation is isolated into IMF-6. C: instantaneous phase time course of the theta IMF. D: instantaneous frequency time course of the theta IMF. E: variability in instantaneous frequency for each theta cycle. F: Hilbert-Huang transform (HHT) of the LFP segment. G: continuous wavelet transform (CWT) of the LFP segment.

The instantaneous phase (Fig. 6C) and instantaneous frequency (Fig. 6D) were computed from the theta oscillation in IMF-6. As with the simulation analysis, any within-cycle dynamics in the instantaneous frequency naturally represent the waveform of each cycle. This was summarized with the standard deviation of instantaneous frequency values within each cycle (Fig. 6E). As an illustration, cycles 5, 9, and 11 have relatively sinusoidal shapes with flat instantaneous frequency profiles and low frequency variability. In contrast, cycle 13 is relatively nonsinusoidal with a dynamic instantaneous frequency profile and high frequency variability. The HHT provides a time-frequency description with sufficient resolution to depict these within-cycle instantaneous frequency sweeps (Fig. 6F). In contrast, a 5-cycle Morlet wavelet transform of the same data was not able to resolve these dynamics (Fig. 6G). Note that, although some 20-Hz power is present in the Hilbert-Huang transform, this reflects oscillatory activity with extrema distinct from the theta base signal (see Supplemental Material Section 8.4, Supplemental Fig. S4).

Looking at individual cycles illustrates how instantaneous frequency can characterize waveform shape (Fig. 7). Frequency increases and decreases correspond to slowing down and speeding up of the cycle as its waveform shows nonsinusoidal behavior. It is evident that there are many observed shape profiles. For instance, the cycles labeled as i and iii in Fig. 7 had frequencies that dip during the center of the cycle, indicating an elongated, low-frequency descending edge. Cycle v had slowest frequency around −π/2, corresponding to a wide peak. In contrast, cycle vi had relatively high frequency around −π/2 and lower frequency at +π/2, leading to a short, pinched peak and an elongated trough. Overall, the phase-aligned instantaneous frequency profiles and normalized waveforms provide a rich description of oscillatory waveform, despite wide variability in cycle amplitude, duration, and shape.

Figure 7.

Figure 7.

Characterizing shape in 8 example cycles (cycles i–viii) of hippocampal theta: 8 representative theta cycles. For each example, the raw data (gray) with the theta intrinsic mode function (IMF) superimposed (colored line) is shown on left; the phase-aligned instantaneous frequency (IF) is shown at center; and the normalized waveform (colored line) with a sinusoid for reference (black dotted line) is shown on right.

Using Phase-Aligned Instantaneous Frequency to Compare Cycles

We next computed waveform shape from ∼1,500 hippocampal theta cycles from a single recording using three different methods: control point ratios (see Principal component shape motifs), control point locking, and phase-alignment (see Control point analysis). The peak-to-trough and ascent-to-descent ratios (Fig. 8A) were computed from the durations between specified control points for each cycle (Fig. 8B). A pair of one-sample t tests against a mean value of 0.5 was used to assess whether the mean of these ratios is significantly different from the value of a sinusoid. The peak-to-trough ratios (mean = 0.49, standard deviation = 0.08) showed a small shift toward a wider peak value, t(2,513) = –2.66, P = 0.008. The ascent-to-descent ratios (mean = 0.45, standard deviation = 0.096) showed a substantial shift toward longer descending cycles, t(2,513) = −24.12, P < 0.0001. The instantaneous frequency profiles locked to the ascending zero-crossing show a wide variety of shapes with a group average tendency for frequency to start around 9 Hz and to decrease through the duration of the cycle (Fig. 8, C and D). As described above, this average effect is challenging to interpret because of within-cycle variability in the timing of cycle features and between-cycle variability in total cycle duration. Our proposed phase-aligned instantaneous frequency profiles (Fig. 8, E and F) resolve these ambiguities. This shows that theta cycle instantaneous frequency in this single recording starts around 9 Hz at the ascending zero-crossing, decreasing to ∼8.1 Hz at the descending zero-crossing, before increasing again to 9 Hz at the end of the cycle. This is consistent with a fast-ascending and slow-descending cycle shape revealed by the control point analysis and in previous literature. The phase-aligned instantaneous frequency approach is able to show this effect as a continuous shape profile for single cycles, which can be straightforwardly compared at the group level.

Figure 8.

Figure 8.

Methods for quantifying waveform in hippocampal theta. A: distribution of the peak-to-trough and ascent-to-descent ratios for a single data recording. B: the timing of the control points used to create the ratios in A for an illustrative subset of the cycles. C. top: average temporally aligned signal waveform. Bottom: average temporally aligned instantaneous frequency (IF) profiles. D: illustration of single-cycle temporally aligned instantaneous frequency profiles for an illustrative subset of the cycles. E, top: average phase-aligned signal waveform. Bottom: average phase-aligned instantaneous frequency profile. F: illustration of single-cycle phase-aligned instantaneous frequency profiles for an illustrative subset of the cycles. Num Cycles, number of cycles.

Theta Has a Stereotyped Asymmetric Shape with Wide Variability across Cycles

We next summarized the average waveform across theta cycles from six recordings taken from three mice. The average phase-aligned instantaneous frequency profile is computed for each recording and for the whole data set. The overall group-level average waveform had a cosine-type profile centered around an average instantaneous frequency of ∼8.6 Hz (Fig. 9A; average in black and individual recording sessions in gray). On average, the instantaneous frequency peaked within the cycle around 9 Hz at the ascending zero-crossing and dropped to just below 8.4 Hz between the peak and descending zero-crossing. These results are consistent with previous studies showing an asymmetry between the fast-rising and slow-decaying halves of a theta cycle (6, 7, 39). All six recordings across three animals showed a shape with a maximum frequency around the ascending zero-crossing and a minimum on the descending edge, although there was some variability in whether the lowest frequency was closer to the peak or the trough.

Figure 9.

Figure 9.

Average waveform shape and variability in shape across cycles in hippocampal theta. A: average of phase-aligned instantaneous frequency profiles for each of the 6 separate recording sessions across 3 mice. The different dashed line styles indicate the runs from the different mice, and the solid black line represents the average across all 6 recordings. B: projection of the mean frequency profile from A around the unit circle (solid line) with an equivalent projection of a sinusoid (dotted line). The mean frequency profile is clearly shifted to the right, indicating that the instantaneous frequency profile is not uniform across phase. The center of this distribution is the mean vector whose magnitude represents the amount of frequency distortion across a cycle and whose angle represents where in the cycle the frequency is highest. C: the distribution of mean vectors for all individual cycles projected into a simplified shape-space (see Describing shape with an instantaneous frequency mean vector) to visualize the overall variability in waveform shape around the average. Individual recording averages are shown in red, with different symbols representing the 3 animals. D: zoomed-in section of C showing the individual recording session means.

To visualize the variability in waveform shape across cycles and recording sessions, we performed a complementary analysis using the instantaneous frequency mean vector. The instantaneous frequency profile of each cycle is wrapped around the unit circle. The grand average profile shows a clear shift toward positive values on the x-axis that can be summarized by the mean value of the circular profile (Fig. 9B). This can be repeated for every individual cycle to describe the distribution of single-cycle waveforms across a simplified two-dimensional shape-space (Fig. 9C; see Describing shape with an instantaneous frequency mean vector). The x-axis of this space represents the amount of ascending-to-descending edge asymmetry in each cycle, and the y-axis represents the amount of peak-to-trough asymmetry. One-sample t tests against zero were performed on the x-axis and y-axis distributions to establish whether the overall distribution has a nonzero mean. The y-axis distribution, representing peak-to-trough asymmetry, was closely centered around the origin (mean = 0.0025, standard deviation = 0.92) with a mean not significantly different from zero, t(40,346) = 0.55, P = 0.58. In contrast, the x-axis distribution, representing ascending-to-descending edge asymmetry, has a larger, positive-valued center (mean = 0.38, standard deviation = 0.63) that was significantly different from zero, t(40,346) = 122.75, P < 0.0001. Overall, this indicates that the highest frequencies in a cycle are typically at the ascending edge, consistent with the average in Fig. 9A and with previous literature on the theta cycle (6). Although the overall mean shift in the distribution of cycles is robust across recordings (Fig. 9D), there is substantial cycle-to-cycle variability indicated by the width of the distribution.

Distinct Waveform Motifs Are Differentially Related to Behavioral and Electrophysiological States

To further describe the variability in waveform shape across cycles and characterize its relation to movement speed, theta amplitude, and theta cycle duration, we identify a set of waveform shape motifs with PCA. The parameters of the PCA allow us to summarize the range of waveform shapes seen in the data set from the components and the between-cycle dynamics in shape from the component scores (see Describing shape with an instantaneous frequency mean vector and Waveform motifs and relation to behavior). The robustness of the decomposition to random split-half subsampling was empirically assessed (see Supplemental Material Section 8.5, Supplemental Fig. S5) The first four components describing 96% of variance are retained for further analysis (Fig. 10). The shapes of individual waveform motifs are visualized by their normalized waveforms (Fig. 10A). These normalized waveforms are computed from the instantaneous frequency profiles of the PC component vectors (Fig. 10B) projected onto the extreme ends of the PC score distribution (Fig. 10C). Each normalized waveform then describes one end of a distributions of shapes with all variability in amplitude and total cycle duration removed. The between-cycle dynamics in shape can then be described by a set of four PC scores that describe the extent to which each shape component is expressed within each individual cycle.

Figure 10.

Figure 10.

Shape motifs in hippocampal theta and their relation to movement speed. A: the normalized waveforms for the first 4 shape motifs identified from a principal component analysis (PCA) across all phase-aligned instantaneous frequency profiles. Waveforms for positive principal component (PC) scores are shown in purple and waveforms for negative scores shown in green with a sinusoid for reference (black dotted line). B: PC for each motif. C: instantaneous frequency profiles of each shape motif created by multiplying the PC shape in B with the maximum or minimum observed PC score for that PC and adding the mean. Purple profiles represent the positive end of the score distribution, and green profiles represent the negative end. D: control point ratios for cycles split by the sign of the PC score. Purple profiles represent the positive end of the score distribution, and green profiles represent the negative end. E: t value of a general linear model (GLM) modeling the PC score for each motif as a function of movement speed, theta cycle duration, and theta cycle amplitude. *Statistical significance at P > 0.01 as identified by nonparametric permutations. A2D ascending-to-descending ratio; P2T, peak-to-trough ratio.

PC-1 (63.31% of variance) describes a continuum of shape from a sharp peak and a wide trough through to a wide peak and a sharp trough. This shape is similar to the y-axis in the mean vector distribution in Fig. 9B. In contrast, PC-2 (22.56% of variance) describes shapes ranging between an elongated ascending edge and an elongated descending edge, similar to the x-axis of Fig. 9B. The remaining components describe more complex shapes with relatively small contributions to the variance explained. PC-3 (6.86% of variance) captures shapes with a left or right “tilt” around their extrema, and PC-4 (3.33% of variance) describes shapes with a sharper or flatter curvature around the extrema.

The control point-based ascending-to-descending ratio and peak-to-trough ratio are computed for each cycle. For each PC, these values are partitioned into cycles with positive or negative PC scores (relating to distinct ends of the shape continuum for that component), and their distributions are plotted in Fig. 10D. The peak-to-trough ratios are clearly separated in the two ends of PC-1, whereas the ascending-to-descending ratios are similar for cycles with a positive or negative score in PC-1. This is consistent with the normalized waveforms summarizing PC-1 in Fig. 10A. PC-2 also shows the expected separation of ascending-to-descending ratios by PC score, whereas the peak-to-trough ratios are unchanged. Although PC-3 and PC-4 describe ∼10% of shape variability, they are not characterized by the control point analyses. Neither peak-to-trough ratios nor ascending-to-descending ratios are changed by PC score for PC-3 or PC-4. These shape profiles are robustly identified by the phase-aligned instantaneous frequency method but are not distinguished by these control point-based metrics, as the shape distortions in PC-3 and PC-4 occur between the four specified control points.

A general linear model was used to quantify the relationship between the different shape motifs and theta amplitude, theta duration, and mouse movement speed. This regression is computed separately for each PC and the resulting parameter estimates converted into t statistics. PC-1 codes for changes in average instantaneous frequency across the cycle with a small shape distortion around the descending edge. This PC has a strong relationship with cycle duration and amplitude but no significant covariation with movement speed. Longer and higher-amplitude cycles tend to have more positive scores in PC-1 relating to wide peak shapes. PC-2 has a strong relationship with duration and movement speed. Specifically, cycles with elongated descending edges have longer cycle durations and are more likely to occur during fast animal movement. PC-3 shows significant covariance with cycle amplitude. High-amplitude cycles tend to have shapes in which instantaneous frequency is relatively high just before the peak or trough. Finally, PC-4 varies strongly with duration and weakly with movement speed. Cycles with flatter curvatures around the extrema have longer cycle durations and are less likely to occur during faster animal movement.

DISCUSSION

Nonsinusoidal waveforms are often visible by eye in raw LFP traces of electrophysiological data sets, yet discovering and quantifying these nonsinusoidal and nonlinear features present substantial analytic challenges. We utilize within-cycle variability in instantaneous frequency to describe distortions in waveform (10). Furthermore, we introduce phase-alignment as a solution to comparing full-resolution waveforms between cycles of different durations. In summary, we establish that the phase-aligned instantaneous frequency profile of an oscillation provides a flexible framework for complete characterization of oscillatory waveform shape. We demonstrate the utility of this approach by applying it to simulated data and LFP recordings of theta oscillations of behaving mice.

In real data, we observed that theta oscillations have, on average, a fast-ascending and slow-descending waveform, in line with previous reports (6, 7, 24, 39). Although this average shape is robust across many cycles, recording sessions, and animals, the shape of individual cycles is highly variable. We characterize this variability by using PCA to identify a range of shape components, or shape motifs, that maximally explain the variability in the data set. The first two PCs quantify the relative durations of the peak and trough (PC-1) and the ascending and descending edge (PC-2). These PCs broadly map onto the features described by the peak-to-trough and ascending-to-descending control point ratios. We show that these theta shape PCs have distinct patterns of covariation with movement speed, theta amplitude, and theta cycle duration. Critically, we show that although PC-2 describes less variability overall, it most clearly covaries with movement speed.

PC-3 and PC-4 capture more complex waveform shapes. We show that the curvature around the extrema of the waveform shape (PC-4) is wider in theta cycles occurring during faster animal movement. This shape is naturally described by instantaneous frequency but not visible to the standard ascending-to-descending and peak-to-trough control point ratios that we have implemented here. If these shapes were known to be of interest a priori, it would be possible to construct specific control point-based measures to identify them. For instance, waveform sharpness can be explored by looking at the differential between the extrema and the samples 5 ms before and after (40). However, in real data, we may not know the waveform shape of interest a priori, implying that many separate metrics may need to be computed for each cycle. In contrast, the phase-aligned instantaneous frequency can quantify any waveform shape as a within-cycle instantaneous frequency sweep without prespecifying the features that may be of interest.

The present results demonstrate that single-cycle dynamics in oscillations can be meaningfully estimated with phase-aligned instantaneous frequency and that specific shape motifs are differentially related to the wider electrophysiological (theta amplitude and duration) and behavioral (movement speed) context. Future models of theta function may consider these dynamics in waveform shape that deviate from a canonical sinusoidal theta template. Given that many subprocesses occur preferentially at different parts of the theta cycle (41), we hypothesize that shape distortion may indicate or reflect a change in the underlying theta-phase-nested subprocesses.

The outlined approach requires that each cycle is smooth in both its waveform and phase profiles, as any jumps or discontinuities will lead to noisy or even negative instantaneous frequency estimates. If the cycle is smooth, we can characterize very large distortions in waveform shape as within-cycle dynamics in instantaneous frequency. Finally, we assume that the features being analyzed are well described as oscillations. If the features are nonsinusoidal and nonoscillatory, such as spiking activity, then descriptions using the language of frequency may not be appropriate. With these improvements and caveats in hand, this approach is readily generalizable to other data sets and provides a flexible framework for investigating waveform shape oscillating systems.

In conclusion, the full-cycle waveform of single cycles of hippocampal theta can be quantified and explored with phase-aligned instantaneous frequency. We use this approach to confirm the characteristic fast-ascending waveform of theta oscillations and to additionally reveal that this is highly variable on the single-cycle level. Moreover, we are able to link this variability with behavioral and electrophysiological states, suggesting that waveform shape is a relevant feature of neuronal oscillations alongside frequency, phase, and amplitude. Finally, although we have illustrated this approach with hippocampal theta oscillations, it is likely that this methodology will readily generalize to neuronal oscillation in other brain regions, frequency bands, and contexts.

SUPPLEMENTAL DATA

Supplemental Material: https://doi.org/10.6084/m9.figshare.15028986.

GRANTS

This project was supported by the Medical Research Council (RG94383/RG89702) and by the NIHR Oxford Health Biomedical Research Centre. The Wellcome Centre for Integrative Neuroimaging is supported by core funding from the Wellcome Trust (203139/Z/16/Z). V.L.-d.-S. and D.D. are supported by the Medical Research Council UK (Programmes MC_UU_12024/3 and MC_UU_00003/4 to D.D.) A.C.N. is supported by the Wellcome Trust (104571/Z/14/Z) and James S. McDonnell Foundation (220020448). M.W.W. is supported by the Wellcome Trust (106183/Z/14/Z; 215573/Z/19/Z). A.C.N. and M.W.W. are further supported by an EU European Training Network grant (euSSN; 860563).

DISCLOSURES

No conflicts of interest, financial or otherwise, are declared by the authors.

AUTHOR CONTRIBUTIONS

A.J.Q., V.L.-d.-S., A.C.N., D.D., and M.W.W. conceived and designed research; A.J.Q. analyzed data; A.J.Q., V.L.-d.-S., N.H., W.-K.L., C.-H.J., J.-R.Y., A.C.N., D.D., and M.W.W. interpreted results of experiments; A.J.Q. prepared figures; A.J.Q., V.L.-d.-S., D.D., A.C.N., and M.W.W. drafted manuscript; A.J.Q., V.L.-d.-S., N.H., W.-K.L., C.-H.J., J.-R.Y., A.C.N., D.D., and M.W.W. edited and revised manuscript; A.J.Q., V.L.-d.-S., N.H., W.-K.L., C.-H.J., J.-R.Y., A.C.N., D.D., and M.W.W. approved final version of manuscript.

ENDNOTE

At the request of the authors, readers are herein alerted to the fact that additional materials related to this manuscript may be found at https://github.com/OHBA-analysis/Quinn2021_Waveform and https://data.mrc.ox.ac.uk/data-set/instantaneous-frequency-profiles-theta-cycles. These materials are not a part of this manuscript and have not undergone peer review by the American Physiological Society (APS). APS and the journal editors take no responsibility for these materials, for the website addresses, or for any links to or from them.

ACKNOWLEDGMENTS

The authors thank Catharina Zich for discussion of the manuscript.

REFERENCES

  • 1.Cole SR, Voytek B. Brain oscillations and the importance of waveform Shape. Trends Cogn Sci 21: 137–149, 2017. doi: 10.1016/j.tics.2016.12.008. [DOI] [PubMed] [Google Scholar]
  • 2.Amzica F, Steriade M. Electrophysiological correlates of sleep delta waves. Electroencephalogr Clin Neurophysiol 107: 69–83, 1998. doi: 10.1016/S0013-4694(98)00051-0. [DOI] [PubMed] [Google Scholar]
  • 3.Bartz S, Avarvand FS, Leicht G, Nolte G. Analyzing the waveshape of brain oscillations with bicoherence. NeuroImage 188: 145–160, 2019. doi: 10.1016/j.neuroimage.2018.11.045. [DOI] [PubMed] [Google Scholar]
  • 4.Elgar S. Relationships involving third moments and bispectra of a harmonic process. IEEE Trans Acoust Speech Signal Process 35: 1725–1726, 1987. doi: 10.1109/TASSP.1987.1165090. [DOI] [Google Scholar]
  • 5.Sheremet A, Burke SN, Maurer AP. Movement enhances the nonlinearity of hippocampal theta. J Neurosci 36: 4218–4230, 2016. doi: 10.1523/JNEUROSCI.3564-15.2016. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Belluscio MA, Mizuseki K, Schmidt R, Kempter R, Buzsáki G. Cross-frequency phase–phase coupling between theta and gamma oscillations in the hippocampus. J Neurosci 32: 423–435, 2012. doi: 10.1523/JNEUROSCI.4122-11.2012. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Cole S, Voytek B. Cycle-by-cycle analysis of neural oscillations. J Neurophysiol 122: 849–861, 2019. doi: 10.1152/jn.00273.2019. [DOI] [PubMed] [Google Scholar]
  • 8.Trimper JB, Stefanescu RA, Manns JR. Recognition memory and theta-gamma interactions in the hippocampus. Hippocampus 24: 341–353, 2014. doi: 10.1002/hipo.22228. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Boashash B. Estimating and interpreting the instantaneous frequency of a signal. I. Fundamentals. Proc IEEE 80: 520–538, 1992. doi: 10.1109/5.135376. [DOI] [Google Scholar]
  • 10.Huang NE, Wu Z, Long SR, Arnold KC, Chen X, Blank K. On instantaneous frequency. Adv Adapt Data Anal 01: 177–229, 2009. doi: 10.1142/S1793536909000096. [DOI] [Google Scholar]
  • 11.Cohen MX. Fluctuations in oscillation frequency control spike timing and coordinate neural networks. J Neurosci 34: 8988–8998, 2014. doi: 10.1523/JNEUROSCI.0261-14.2014. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Liang H, Bressler SL, Buffalo EA, Desimone R, Fries P. Empirical mode decomposition of field potentials from macaque V4 in visual spatial attention. Biol Cybern 92: 380–392, 2005. doi: 10.1007/s00422-005-0566-y. [DOI] [PubMed] [Google Scholar]
  • 13.Nelli S, Itthipuripat S, Srinivasan R, Serences JT. Fluctuations in instantaneous frequency predict alpha amplitude during visual perception. Nat Commun 8: 2071, 2017. doi: 10.1038/s41467-017-02176-x. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Rudrauf D, Douiri A, Kovach C, Lachaux JP, Cosmelli D, Chavez M, Adam C, Renault B, Martinerie J, Le Van Quyen M. Frequency flows and the time-frequency dynamics of multivariate phase synchronization in brain signals. NeuroImage 31: 209–227, 2006. doi: 10.1016/j.neuroimage.2005.11.021. [DOI] [PubMed] [Google Scholar]
  • 15.Huang NE, Shen Z, Long SR, Wu MC, Shih HH, Zheng Q, Yen N-C, Tung CC, Liu HH. The empirical mode decomposition and the Hilbert spectrum for nonlinear and non-stationary time series analysis. Proc R Soc Lond A Math Phys Eng Sci 454: 903–995, 1998. doi: 10.1098/rspa.1998.0193. [DOI] [Google Scholar]
  • 16.Huang NE, Lo MT, Wu ZH, Chen XY. Method for quantifying and modeling degree of nonlinearity, combined nonlinearity, and nonstationarity [Online]. 2014. https://patents.google.com/patent/US8732113B2/en. [2021 10 Jan].
  • 17.Tsai FF, Fan SZ, Lin YS, Huang NE, Yeh JR. Investigating power density and the degree of nonlinearity in intrinsic components of anesthesia EEG by the Hilbert-Huang transform: an example using ketamine and alfentanil. PLOS ONE 11: e0168108, 2016. doi: 10.1371/journal.pone.0168108. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 18.Wang Y, Wang H, Zhang Q. Nonlinear distortion identification based on intra-wave frequency modulation. Appl Math Inf Sci 6: 689–695, 2012. [Google Scholar]
  • 19.Yeh CH, Al-Fatly B, Kühn AA, Meidahl AC, Tinkhauser G, Tan H, Brown P. Waveform changes with the evolution of beta bursts in the human subthalamic nucleus. Clin Neurophysiol 131: 2086–2099, 2020. doi: 10.1016/j.clinph.2020.05.035. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Lopes-Dos-Santos V, van de Ven GM, Morley A, Trouche S, Campo-Urriza N, Dupret D. Parsing hippocampal theta oscillations by nested spectral components during spatial exploration and memory-guided behavior. Neuron 100: 940–952.e7, 2018. doi: 10.1016/j.neuron.2018.09.031. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21.Farahmand S, Sobayo T, Mogul DJ. Noise-assisted multivariate EMD-based mean-phase coherence analysis to evaluate phase-synchrony dynamics in epilepsy patients. IEEE Trans Neural Syst Rehabil Eng 26: 2270–2279, 2018. doi: 10.1109/TNSRE.2018.2881606. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22.Pigorini A, Casali AG, Casarotto S, Ferrarelli F, Baselli G, Mariotti M, Massimini M, Rosanova M. Time–frequency spectral analysis of TMS-evoked EEG oscillations by means of Hilbert–Huang transform. J Neurosci Methods 198: 236–245, 2011. doi: 10.1016/j.jneumeth.2011.04.013. [DOI] [PubMed] [Google Scholar]
  • 23.Fine AS, Nicholls DP, Mogul DJ. Assessing instantaneous synchrony of nonlinear nonstationary oscillators in the brain. J Neurosci Methods 186: 42–51, 2010. doi: 10.1016/j.jneumeth.2009.10.023. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 24.Buzsáki G, Rappelsberger P, Kellényi L. Depth profiles of hippocampal rhythmic slow activity (‘theta rhythm’) depend on behaviour. Electroencephalogr Clin Neurophysiol 61: 77–88, 1985. doi: 10.1016/0013-4694(85)91075-2. [DOI] [PubMed] [Google Scholar]
  • 25.Siapas AG, Lubenov EV, Wilson MA. Prefrontal phase locking to hippocampal theta oscillations. Neuron 46: 141–151, 2005. doi: 10.1016/j.neuron.2005.02.028. [DOI] [PubMed] [Google Scholar]
  • 26.Quinn AJ, Lopes-Dos-Santos V, Dupret D, Nobre AC, Woolrich MW. EMD: empirical mode decomposition and Hilbert-Huang spectral analyses in Python. J Open Source Softw 6: 2977, 2021. doi: 10.21105/joss.02977. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 27.Quinn AJ, Hymers M. SAILS: spectral analysis in linear systems. J Open Source Softw 5: 1982, 2020. doi: 10.21105/joss.01982. [DOI] [Google Scholar]
  • 28.Harris CR, Millman KJ, van der Walt SJ, Gommers R, Virtanen P, Cournapeau D, Wieser E, Taylor J, Berg S, Smith NJ, Kern R, Picus M, Hoyer S, van Kerkwijk MH, Brett M, Haldane A, Del Río JF, Wiebe M, Peterson P, Gérard-Marchant P, Sheppard K, Reddy T, Weckesser W, Abbasi H, Gohlke C, Oliphant TE. Array programming with NumPy. Nature 585: 357–362, 2020. doi: 10.1038/s41586-020-2649-2. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 29.Virtanen P, Gommers R, Oliphant TE, Haberland M, Reddy T, Cournapeau D; SciPy 1.0 Contributors, et al. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nat Methods 17: 261–272, 2020. [Erratum in Nat Methods 17: 353, 2020]. doi: 10.1038/s41592-019-0686-2. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 30.Hunter JD. Matplotlib: a 2D graphics environment. Comput Sci Eng 9: 90–95, 2007. doi: 10.1109/MCSE.2007.55. [DOI] [Google Scholar]
  • 31.Deering R, Kaiser JF. The use of a masking signal to improve empirical mode decomposition. In: Proceedings (ICASSP ’05) IEEE International Conference on Acoustics, Speech, and Signal Processing. 2005, vol. 4. p. iv/485–iv/488. doi: 10.1109/ICASSP.2005.1416051. [DOI] [Google Scholar]
  • 32.Wu Z, Huang NE. Ensemble empirical mode decomposition: a noise-assisted data analysis method. Adv Adapt Data Anal 01: 1–41, 2009. doi: 10.1142/S1793536909000047. [DOI] [Google Scholar]
  • 33.Fritsch FN, Carlson RE. Monotone piecewise cubic interpolation. SIAM J Numer Anal 17: 238–246, 1980. doi: 10.1137/0717021. [DOI] [Google Scholar]
  • 34.Rato RT, Ortigueira MD, Batista AG. On the HHT, its problems, and some solutions. Mech Syst Signal Process 22: 1374–1394, 2008. doi: 10.1016/j.ymssp.2007.11.028. [DOI] [Google Scholar]
  • 35.Canolty RT, Edwards E, Dalal SS, Soltani M, Nagarajan SS, Kirsch HE, Berger MS, Barbaro NM, Knight RT. High gamma power is phase-locked to theta oscillations in human neocortex. Science 313: 1626–1628, 2006. doi: 10.1126/science.1128115. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36.Feynman RP, Leighton RB, Sands ML. The Feynman Lectures on Physics (New millennium ed.), New York: Basic Books, 2011. [Google Scholar]
  • 37.Fosso OB, Molinas M. Method for mode mixing separation in empirical mode decomposition [Online]. http://arxiv.org/abs/1709.05547. [2019 Aug 19].
  • 38.Rilling G, Flandrin P. One or two frequencies? The empirical mode decomposition answers. IEEE Trans Signal Process 56: 85–95, 2008. doi: 10.1109/TSP.2007.906771. [DOI] [Google Scholar]
  • 39.Buzsáki G, Czopf J, Kondákor I, Kellényi L. Laminar distribution of hippocampal rhythmic slow activity (RSA) in the behaving rat: current-source density analysis, effects of urethane and atropine. Brain Res 365: 125–137, 1986. doi: 10.1016/0006-8993(86)90729-8. [DOI] [PubMed] [Google Scholar]
  • 40.Cole SR, van der Meij R, Peterson EJ, de Hemptinne C, Starr PA, Voytek B. Nonsinusoidal beta oscillations reflect cortical pathophysiology in Parkinson’s disease. J Neurosci 37: 4830–4840, 2017. doi: 10.1523/JNEUROSCI.2208-16.2017. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 41.Klausberger T, Somogyi P. Neuronal diversity and temporal dynamics: the unity of hippocampal circuit operations. Science 321: 53–57, 2008. doi: 10.1126/science.1149381. [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

Code for the analyses in this paper is freely available online (https://github.com/OHBA-analysis/Quinn2021_Waveform), and data are available from the MRC BNDU Data Sharing Platform (https://data.mrc.ox.ac.uk/data-set/instantaneous-frequency-profiles-theta-cycles; requires free registration). The analyses in this study were carried out in Python 3.7 with v0.4.0 of the EMD package (Ref. 26; https://emd.readthedocs.io/) and glmtools v0.1.0 for general linear model (GLM) design and fitting (https://pypi.org/project/glmtools/). The wavelet transforms and principal component analysis (PCA) were computed with SAILS v1.1.1 (27). The underlying Python dependencies were NumPy (28) and SciPy (29) for computation and Matplotlib (30) for visualization.


Articles from Journal of Neurophysiology are provided here courtesy of American Physiological Society

RESOURCES