Bump time-frequency toolbox: a toolbox for time-frequency oscillatory bursts extraction in electrophysiological signals
© Vialatte et al. 2009
Received: 06 November 2008
Accepted: 12 May 2009
Published: 12 May 2009
Skip to main content
© Vialatte et al. 2009
Received: 06 November 2008
Accepted: 12 May 2009
Published: 12 May 2009
oscillatory activity, which can be separated in background and oscillatory burst pattern activities, is supposed to be representative of local synchronies of neural assemblies. Oscillatory burst events should consequently play a specific functional role, distinct from background EEG activity – especially for cognitive tasks (e.g. working memory tasks), binding mechanisms and perceptual dynamics (e.g. visual binding), or in clinical contexts (e.g. effects of brain disorders). However extracting oscillatory events in single trials, with a reliable and consistent method, is not a simple task.
in this work we propose a user-friendly stand-alone toolbox, which models in a reasonable time a bump time-frequency model from the wavelet representations of a set of signals. The software is provided with a Matlab toolbox which can compute wavelet representations before calling automatically the stand-alone application.
The tool is publicly available as a freeware at the address: http://www.bsp.brain.riken.jp/bumptoolbox/toolbox_home.html
The structural organization (which elements are relevant) and associated functional role (how these elements play a role in brain dynamics) of electroencephalographic (EEG) oscillations are still far from being completely understood. Oscillatory activity can be separated in background (or ongoing) and transient burst pattern activities. The background EEG is constituted by regular waves, whereas bursts are transient and with higher amplitudes: cortical dynamics do not follow continuous patterns, but instead operates in steps, or frames . These bursts are organized local activities, most likely to be representative of local synchronies. Synchrony among oscillating neural assemblies is a plausible candidate to mediate functional connectivity, and therefore to allow the formation of spatiotemporal representations [2, 3]. Oscillatory bursts should consequently play a specific functional role, distinct from ongoing background EEG activity (which does not mean however that background activity cannot convey information). They are correlated with reciprocal dynamic connections of neural structures, which can be considered as distributed local networks of neurons . Together, distant neural assemblies are involved in collective dynamics of synchronous neuronal oscillations , taking the shape of oscillatory patterns.
EEG activities are usually analyzed using either time or frequency representations of event related potentials (ERP), which can be interpreted as the reorganization of the spontaneous brain oscillations in response to the stimulus [5, 6]. ERP can be further seprated into two sub-groups: event related synchronization (ERS), and similarly event related desynchronization (ERD). The simplest hypothesis concerning the origins of ERP would be additive: following the stimulus onset, in each trial, a transient change of amplitude is observed in a given frequency range, independent of the ongoing signal (the signal is synchronized or dissynchronized in all trials). However, other competing theories could also explain the ERP patterns. The stimulus could induce a change in the phase of ongoing oscillations, without power changes. If the phases of all trials were aligned or dialigned, then after averaging ongoing oscillations an ERS or ERD pattern would arise: this is the so-called theory of phase resetting (e.g. [7, 8]; see also ). Another recent theory explains the generation of event related potentials as a consequence of a baseline shift of ongoing activity . Confronting these three competing theories with experimental facts seems necessary in order to understand the basis of neural dynamics.
It should be noted however that all the above ERP theories are interested in the study of averages of electrophysiological signals in the time domain. ERP were observed in several studies to have visible outcomes even in single trials [11, 12], especially observable when using wavelets [6, 12, 13] which represent the signal with optimal time-frequency resolutions. Local oscillatory events are present in single trials, appearing as transient oscillatory synchronizations (TOS) or transient oscillatory desynchronizations (TOD), corresponding to the presence or absence of a coherent neural assembly . If the additive theory was right, ERS and ERD could be assumed to be the outcome of an average of TOS and TOD events respectively – if not (especially in the phase shift theory), they would have an independent meaning, and it would be even more worthwile to study them. We are not interested here in an averaged outcome (we do not want to study ERP, but TOS and TOD), because the brain itself usually processes information in single trials.
Sparse time-frequency bump modeling was first applied to model invasive EEG (local field potentials), recorded from rats olfactory bulb during a go-no go olfactory memory task [22, 23]. Afterwards, it was used to investigate several aspects of brain oscillatory dynamics: scalp EEG data from patients with early stage of Alzheimer's disease (AD) was also successfully analyzed and classified using bump modeling [22, 24, 25] with a high accuracy (80–93% leave-one-out validation rate). The model was also applied to represent simultaneously time-frequency and space information using a sonification approach . Time-frequency space information was then exploited using a synchrony model: oscillatory burst extracted with bump modeling were used to determine large-scale synchrony – the stochastic event synchrony (SES, [27, 28]). Applied to EEG recorded from early AD patients, SES extracted significant differences with age-matched control subjects. These differences were complementary when compared against 30 other synchrony measures [29, 30] (uncorrelated with all other 30 measures). Finally, oscillations of steady state visual event potential epochs were extracted (hundred single trial EEG signals) using sparse bump modeling, and an increase of large-scale synchrony measured using SES . This confirms that sparse bump modeling has a wide range of possible applications, from feature extraction to signal modeling and analysis.
However, due to its complexity, it was until now difficult for researchers to reproduce our results: only one external group  tried to reproduce results obtained with bump modeling on Alzheimer's disease modeling (they obtained an 80% classification rate). Therefore we present now a toolbox [see Additional file 1] for sparse bump modeling. The software extracts transient oscillatory events (TOS or TOD). We will first describe the method procedure, then demonstrate the toolbox functions with a toy signal. In appendix, we present some details of the improved adaptation and matching methods implemented in the toolbox.
ButIf toolbox follows four steps (rationales for this procedure, proofs and technical details are explained in , see also Fig. 1): (in Matlab) the signal is first wavelet transformed into time-frequency, then the time-frequency map is z-score normalized; (in the stand-alone software) the map is described by a set of time-frequency window, then parametric functions are adapted within these windows, in decreasing ordered of energy.
The first steps are executed with Matlab, while the last are executed with a stand-alone software. Note however that the stand-alone software can be directly called by Matlab: the whole package can be run from Matlab.
where σ and f are interdependent parameters, the constraint 2πft > 5. The wavelet family defined by 2πft = 7, as described in , is adapted to the investigation of EEG signals. This wavelet has positive and negative values resembling those of an EEG, but also a symmetric Gaussian shape both in the time and frequency domains – i.e. this wavelet locates accurately time-frequency oscillations both in the time and frequency domain.
where s, the scaling factor, controls the central frequency f of the mother wavelet. The modulus of this time-scale representation can therefore be used as a positive time-frequency spectrogram, which we will note C x , a time-frequency matrix of dimension T × F, where F scales are used to compute appropriate frequency steps (usually linear or logarithmic, in the case of bump modeling we use linear steps).
In event related studies, the reference signal is usually a signal recorded during a rest period, just before the stimulus period (the so-called pre-stimulus period). In rest condition, the reference signal can be either the signal itself (self-reference signal); or a statistic derived from a group of signals (as used e.g. in ). The minimal number of samples of the reference signal should be determined with regards to the lowest frequency range (because low frequencies have longer cycles than high frequencies), so that a sufficient number of cycles is present – otherwise, the reference statistic would not be significant.
The z-scored map is analyzed in a time-frequency area of interest defined by the user, with lowest frequency f m and highest frequency f x . The z-scored map Z x is described by a set of windows ω(f, t) with f ∈ [f m , f m + 1,...f x ], t ∈ [b t , b t + 1...T - b t ] the position on the general time-frequency map respectively in frequency and time. Each ω has its own dimensions H × W (height and width), determined depending on the time-frequency resolution at the window's central frequency. The dimension W is determined to have a duration of a fixed (usually 4) number of cycles (for instance, W = 1 sec. for activities with central frequency at 4 Hz, W = 100 msec. for activities at 40 Hz). The dimension H is determined as the ratio of W to the time-frequency resolution (see ). The limit b t is determined so that b t = W/2 for the windows at the frequency f m (low frequency windows are larger than high frequency windows). In other words, the left and right limits of the modeled area are vertical, and constrained by the lower frequency so as to allow the modelisation of bumps centered at these limits  (similarly, the z-score map is modelled with extract upper and lower borders in frequencies).
where λ is a small positive value (λ is non zero for computational reasons: could not be computed for infinitesimal values of Ψ in C++).
Adaptation is performed using a combination of first and second order gradient descent (using the BFGS algorithm ). More details on the adaptation procedure can be found in  and in the appendix.
The stand-alone software was implemented in C++ for better speed, and higher stability when manipulating large data sets (Bump modeling usually computes hundreds of Frobenius norms in the time-frequency plane, it can be time-consuming – our previous implementation using Matlab was about 100 times slower).
Exchange files between Matlab and the C++ software (the '.wvf' and '.bdc' files) store data as integers. Float or double precision real numbers are recoded into integers (this can be seen in the script used to save and load these files), because Matlab and C++ Builder appear to use differing symbolic representations. The wavelet maps are implemented as objects, with time-frequency contents partitioned into windows using a chain list object. Each window is sorted using an energy function, based on the matching procedure described in the appendix. The modeling procedure selects iteratively the best window, performs the parameter adaptation, re-computes the energy of neighboring windows, and finally calls a method performing a fast sorting of the windows. In the end, this procedure avoids redundant computations: the set of window energy is computed once and for all at the beginning of the modeling. The adaptation itself is applied to bump functions, implemented as virtual methods. The algorithm uses the step gradient described in the appendix, the BFGS algorithm part was re-coded from a Numerical Recipes original code ).
Usual values of ϕ are in the [0–3] range, it corresponds to the proportion of ongoing activity which will be rejected (a z-score of 2 corresponds to 95%, a z-score of 3 to 99%). For very clean signals, a low z-score is possible, for noisy signals, the threshold should be higher. The parameter 'offset_val' represents ϕ.
In order to model , the parameter 'offset_val' must be given the value -1 in the model header.
This value is compared with a threshold F t : when three consecutive bumps have F <F t , modeling stops. The parameter 'header.limit' (usually = 0.2) represents this threshold.
A tradeoff must be performed between accuracy and relevance (also termed 'bias-variance dilemma'): if the number of bumps in the model is too low, the latter will not be accurate; if it is too large, irrelevant non-organized information from the background EEG will be modeled. When modeling is finished using the above termination criterion, we use a pruning strategy. The Matlab program 'prune_model.m' can be used to perform this pruning. Pruning can be performed with four options: pruning to remove only abnormal bumps (bumps with abnormally small amplitude, width or height, i.e. below 5.10-2); pruning to remove bumps with a threshold F t2 ≥ F t ; pruning to remove all bumps after the N first modeled (modeling order); or pruning to remove all bumps after the N first in time order. Users can combine these options, in order to obtain a clean and accurate representation.
Here we will demonstrate how this toolbox works using a toy signal, and illustrate the use of the three main parameters (z-score offset, window dimension, and convergence/pruning). All files (signal, Matlab demonstration '.m' files, application) can be downloaded on the bump toolbox project website. The toy signal ('sig_example.mat', see Fig. 1) is an EEG signal taken from one channel recorded in rest eyes closed condition (Biosemi system, 2048 Hz sampling rate, 2 sec). This demonstration can be reproduced by launching demo_zscore under Matlab 7.0 (with the wavelet toolbox). Note that due to border effects of the wavelet transform, 500 msec are automatically rejected on both sides of the wavelet map by the toolbox prior to bump modeling – hence only one second was analyzed in the following examples.
We vary the parameter 'offset_val' in the [0–5] range to show its effect on modeling (offset_val > 3 is usually not worth try, it is only shown for demonstrative purpose). The resulting models (Fig. 3, left, a1-2, b1-2, c1-2) are in the folder 'result demo_zscore). Obviously, a too permissive z-score offset (here offset_val > 2) will introduce strong bias in the model.
Using the parameter offset_val = -1, the negative components can be modeled (Fig. 3, right, a3, b3, c3). As illustrated on the figure, the negative events are even more transient, and needs usually more bumps to be properly represented.
The results of demo_zscore are shown with (Fig. 3, b1-3) or without pruning (Fig. 3, c1-3). The first model is performed with a limit F t = 0.2 without pruning, the second model is pruned with a fixed number of bumps (options 1 and 3 in 'prune_model.m').
The ButIf toolbox allows the extraction of time-frequency oscillatory events. Whatever theory (additivity, phase resetting or baseline shift) would best explain ERP, extracting transient oscillations in single trials is always relevant: if ERP are due to a change of amplitude, more transient oscillations should be observed. If instead a phase shift of the signal is observed, then the transient oscillations position will change both for transient oscillations an background EEG; combined with changes in the number of these oscillations in case we admit the theory of baseline shifts. Contrary to averaging studies, using sparse time-frequency bump modeling, analyzing the amplitude, number, or alignment of TOS and TOD becomes feasible in single trials. In other words, whatever the generation hypothesis, bump modeling allows a better understanding of the mechanism behind the presence of an ERP, because it facilitates the independent analysis of transient oscillations in single trial, which provides complementary information. The idea is not to neglect the information of ongoing activity, but instead to allow a separate study of transient oscillations on one hand, and ongoing activity on the other hand. In the end, even the presence or absence of ERP is not relevant, as the analysis of transient synchronizations and desynchronizations can be relevant even in rest conditions (e.g., ). We stress again that bump modeling is a method well suited in order to study the characteristics of transient oscillations, and should not be confused with ERP averaging.
This approach has already provided new insights in EEG and LFP signals ([22, 28]), and will hopefully allow significant progress in the investigation of brain dynamics. Nevertheless, although this toolbox is user-friendly and reasonably efficient, it is very dependent upon parameter settings. More specifically, one parameter is critical when the toolbox is used for applications such as SES [27, 28], classification , or statistical analysis : the pruning threshold. A visual inspection (using the script 'display_bumps.m') will allow users to refine this parameter. Automatic approaches to determine the best parameter are also possible. Such an optimization is usually performed with an ad-hoc algorithm depending on the application: for instance, if the application is a classification, this parameter has to be estimated during the validation procedure. As another example, in , we described an algorithm which can be used to optimize this threshold when event-related paradigms are used.
The software transforms a set of EEG signals first into a set of wavelet transforms (sored in Matlab '.mat' files), then into a bump model (more details are provided in the manual 'BUTIF Toolbox FAQ.pdf'). The outcome is a set of parameters (corresponding to the parametric bump functions) stored in structured variable inside a Matlab '.mat' file. This variable can be visualized (displaying a bump spectrogram, using the script 'display_bumps.m') or used for statistics. This provides a better understanding of the structure of EEG oscillations (TOS and TOD). Despite this toolbox provides many tools, some maintenance work will remain necessary in the future to improve and upgrade it. For instance, the choice of atom functions affects the modeling. We originally chose half ellipsoid for their sparsity (only five parameters); but despite a dissymmetric 2D curve would have more parameters, it might better represent the dissymetry of wavelet representations (larger for lower frequencies). Until now we obtained good results with half ellipsoids, but this does not mean that we might not find a better solution. Using other curves is on the list of our future experimentations and developments for the toolbox. Additionally, the pruning criterion, as explained above, is critical. It would certainly benefit from further investigations. New developments, however, will not be possible without interactions with users (we invite questions, suggestions and comments; please see the website and its discussion forum for more details). Hence, the current version only lays the foundation stone of a long-term project.
Project name: ButIf toolbox
Project home page: http://www.bsp.brain.riken.jp/bumptoolbox/toolbox_home.html
Operating system(s): Windows XP
Programming language: Matlab/C++ Builder 2006
Other requirements: Matlab 6.0 or 7.0 with wavelet toolbox is necessary to run this package (the wavelet toolbox could also be replaced by a freeware wavelet toolbox, such as the Uvi_Wave toolbox of Universidad de Vigo in Spain, which contains the complex Morlet wavelet).
License: Creative Commons License (CC-by-nc-nd) – Anyone can use this software for academic applications providing they properly reference our work when publishing research results obtained with this toolbox (citing the present paper, and ).
Any restrictions to use by non-academics: the software is restricted to non commercial applications.
In the previous implementation of bump modeling , we optimized all the bump function parameters (A, h, w, f, and t) simultaneously (first using iterations of first order gradient descent, followed by iterations of the BFGS  algorithm). An improved adaptation can be obtained by optimizing the parameters stepwise, with a priority depending on the order of their derivatives. When comparing of the parameters derivatives (dE/dA, dE/dh, dE/dw, dE/df and dE/dt), we observe that the term -2 is common to all these derivatives, multiplyed by a term in ℝ+: they will all have the same sign . The slope of the adaptation will then be dependant on the multiplicands m applied to -2E : m = 1 for dE/dA; m is a positive value in [0 - A] in numerator divided by a variable of order 3 for dE/dh and dE/dw; m is a positive value in [0 - A] in numerator divided by a variable of order 2 for dE/df and dE/dt.
This would probably be working correctly with properly normalized parameters, however we are here adapting parameters of different ranges: A ∈ [0 - 1], while h and f ∈ [1 - H/2] and w and t ∈ [1 - W/2] with H and W usually >> 1. Therefore, the multiplicands corresponding to the three above case will be of the order m ∈ O(1) in case (1), and m ∈ O(x -3) in case (2) and m ∈ O(x -2) in case (3). Practically speaking, it means that the parameters adaptation should be performed stepwise (first h and w, then f and t, and finally A). We improved the quality and speed of convergence by performing the following stepwise estimation of these parameters:
1. Update h and w until both their derivatives are below a threshold t Ψ.
2. Update f and t until both their derivative are below a threshold t pos . If at anytime dE/dh or dE/dw becomes above t Ψ, go back to 1.
3. Update only A, until its derivative is below a threshold t A . If at anytime dE/dh or dE/dw becomes above t Ψ, go back to 1. If at anytime dE/df or dE/dt becomes above t pos , go back to 2.
The adaptation is still performed using the BFGS  algorithm.
Where: denotes the Frobenius inner product, and ||·|| F indicates the Frobenius norm. This generalize the matching criterion of matching pursuit methods to 2D data, with the difference that for bump modeling, high z-score has priority on best fit. Therefore, contrary to matching pursuit, the product is not normalized by the norm of w.
Jordi Solé-Casals was supported by the Departament d'Universitats, Recerca i Societat de la Informació de la Generalitat de Catalunya, and by the Spanish grant TEC2007-61535/TCM. Monique Maurice is supported by the JSPS fellowship P-08811. Justin Dauwels is supported by the Henri-Benedictus fellowship from the King Baudouin Foundation and the BAEF. F.B. Vialatte thanks Pr. R. Gervais (CNRS team NMO) and Pr. G. Dreyfus (ESPCI, Lab. d'Électronique) and collaborators (especially C. Martin, and R. Dubois) for their significant help in the early developments of the bump modeling methodology.
This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.