A Wavelet Based Approach for the Detection of Coupling in EEG Signals R. Saab1, M.J. McKeown2,3, L.J. Myers4,and R. Abu-Gharbieh1 1
Department of Electrical and Computer Engineering, The University of British Columbia, Vancouver, BC Canada V6T 1Z4
[email protected]
2
Department of Medicine (Neurology) 3 Pacific Parkinson's Research Centre, The University of British Columbia , Vancouver, BC
[email protected]
Abstract—Electroencephalograms (EEGs) provide a noninvasive way of measuring brainwave activity from sensors placed on the scalp. In this paper we present an approach to measure coupling, or synchrony, between various parts of the brain, critical for motor and cognitive processing, using wavelet coherence of EEG signals. We provide an argument, highlighting the benefits of using this approach as opposed to the regular Fourier based coherence, in the context of localizing short significant bursts of coherence between non-stationary EEG signals, to which regular coherence is insensitive. We further highlight the benefits of the wavelets approach by exploring how a single time-frequency coherence map can be controlled to yield various time and/or frequency resolutions.
I. INTRODUCTION Understanding of cerebral dynamics is aided by the ability to track temporal coupling between various neural signals [1]. The most common way of measuring coupling is through the use of the coherence metric. Coherence is the degree of timelocked correlation between two signals as a function of frequency [2]. The problem that we address in this paper, and suggest a solution for, is that coherence assumes stationarity of the signals in question, and does not show changes in coupling with time. We claim and verify that through the use of a wavelets extension to classical Fourier coherence, one can effectively measure the dynamic behavior of coupling, thus observing how changes in task, for example, affect coupling between various locales in the brain. We believe this tool has widespread applicability for investigating the relationships between its various cortices. Coherence is a metric that has been utilized to measure the linear relationship between signals at various frequencies, and its statistical properties have been studied extensively [4]. Previous work has alluded to the possible uses of wavelet coherence, namely by Torrence and Campo [3], and a paper some time later by Lachaux et al [1] greatly developed this
4
Sensory Motor Performance Program (SMPP) Rehabilitation Institute of Chicago Chicago, IL
[email protected]
approach by building it a theoretical point of view and providing a study of its statistical significance. The use of Fourier coherence in neurophysiology is extensive [5][6]. The latter utilizes a short time Fourier transform (STFT) approach to coherence. In the rest of this paper, we briefly present coherence as a measure of coupling, and also introduce STFT extension to coherence as one of the proposed solutions to the problem of non-stationarity. We then introduce wavelet coherence, and present its formulation as a natural and logical extension to coherence measures, and explain its benefits over the standard STFT approach. We present the results to verify our arguments using real EEG data collected from a human subject performing an isometric motor task. We compare standard STFT results with the wavelet approach based on statistical significance. II. COHERENCE A. Regular Coherence and its Statistical Significance Coherence as a measure is an extension to Pearson’s correlation coefficient, and is defined as the absolute square of the cross-spectrum of two signals normalized by the product of their auto-spectra [6]. Thus one way of calculating coherence between two signals x(t) and y(t) is as follows: First, calculate the Fourier transform of each of the signals over multiple contiguous segments (overlapping or contiguous). ( f ) = 1 / 2π
∫
Yi( f ) = 1 / 2π
∫
X
i
x (t )e
− j 2 π ft
y (t )e
(1)
dt
− j 2 π ft
dt
(2)
Note that the integrals in (1) and (2) above are definite integrals running over the length of each segment, and that instead of x(t) and y(t) one could, and generally does use the
signals modulated by a smooth window function H, to reduce problems such as spectral leakage. Next, calculate the auto-spectrum of each signal and their cross-spectrum over each segment.
Pxx ( f , i ) = X i ( f ) X i* ( f )
(3)
Pxy ( f , i ) = X i ( f )Yi* ( f )
(4)
Pyy ( f , i ) = Yi ( f )Yi * ( f )
(5)
In (3), (4) and (5) Pxx and Pyy represent the auto-spectra while Pxy represents the cross spectrum, with the * operator indicating complex conjugation. Finally, calculate the coherence between the two signals. (Use the average of the spectra over the segments or windows).
∑P
xy
K( f ) =
∑P
xx
i
approach are given in [1]. III. WAVELET COHERENCE A. Wavelets In contrast to the short time Fourier transform, which is an extension of the regular Fourier transform, adapted to handle non-stationarity, the wavelet transform is inherently a timefrequency analysis of a signal. It is similar to the STFT in that it uses finite duration basis functions to estimate the transform, but different in that the length of the support is a function of frequency. Thus while the STFT uses a fixed size rectangular tiling of the time-frequency plane, the wavelet transform utilizes rectangles of variable dimensions but constant area. Naturally, they are still governed by the uncertainty principle.
2
( f , i)
i
( f , i )∑ Pyy ( f , i )
.
(6)
i
Using the Schwarz inequality, observe that the coherence takes on a value between 0 and 1. Also note here that the coherence (K) can be considered 95% significant if it exceeds the following threshold. [7]
K 0.05 ( w) = 1 − 0.051 /( N −1)
, (7) Where N represents the number of non-overlapping windows used to form the coherence estimate. B. Time-varying STFT coherence One of the problems with the coherence measure described in the previous section is that it assumes stationarity of the signals and is completely insensitive to the changes in coupling over time. In solving this problem, an STFT approach is generally used to generate auto- and crossspectrogams, which are in turn utilized to produce a ‘coherogram’. The coherogram is coherence calculated around a number of time instants. It results in a three dimensional matrix of time and frequency versus coherence. The problem with such an approach is that, while it removes the assumption of wide sense stationarity inherent in the coherence measure, it still requires stationarity within each time interval for which coherence is calculated. More importantly, in practice it requires careful design of several parameters, namely section length (over which each coherence estimate is measured), window length and overlapping (within each coherence estimate), which affects the resolution of the coupling measure. Thus the STFT approach requires a priori information about the coupling range in time and frequency, in order to allocate the time-frequency resolution which is constrained by the uncertainty principle: the wider the windows, the better the frequency resolution, at the expense of timing information, and vice versa. More details on this
Fig.1.The time frequency tiling of the STFT (left) and the wavelet transform (right).
Figure 1 shows the tiling of time frequency plane employed by the STFT and wavelet transform respectively. This tiling has the advantage of high frequency resolution at low frequencies and high temporal resolution at high frequencies. A more rigorous mathematical formulation defines the continuous wavelet transform as [8]:
W x ( s, b) =
1
∫ x(u)ψ ( s
u −b )du . s
(8)
Where x(t) is the signal to be transformed, Ψ the wavelet, b and s, are the time shift and scale respectively. Thus,Ψ((ub)/s) is a shifted and scaled version of a mother wavelet Ψ(u). In general, there exists an inverse relation between scale and frequency; frequency is inversely proportional to scale. The wavelet we have chosen for this work is the complex Morlet wavelet [9].
Ψ (u ) =
1
πfb
e
iπ f c u
e
−u
2
/ fb
(9)
Where fc is the wavelet center frequency and fb is its bandwidth (we select these parameters to be 1 and 5 respectively). One can observe from (9) that the Morlet wavelet is a complex sinusoid multiplied by a Gaussian window. The size of the window increases with frequency, while preserving the same number of oscillations across all frequencies, which is how it differs from the STFT. The STFT preserves window sizes while varying the number of oscillations within each window.
B. Wavelet Coherence Following [1], we first define the wavelet cross spectrum: *
PW xy (t , f ) = W x (t , f )W y (t , f ) .
2
∑ PW i
-2
(T , f , i )
i =− ∆ xx
-1
2 xy
(T , f , i )∑ PW yy (T , f , i )
4
,
EEG Signal Recorded Over the Primary Motor Cortex
0
(11)
0
5
x 10
-4
10
15
20
25
30
35
40
45
EEG Signal Recorded Over the Supplementary Motor Cortex
2 0
i
Where T is the time around which the coherence is calculated, i is the current index, and f is the frequency. The summations are carried around a variable segment size ∆, which is inversely proportional to frequency. Just as with the Fourier based coherence, the Schwarz inequality forces the wavelet coherence to take on a value between 0 and 1. In this paper, we set ∆ to 10 cycles of the frequency f. In other words, at 30 Hz, we chose ∆ so that the summation over i covers 1 / 30 * 10 = 0.333 seconds, whereas for 60Hz it covers 0.166 seconds of data. Note, that like the STFT coherence, the wavelet coherence is also a function of both time and frequency, measuring the coupling across both variables. The fact that the wavelet transform uses a shorter window for higher frequencies, and a longer one for lower frequencies, in addition to the fact that the coherence segment ∆ is also inversely proportional to frequency, makes this approach more suited to quantifying time varying coherence. This is accomplished via a frequency-adaptive tiling of the time frequency plane. In contrast, the constant size windows, and summation segments of the STFT coherence, force it to have the same resolution over all frequencies. IV. EXPERIMENT A. Methods EEG was recorded from the scalp using 61 electrodes. Two channels located over the primary motor cortex (PMC) and one channel located over the supplementary motor cortex (SMC) were selected for coherence, STFT coherence and wavelet coherence measurements. The subject was performing an isometric task. Data length was 45 seconds and onset of the task was at approximately 5 seconds. Data were sampled and digitized at 2000Hz. The entire EEG data set was subjected to a Laplacian Spatial Filter using commercial software[10]. It was then bandpass filtered between 0.5 and 70Hz and downsampled to 200Hz to reduce the computational load. Figure 2 displays the time domain signals after the preprocessing steps. B. Results We computed regular coherence between the first PMC channel and the SMC channel as in (6) using a window size of
-2 -4
0
5
10
15
20
25
30
35
40
45
Fig.2. EEG signal recorded from the primary motor cortex (top) and supplementary motor cortex (bottom). Regular Coherence 0.4 0.35 0.3 Coherence Index
C (t , f ) =
∑ PW
-4
1
(10)
The definition of the auto-spectrum follows naturally from this, as in the preceding section on coherence. Next we calculate the wavelet coherence (C) as follows: ∆
x 10
0.25 0.2 0.15 0.1 0.05 0 10
20
30
40 Frequency
50
60
70
Fig.3. Regular coherence plotted versus frequency. Observe the peak at 30Hz.
100, corresponding to 0.5 seconds, and overlapping of half the window size. The results are displayed in fig.3. Fig.3 indicates that the strongest coupling is around 30Hz, however it gives no information as to how that coupling is distributed over the 45-second duration of the experiment. Thus, to gain more insight into the temporal distribution of the coherence, we resort to computing both the STFT coherogram and the Wavelet coherogram. Fig.4 displays the result of the STFT coherogram, after we removed the insignificant peaks. We evaluated significance based on (7), calculated at each time instant, and verified via Monte Carlo simulations on white noise [1]. The STFT coherence was based on a segment size of four seconds Next, we perform the wavelet coherogram as in (11), to obtain the result in fig.5 showing only the significant peaks. Significance was tested based on the tabulated values reported in [1]. Fig.5 shows the high temporal resolution exhibited by the wavelet based coherence. It shows us that the coherence in the 30Hz band, previously shown to be related to ongoing
wavelet Coherogram 70
60
50 Frequency
muscle contraction is in fact not completely continuous. This information would have been lost on us with the STFT coherence. However, for the sake of comparing the two methods fairly, we smooth the wavelet coherogram over a four second interval. The rationale behind this choice is that four seconds is the length of each segment in the STFT coherence. The results of this smoothing operation can be seen in fig.6. For further comparison with Fourier based coherence, fig. 7 displays the average wavelet coherence across time. Upon comparing with fig.3, one can observe that they offer approximately identical frequency resolution.
40
30
20
STFT Coherogram
10
70
0
5
10
15
20
25
30
35
40
Time
Fig.5. Wavelet Coherence plotted as a grayscale image. Darker regions indicate higher levels of coherence. This is the coherence between the first PMC channel and the SMC channel.
60
wavelet Coherogram
40
70
30
60
20
50
10
0
5
10
15
20
25
30
35
40
45
Time
Frequency
Frequency
50
Fig.4. STFT coherence plotted as an image in grayscale versus time and frequency. The darker regions indicate higher levels of coherence. This is the coherence between the first PMC channel and the SMC channel.
C. Discussion Upon comparing fig.4 and fig.6, one notices that the wavelet coherence detects the coupling between the two signals, regardless of the frequency range. This is an immediate consequence of the frequency-adaptive window size utilized in both the wavelet transform and the wavelet coherence estimate. On the other hand, the STFT coherence, whose parameters were designed to detect coherence around the 30Hz range, fails at detecting coupling at 60Hz, which we know exists as a result of line interference on both channels. Similarly, upon comparing fig.8 and fig.9, one immediately notices the predominant 10Hz coherence in both. We speculate that this 10Hz signal represents subcortical influence of the basal ganglia, via the venterolateral thalamic nucleus, to the SMC, which is then being communicated to the PMC. With the wavelets approach, this important coherence was
30
20
10
0
5
10
15
20
25
30
35
40
Time
Fig.6. Wavelet coherence displayed after smoothing over a span of four seconds. Compare with fig. 4. Average Wavelet Coherence 0.46 0.44 Averaged Wavelet Coherence Index
To further test the wavelet coherence method, in comparison with the STFT coherence method, we next evaluate both of them over another pair of channels. This time we choose a second channel from the primary motor cortex more anterior than the first, with the same supplementary motor cortex channel as previously. We show the results of the STFT approach in fig.8, and of the wavelets approach in fig.9.
40
0.42 0.4 0.38 0.36 0.34 0.32 0.3
10
20
30
40 Frequency
50
60
70
Fig.7. Marginal Wavelet Coherence plotted versus frequency. This was obtained by averaging the wavelet coherence across all time instances.
detected in instances where the STFT approach fails to register significant coherence. For example, the STFT approach again fails to detect the 60Hz coherence, and also fails to register
some instances where 10Hz coherence exists.
In conclusion, we have shown how the wavelets coherence performs favorably compared to the STFT coherence approach at detecting coupling at various frequency ranges, especially when the potentially ‘interesting’ frequencies cannot be specified a prior. As both methods reveal that the EEG-EEG coupling between brain regions are transient, task-dependent, and take place at multiple frequencies, the wavelet coherence may prove advantageous because it is more versatile in modifying the temporal resolution to observe long-term trends in coupling.
wavelet Coherogram 70
60
Frequency
50
40
30
20
REFERENCES 10
0
[1]
0
5
10
15
20
25
30
35
40
Time
Fig.9. Wavelets coherence of the second primary motor cortex channel, with the supplementary motor cortex channel, plotted after smoothing. The darker regions indicate higher levels of coherence.
STFT Coherogram 70
60
Frequency
50
40
30
20
10
0
0
5
10
15
20
25
30
35
40
45
Time
Fig.8. STFT coherence of the second primary motor cortex channel, with the supplementary motor cortex channel, plotted as an image in grayscale versus time and frequency. The darker regions indicate higher levels of coherence.
J. P. Lachaux, et al., “Estimating the time-course of coherence between single-trial brain signals: an introduction to wavelet coherence,” Neurophysiol. Clin , 32(3),2002, pp.157-74. [2] J.N. Caviness, C.H. Adler, M.N. Sabbagh, D.J. Connor, J.L. Hernandez, T.D. Lagerlund, “Abnormal corticomuscular coherence is associated with the small amplitude cortical myoclonus in Parkinson's disease,” Mov Disord.,18(10), Oct 2003, pp. 1157-62. [3] C. Torrence, and G.P. Compo, “A Practical Guide to Wavelet Anaysis,” Bulletin of the American Meteorogical Society, vol.79 (1), pp. 61-78. [4] D.M. Halliday, J.R. Rosenberg, A.M. Amjad, P. Breeze, B.A. Conway, and S.F. Farmer, “A Framework for the analysis of mixed time series/point process data- theory and application to the study of physiological tremor, single motor unit discharges and electromyograms,” Prog. Biophys. Molec. Biol.,vol. 64(2-3), 1995, pp.237-278 [5] M.R. Baker, and S.N. Baker, “The effect of diazepam on motor cortical oscillations and corticomuscular coherence studied in man,” J.Physiol, 546(3), 2003, pp.931-942. [6] P. Grosse, M.J. Cassidy, P. Brown, “EEG-EMG, MEG-EMG and EMGEMG frequency analysis: physiological principles and clinical applications,” J.Clinical Neurophysiology, vol. 113, 2002, pp. 15231531 [7] J.R. Rosenberg, A.M. Amjad, P. Breeze, D.R. Brillinger, and D.M. Halliday, “The Fourier approach to the identification of functional coupling between neuronal spike trains,” Prog. Biophys. Mol. Biol., vol 53, 1989, pp 1-31 [8] S. Mallat, A Wavelets Tour of Signal Processing. San Diego, CA: Academic Press, 1998, ch. 4. [9] Inc The Math Works, MATLAB wavelets toolbox 2.0 reference guide. [10] D.J. Macfarland, L.M. McCane, S.V. David, J.R. Wolpaw, “Spatial filter selection for EEG-based communication,” Electroencephalogr.Clin. Neurophysiol, vol. 103(3), sep 1997, pp.386-394.