Temporal Dynamics and Spectral Power
Standard Fourier-based approaches describe times series with a set of pure sinusoids. This means that each frequency has a single amplitude and phase lag which is assumed to be constant over time. Following this, changes in spectral power are typically interpreted as a change in the magnitude or power of the underlying oscillation. This interpretation is unambiguous when comparing stationary sinusoids but can be misleading when the signals contain richer temporal dynamics. For instance, some oscillations particularly in the beta and gamma bands, may contain intermittent, ‘bursting’ activity; therefore it may be more appropriate to consider these as transient pulses of spectrally specific activity rather than tonic oscillations (van Ede et al. 2018). Crucially, changes in the temporal parameters of these spectral events, such as lifetime or rate of occurrence, may appear as changes in power in standard analyses. In comparing two signals, this may result in a false interpretation that one signal contains tonic oscillations with larger magnitude when instead it has longer or more frequent spectrally specific bursting events. Moreover, distinct changes in the underlying parameters (more bursts, longer bursts, or bursts with higher amplitude) may yield equivalent changes in trial-average power. Targeting the changes in the underlying parameters could therefore enrich our understanding (and help distinguish between alternative models) of power changes in various experimental conditions and clinical disorder.
A range of methods, including the HMM approach being proposed here, have been developed to describe the temporal dynamics that might underlie spectral power changes. These approaches are expository in their nature and, on their own, cannot unambiguously resolve the deeper question of whether the underlying physiology is comprised of transient events or oscillations occurring within noise. However, they can provide insight into the rich temporal structure that is missed with static or trial-averaged approaches.
Figure 1 illustrates changes in three features of a dynamic oscillation (i.e. amplitude, duration and occurrences) and how these changes affect power estimates (also see Fig. 3 in Shin et al. 2017). Figure 1a shows three short time-series containing tonic oscillations with increasing amplitudes. Correspondingly, the Fourier based power spectrum for each of these time-series shows successively higher magnitude peaks, leading us to correctly conclude that the amplitude of these cases is changing. Figure 1b shows a brief oscillatory burst, i.e. a single transient event (a short-lived period of time with non-zero amplitude), with increasing amplitude. The power spectrum computed across the whole window again indicates that power is increasing, though in this case only the power of a brief event is changing. More generally, the power or amplitude of an oscillation might be influenced by a range of factors. Figure 1c shows a dynamic signal containing a single transient event with a fixed amplitude but successively increasing duration. As with Fig. 1a, the power spectrum shows successively larger peaks around 4 Hz. Finally, the signals in Fig. 1d contain an increasing number of otherwise equivalent events, also resulting in increase of the total oscillatory power in the window. This brief simulation shows that increasing event amplitude, duration, or rate of occurrence all lead to increased magnitude peaks in the power spectrum. As such, if we only saw their static power spectra computed over the full time-window, we might conclude that all three cases show an increase in the amplitude of the underlying oscillation. We have the same issue when interpreting trial average changes in power which could arise from differing single-trial dynamics. Note that the sides of the spectral peaks for the four cases are slightly different. If our signal was a noise-free and sinusoidal, we could extract some extra information about dynamics from the side-bands of the main spectral peak. However, in a noisy, dynamics or short signal, it is extremely challenging to separate whether oscillatory signals, temporal dynamics or a combination of both are contributing to frequency domain power.
The increases in power seen in Fig. 1b–d are not mathematically inaccurate, they are a complete representation of the data under the assumptions of the Fourier transform. However, our interpretation of the power change in this form is ambiguous; we cannot make a strong statement about the which feature lead to our power change from the (non-time-resolved or trial-averaged) power spectrum alone. We need access to the temporal dynamics to resolve the difference between our three cases.
Dynamics in Spectrally-Specific Events with Hidden Markov Models
One way to explore the temporal dynamics of transient events with specific spectral signatures, i.e. to do burst detection, is to use Hidden Markov Models. Our intention here is to provide an intuition into how the Hidden Markov Model can be used to operationalise and explore the temporal dynamics of transient spectral events, or bursts, rather than to make a formal comparison between all available alternative methodological approaches.
The Hidden Markov Model represents data as a system moving through a set of discrete states. Each state is an abstract representation linked to the data through a probabilistic observation model (Baker et al. 2014; Vidaurre et al. 2016). The observation model can take different forms to suit the data modality and features of interest (Vidaurre et al. 2018a). Previous applications of the HMM have used autoregressive models (Vidaurre et al. 2016) or multivariate Gaussian distributions (Baker et al. 2014; Quinn et al. 2018; Vidaurre et al. 2018a) as observation models describing multi-region or single-region data in human and animal data. This flexibility makes the HMM a practical choice for analysing a wide range of data types, by tuning the observation model whilst the essential mathematical framework and parameter inference remain the same.
In this paper, we will consider two HMM approaches to operationalise the detection of bursts of spectrally specific activity in single-channel (i.e. single-region electrophysiological data). In these two approaches, we either conceptualise a burst as a period of high amplitude, or as a period with a distinct power spectra.
Periods of High Amplitude
In the first approach, we define a burst as a period of high instantaneous amplitude within a predefined frequency band. These can be identified using an HMM with a Gaussian observation model inferred on amplitude envelope time-courses of bandpass filtered data. We refer to this as the amplitude-envelope HMM (AE-HMM; Baker et al. 2014; Quinn et al. 2018). In this approach, we typically specify that there are two states, one corresponding to the ‘burst’ state (i.e. when there is high amplitude), and one corresponding to a low amplitude state. A specific visit to the burst state then equates to the occurrence of a burst event.
This HMM variant is the most similar to power thresholding methods, in which a ‘burst’ occurs when the envelope exceeds a critical amplitude threshold. However, there are two key differences Firstly, the HMM does not threshold the amplitude envelope directly. Instead, each state has a probability of being ‘on’ at each moment in time. Switching between states can then be computed analytically by the Viterbi algorithm, or through a manual thresholding of the probabilities. The distributions of posterior probabilities from a well-fitted HMM tend to be strongly bimodal with most samples having probabilities close to zero or one. When selecting a threshold for the posterior probabilities by hand, this means that a relatively wide range of thresholds (typically between .33 and .66) tend to give similar results.
Secondly, the HMM applies temporal regularisation to avoid overfitting to small changes in the envelope. That is, the effect of having a transition probability matrix discourages too many spurious state transitions. This is particularly relevant when small changes in the envelope close to the threshold could lead to many small bursts being identified by a strict threshold. In contrast, brief dips during periods of otherwise high amplitude are less likely to lead to state changes in the HMM.
Periods with Distinct Power Spectra
We may also define a burst as a period of time with a distinct pattern of spectral properties (e.g. power). These can be identified using a time-delay embedded HMM (TDE-HMM; Quinn et al. 2018; Vidaurre et al. 2018b), which uses an HMM with a multivariate Gaussian observation inferred on a time-delay embedding of the wide-band data (i.e. a cross-temporal Gaussian distribution over some prespecified window). Each state then captures periods of time that have distinct auto-covariance. Though defined in the time-domain, the auto-covariance of a time series is closely related to its frequency content; the Power Spectral Density of a time-series can be computed from the discrete Fourier transform or its autocovariance (as shown by the Wiener–Khinchin theorem).
In this approach, we typically specify more than two states in the HMM. Where each state represents a particular type of spectral event, or bursting. For example, one state may detect bursts in the beta band, another in the alpha band. A specific visit to a state then equates to the occurrence of a burst event of the type represented by that state.
In contrast to the AE-HMM, the TDE-HMM states are defined by the magnitude and shape of an entire spectrum rather than the magnitude within a specified frequency band. Bursts can then be operationalised as short-lived states containing clear spectral features. As the TDE-HMM works on the whole spectrum from raw time-courses, there is no need for the tight bandpass filtering needed prior to computing the Hilbert transform in envelope-based methods. These filters require a priori specification and can themselves affect the dynamics visible in the data (de Cheveigné and Nelken 2019). As with the AE-HMM, the TDE-HMM is able to infer bursts without defining a priori thresholds.
The general theory of Hidden Markov Modelling is explored in Rabiner and Juang (1986) and Bishop (2006). The code to run the following simulations and real data analyses can be found on https://github.com/OHBA-analysis/Quinn2019_BurstHMM. These analyses were carried out in Matlab 2019a using the Signal Processing and Wavelet toolboxes.
HMM analyses are carried out using the HMM-MAR toolbox (https://github.com/OHBA-analysis/HMM-MAR; Vidaurre et al. 2018a, 2016). Previous HMM applications have detected transient events in MEG (Baker et al. 2014; Quinn et al. 2018; Vidaurre et al. 2018b, 2016), fMRI (Vidaurre et al. 2017) and simultaneous EEG-fMRI (Hunyadi et al. 2019).
The AE- and TDE-HMMs are illustrated with a simulation. A noise time-course with a 1/f like profile is generated using direct-pole placement to define an order-1 AR model. Spectrally specific bursting events at either 20 or 35 Hz are added to this noise time-course at random intervals.
High amplitude burst events are detected using either a standard thresholding approach or a Gaussian HMM on the amplitude envelope estimated with the Hilbert transform after a narrow (15–20 Hz) or a wide (15–35 Hz) bandpass filter. For an informal comparison, a standard threshold is selected as twice the median amplitude envelope value in each example. The Gaussian HMM is specified to have two-states with the intention that the state with the higher mean amplitude reflects the bursting periods.
The same simulated time-course is used to illustrate the use of the TDE-HMM. In contrast to the AE-HMM, the TDE-HMM works on the raw time-courses, adaptively learning the spectral content, and therefore does not require a priori specification of the frequency bands of interest. A time delay embedding with lags from − 7:7 (58 ms) is defined, which means that each state has a [15 × 15] auto-covariance matrix as its observation model (the HMM state observation model means are set to zero). We fit the HMM with three states to reflect the periods of noise, low frequency bursts and high frequency bursts. State specific power spectra are computed for the TDE-HMM using a post hoc multi-taper spectral analysis (Vidaurre et al. 2016). The multitaper method computes the power spectrum multiplying the raw data with a set of seven orthogonal two-second data tapers (discrete prolate spheroidal sequences with a time-bandwidth product of 4) and taking the average spectrum over all the tapers (www.chronux.org; Mitra and Bokil 2007). The HMM-based multitaper approach used extends this method by weighing the contribution of each data point to the final spectral estimation using the state probabilities that the HMM inference provides for each time point in the dataset.
Empirical Source-Space MEG Data
The TDE-HMM is applied to MEG sensor-space data acquired from 33 participants whilst completing a Go-NoGo task [full experimental details can be found in (Nowak et al. 2017)]. During each trial, participants prepare to make an abduction movement of the right index finger. On 80% of trials (Go trials) this movement is completed as expects and on the remaining 20% (NoGo trials) the prepared movement is no performed. Here we analysed the Go trials containing a valid finger movement. The sensor data were preprocessed with Signal-Space Separation Maxfilter before being converted to SPM12 format for processing in the OSL toolbox in MatLab. Each session is bandpass filtered between 1 Hz and 48 Hz and downsampled to 500 Hz. Independent Component Analysis (ICA) is used to identify and reject components of the sensor data relating to ECG and EOG. A single time-course is taken from the first principal component of 12 sensors over the left motor cortex as defined in (Nowak et al. 2017). This time course is epoched to the offset of the finger movement (identified from concurrent EMG recordings) to focus the analysis on the beta rebound. Finally, outlier trials are rejected from further analysis using an automated generalized extreme studentized deviate (GESD) algorithm.
Prior to HMM inference, the epoched data are downsampled by a factor of six to 83.3 Hz. This is as the TDE spectra will span the whole range from zero to Nyquist frequency. Therefore, downsampling will ensure that this range is focused on the frequency range of the physiological oscillations of interest. The TDE-HMM is inferred on the epoched data with six states and an embedding window of 23 samples (276 ms). We use a longer window here than for the simulations to allow the model to capture a greater range of auto-covariance structures in the data.
Once the HMM state time-courses and observation model have been inferred, we compute a range of temporal statistics from the state time-courses and extract the auto-covariance matrices from the observation models. The state-specific power spectra are computed directly from the observation model by taking the fast-Fourier transform (fft) of the middle row of the inferred autocovariance matrix. Next, the state time-courses are averaged across trials to compute a task-evoked fractional occupancy. HMM-regularised time–frequency transforms are computed from the outer product of the task-evoked fractional occupancy and the state-wise power spectra. This provides an alternative time–frequency transform of the data as seen by the inferred HMM. Finally, other task dynamics describing the transient spectral events, or bursts, can be computed. For example, we computed the task-evoked change in lifetimes for a state by creating a vector containing ‘NaNs’ (i.e. Not-a-Numbers) when the state is off, and the lifetime of the state visit when the lifetime is on. The average of these lifetimes across trials then summarises how the duration of state visits change over a trial.