version 1.0 – june 29, 2004 hand calculator calculations ... calculator.pdf · version 1.0 –...

22
Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert W. Thatcher, Ph.D., 1,2 Carl J. Biver 1 , Ph.D. and Duane M. North 1 , MA NeuroImaging Laboratory, Bay Pines VA Medical Center 1 and Department of Neurology, University of South Florida College of Medicine 2 , Tampa, Florida 1 - Introduction Coherence is a measure of the amount of association or coupling between two different time series. Coherence is mathematically analogous to a Pearson product-moment correlation, however, coherence yields a much finer measure of shared energy between mixtures of periodic signals than can be achieved using the Pearson product-moment correlation coefficient. In fact, coherence is essential because the degree of relationship or coupling between any two living systems cannot be fully understood without knowledge of its frequency structure over a relative long period of time. Another advantage of Coherence is its dependence on the consistency of the average phase delay between two time series, where as the Pearson product- moment correlation coefficient is independent of phase delay. The fine details of the temporal relationship between coupled systems is immediately and sensitively revealed by coherence. In this paper we will first describe the mathematics of the autospectrum and Power Spectrum as they apply to EEG coherence by using simple hand calculator instructions so that one can step through the mathematics and understand coherence and phase at a basic level (some of the deeper mathematical detail is in the Appendix). We will step the reader through simple examples that can be solved with a hand calculator (scientific calculator is recommended) to further illustrate how coherence is computed and to demonstrate by simulation of EEG signals and noise. We will also address the statistical properties of the power spectrum, coherence and phase synchrony using calibration sine waves and the FFT in order to illustrate the nature of coherence and phase angle (i.e., phase delay and direction) and finally, a statistical standard by which the signal-to-noise ratio and degrees

Upload: trannhan

Post on 17-Apr-2018

221 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

Version 1.0 – June 29, 2004

Hand Calculator Calculations of EEG Coherence and Phase Delays

Robert W. Thatcher, Ph.D.,1,2 Carl J. Biver1, Ph.D. and Duane M. North1, MA

NeuroImaging Laboratory, Bay Pines VA Medical Center1 and

Department of Neurology, University of South Florida College of Medicine2, Tampa, Florida

1 - Introduction Coherence is a measure of the amount of association or coupling between two different time series. Coherence is mathematically analogous to a Pearson product-moment correlation, however, coherence yields a much finer measure of shared energy between mixtures of periodic signals than can be achieved using the Pearson product-moment correlation coefficient. In fact, coherence is essential because the degree of relationship or coupling between any two living systems cannot be fully understood without knowledge of its frequency structure over a relative long period of time. Another advantage of Coherence is its dependence on the consistency of the average phase delay between two time series, where as the Pearson product-moment correlation coefficient is independent of phase delay. The fine details of the temporal relationship between coupled systems is immediately and sensitively revealed by coherence. In this paper we will first describe the mathematics of the autospectrum and Power Spectrum as they apply to EEG coherence by using simple hand calculator instructions so that one can step through the mathematics and understand coherence and phase at a basic level (some of the deeper mathematical detail is in the Appendix). We will step the reader through simple examples that can be solved with a hand calculator (scientific calculator is recommended) to further illustrate how coherence is computed and to demonstrate by simulation of EEG signals and noise. We will also address the statistical properties of the power spectrum, coherence and phase synchrony using calibration sine waves and the FFT in order to illustrate the nature of coherence and phase angle (i.e., phase delay and direction) and finally, a statistical standard by which the signal-to-noise ratio and degrees

Page 2: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

of freedom in the computation of EEG coherence are measured using a hand calculator and by computer simulation of the EEG. Computer signal generators not only verify but most importantly also explore a rich universe of coherence and phase delays with a few mouse clicks (download a free EEG simulator at: http://www.appliedneuroscience.com/download demo.html. Another free EEG simulation program is at: http://www.besa.de/index_home.htm a third free EEG simulation program (purchase of MatLab required) is at: http://www.sccn.ucsd.edu/eeglab/index.html

Mathematical and statistical standardization of EEG coherence are best understood using a hand held calculator and then by simulation of the EEG. 2- What is Coherence? Coherence combines something analogous to the “Pearson product-moment correlation” with the additional information of a cross-correlation function of phase delays between two signals at different frequencies. Coherence arises from Joseph Fourier’s 1817 fundamental inequality where by the ratio of the cross-spectrum/product of auto-spectrum < 1. Coherence is inherently a statistical estimate of coupling or association between two time series and is in essence the correlation over trials or repeated measures. The critical concept is “phase consistency”, i.e., when the phase relationship between two time series is constant over trials than coherence = 1. 3- How Does One Compute Coherence? The first step in the calculation of the coherence spectrum is to describe the activity of each raw time-series in the frequency domain by the “auto-spectrum” which is a measure of the amount of energy or “activity” at different frequencies. The second step is to compute the “cross-spectrum” which is the energy in a frequency band that is in common to the two different raw data time-series. The third step is to compute coherence which is a normalization of the cross-spectrum as the ratio of the auto-spectra and cross-spectra. To summarize: 1- Compute the auto-spectra of channels X and Y based on the “atoms” of

the spectrum 2- Compute the cross-spectra of X and Y from the “atoms” of the spectrum 3- Compute Coherence as the ratio of the auto-spectra and cross-spectra

Page 3: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

4- First Compute the auto-spectra of channels X and Y based on the “atoms” of the spectrum Joseph Fourier in his thesis of 1810, benefiting from almost a century of failed attempts, finally correctly showed that any complex time-series can be decomposed into elemental “atoms” of individual frequencies (sine and cosine and linear operations). Fourier defined the autospectrum as the amount of energy present at a specific frequency band. He showed that the autospectrum can be computed by multiplying each point of the raw data by a series of cosines, and independently again by a series of sines, for the frequency of interest. The average product of the raw-data and cosine is known as the cosine coefficient of the finite discrete Fourier transform, and that for the sine and the raw data as a sine coefficient. The relative contributions of each frequency are expressed by these cosine and sine (finite discrete Fourier) coefficients. The cosine and sine coefficients constitute the basis for all spectrum calculations, including the cross-spectrum and coherence. Tick (1967) referred to the sine and cosine coefficients as the ‘atoms” of spectrum analysis. For a real sequence {xi, i = 0, . . . ., N -1} and ∆t = the sample interval and f = frequency, then the cosine and sine transforms are:

Eq.1 - The cosine coefficient = ∑=

∆∆=N

itfiiXtna

12cos)()( π

Eq.2 - The sine coefficient = ∑=

∆∆=N

itftiXtnb

12sin)()( π

The hand calculation of the individual coefficients is complicated and here are some steps that are helpful:

1- Evaluate i * ∆t * f * 2л = θ. 2- Compute cos θ and then sin θ. 3- Compute xi cos θ, and then xi sine θ. 4- Accumulate both sums. 5- Increment i; return to step 1.

A numerical example of the computation of the Fourier Transform is shown in Table I. The data is from Walter (1969) which served as a numeric calibration and tutorial of EEG coherence in the 1960s (see also

Page 4: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

Jenkens and Watts, 1969 and Orr and Naitoh, 1976). This 1960s dataset is still useful for explaining the concept of spectral analysis as it applies to the Electroencephalogram as QEEG was developed in the 1950’s and used at UCLA and other universities giving rise to a large number of publications and the development of the BMDP Biomedical statistical programs in the 1960s. The Walter (1969) data are 8 digital time points that were sampled at 100 millisecond intervals (0.1 sec. intervals) with 3 separate measurements (i.e., repetitions). The highest frequency resolution of this data set is defined as 1/T = 1/0.8 sec. = 1.25 Hz. The highest discernable frequency is 5 Hz (Nyquist limit) and thus the data are bounded by 1.25 Hz and 5 Hz, with values at every 1.25 Hz. I will use the same historic examples that pioneers used in the early development of quantitative EEG used in the 1950s - 1970s. The analyses below are based on the careful step by step evaluation of the Walter (1969) paper by Orr, W.C. and Naitoh, P. in 1967 which we follow.

The Walter (1969) cosine and sine coefficients in Table I will be used for the purpose of this discussion. The focus will be on the use of a hand calculator to compute coherence using the values in Table I and not on the computation of the coefficients themselves. The reader is encouraged to either write intermediate values on a piece of paper or to store temporary variable values using the memory keys of their hand calculator.

Table I Example of Raw Data

Table of Channel X Observation (seconds) 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7

Table of Channel Y Observation (seconds) 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7

Record 1 3 5 -6 2 4 -1 -4 1 Record 2 1 1 -4 5 1 -5 -1 4 Record 3 -1 7 -3 0 2 1 -1 -2

Record 1 -1 4 -2 2 0 -0 2 -1 Record 2 4 3 -9 2 7 0 -5 1 Record 3 -1 9 -4 -1 2 4 -1 -5

Hand Calculator Example of Cosine and Sine Coefficients Channel X Channel Y Cosine Coefficients a(x) Cosine Coefficients b(y) f (Hz) 1.25 2.5 3.75 5.0 f (Hz) 1.25 2.5 3.75 5.0 Record 1 0.634 4.25 -1.134 -1.25 Record 2 0.634 2.0 -1.134 -0.875Record 3 -0.043 1.75 -1.457 -1.375

Record 1 -0.073 -0.25 -0.427 -0.75 Record 2 -0.398 6.5 -1.106 -1.25 Record 3 -0.368 1.5 -0.934 -1.375

Page 5: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

Average 0.408 2.667 -1.242 -1.167 Average -0.272 2.583 -0.822 -1.125 Channel X Channel Y Sine Coefficients b(x) Sine Coefficients b(y) f (Hz) 1.25 2.5 3.75 5.0 f (Hz) 1.25 2.5 3.75 5.0 Record 1 0.737 0.25 1.737 0.000 Record 2 0.487 -3.25 1.987 0.000Record 3 0.414 2.5 2.414 0.000 Average 0.546 -1.67 2.048 0.000

Record 1 0.237 0.75 2.237 0.000 Record 2 -0.043 0.00 1.457 0.000 Record 3 0.641 4.75 2.341 0.000 Average 0.345 1.833 2.012 0.000

Autospectrum X Autospectrum Y f (Hz) 1.25 2.5 3.75 5.0 f (Hz) 1.25 2.5 3.75 5.0 Record 1 0.945 18.125 4.303 1.563 Record 2 0.639 14.563 5.234 0.766 Record 3 0.173 9.313 7.95 1.891 Average 0.586 14.00 5.838 1.407

Record 1 0.061 0.625 3.186 0.561 Record 2 0.159 42.25 3.342 1.563 Record 3 1.036 24.813 6.353 1.891 Average 0.419 22.561 4.96 1.339

The frequency analysis of a time series of finite duration “at” a chosen frequency does not really show the activity precisely at that frequency alone. The spectral estimate reflects the activities within a frequency band whose width is approximately 1/T around the chosen frequency. For example, the activity “at” 1.25 Hz in the example in Table I represents in fact the activities from 0.625 Hz to 1.875 Hz (or equivalently, 1.25 Hz ± 0.625 Hz).

The autospectrum is a “real” valued measure of the amount of activity present at a specific frequency band. The autospectrum is computed by multiplying the raw data by the cosine, and independently, by the sine for the frequency of interest in a specific channel. The average product of the raw-data and cosine is referred to as the “cosine coefficient” of the finite discrete Fourier transform, and the average product of the sine and the raw-data is referred to as the sine coefficient. Let N, f and a(x) represent the number of observed values for a time series x(i), the frequency of interest, and a cosine coefficient n, then the summation or necessary “smoothing” is defined as:

Eq.3 - The average cosine coefficient = ∑=

=

N

i NifiX

Nna

1

2cos)(1)( π

Page 6: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

Eq.4 - The average sine coefficient = ∑=

=

N

i NifiX

Nnb

1

2sin)(1)( π

Each frequency component has a sine and cosine numerical value. The actual autospectrum value is arrived at by squaring and adding the respective sine and cosine coefficients for each time series. The power spectral value for any frequency intensity is: Eq. 5 - F(x) = (a2 (x) + b2 (x)), That is, the power spectrum is the sum of the squares of the sine and cosine coefficients at frequency f as shown in Table I. 5- Second Compute the cross-spectra of X and Y from the “atoms” of the spectrum

To calculate the cross-spectrum, it is necessary to consider the “in-phase” and “out-of-phase” components of the signals in channels X and Y. The former is referred to as the co(incident) spectrum or cospectrum and the latter is referred to as the guadrature spectrum or quadspectrum. The “in-phase” component is computed by considering the sine coefficients as well as the cosine coefficients of X and Y. The “out-of-phase” component concerns relating the cosine coefficient of time series X to the sine coefficient of times series Y, and similarly the sine coefficient of times series X to the cosine coefficient of time series Y. Below is a hand calculator example of how to compute the coherence spectrum. Step 1 is to calculate the cospectrum and quadspectrum: a(x) = cosine coefficient for the frequency (f) for channel X b(x) = sine coefficient for the frequency (f) for channel X u(y) = cosine coefficient for the frequency (f) for channel Y v(y) = sine coefficient for the frequency (f) for channel Y The cospectrum and quadspectrum then are defined as: Eq. 6 - Cospectrum (f) = a(x) u(y) + b(x) v(y)

Page 7: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

Eq. 7 - Quadspectrum (f) = a(x) v(y) – b(x) u(y) The cross-spectrum amplitude is, however, real valued and defined as: Eq. 8 - (f) = ))()((cos 22 fumquadspectrfpectrum + Eq. 9- = 22 ))()()()(())()()()((( yUxByVxayVxByUxA −++ That is, the cross-spectrum amplitude is the absolute value of the complex-valued cross-spectrum. Table II is an illustration of the computational details of coherence based on the FFT auto and cross-spectra in Table I:

Table II Hand Calculator Example

Cospectrum, Quaspectrum and Ensemble Smoothing F (Hz) Cospectrum

1.25 2.50 3.75 5.00 Quaspectrum 1.25 2.50 3.75 5.00

Record 1 Record 2 Record 3 Average

0.128 -0.875 4.375 0.938 -0.272 13.00 4.147 1.094 0.363 14.50 7.012 1.891 0.073 8.875 5.176 1.307

0.204 3.25 -1.795 0.000-0.22 -21.125 0.541 0.000 0.108 4.563 -1.156 0.000 0.031 -4.438 -0.803 0.000

Cospectrum (1.25 Hz) = 0.634(-0.073) + 0.737(0.237) = 0.128 Quadspectrum (1.25 Hz) = 0.634(0.237) – 0.737(-0.073) = 0.204 Cross-spectrum (1.25 Hz) = 0.128 + sq. root -1 (0.204) and Cross-spectrum amplitude (1.25 Hz) = (0.1282 + 0.2042) ½ = 0.241 This computation is repeated for each frequency component to yield the complete cross-spectrum.

Page 8: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

6- Third Compute Coherence as the ratio of the auto-spectra and cross-spectra

Coherence is usually defined as:

Eq. 10 - Coherence (f) = )))(())()(((

)( 2

YfumAutospectrXfumAutospectrXYfSpectrumCross −

However, this standard mathematical definition of coherence hides some of the essential statistical nature and structure of coherence. To illustrate the fundamental statistics of coherence let us return to our simple algebraic notation: Eq. 11 -

Coherence (f) = ∑ ∑

∑ ∑++

−++

N N

N N

yvyuxbxa

yuxbyvxayvxbyuxa

))()())()((

)))()()()((()))()()()(((

2222

22

Where N and the summation sine represents averaging over frequencies in the raw spectrogram or averaging replications of a given frequency.or both. The numerator and denominator of coherence always refers to smoothed or averaged values, and, when there are N replications or N frequencies then each coherence value has 2N degrees of freedom. Note that if spectrum estimates were used which were not smoothed or averaged over frequencies nor over replications, then coherence = 1 (Bendat and Piersol, 1980; Benignus, 1968; Otnes and Enochson, 1972). In order to compute coherence, averaged cospectrum and quaspectrum smoothed values with degrees of freedom > 2 and error bias = 1/N is used. The numerical example of coherence used the average cospectrum and quadspectrum across replications in Table II. For example from Table II the coherence at 1.25 Hz is:

Eq. 12 - Hand Calculator Coherence (1.25 Hz) = 026.0)419.0(586.0

031.0073.0 22

=+

This computation is repeated for each frequency component to yield the complete coherence spectrum, a typical plot of coherence is frequency on

Page 9: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

the horizontal axis (abscissa) and coherence on the vertical axis (ordinate). Coherence is sometimes defined and computed as the positive square-root and this is referred to as “coherency”. 7- Some Statistical Properties of Coherence How large should coherence values be before they can be considered reliable? The answer is it depends on the true coherence relationship and the degrees of freedom used in the averaging computation in equation 9. In general the degrees of freedom increase as a square root of N (i.e., the amount of smoothing) and the more the degrees of freedom the better (i.e., averaging across frequency and/or across repetitions or “smoothing”). The trade off is between frequency resolution and reliability, the longer the interval of time over which averaging occurs or the larger the number of repetitions then the greater are the degrees of freedom. Short time intervals of low frequencies by their nature have low degrees of freedom. For example for the theta frequency band 4 – 7 Hz NeuroGuide EEG coherence for a 1 minute sample = 7 (0.5 Hz bins) + 117 FFTs = 124 x 2 = 248 degrees of freedom. 8- How large should coherence be before it can be regarded as significantly larger than zero? Low degrees of freedom always involve “Inflation” of the true signal-to-noise relationship between two channels when a Pearson product correlation coefficient is computed. EEG coherence is no exception and this explains why coherence is highly inflated when the degrees of freedom are low and the bandwidth is small. For example, figure 1 shows the inflation of coherence (y-axis) when a signal in one channel ( 4 Hz – 19 Hz sine wave) is compared to random noise in a second channel with increasing degrees of freedom (x-axis) and different bandwidths. The ideal is coherence = 0.

Page 10: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

Fig 1 –

01020

3040506070

8090

100

0 20 40 60 80 100 120

Series1Series2Series3Series4Series5

The digital reality of low degrees of freedom using a 2 Hz bandwidth are also shown in figure 1. The y-axis is coherence (x100). The x-axis are the number of time samples at a sample rate of 128 Hz using a digital filter (complex demodulation) to compute coherence. The five curves represent different bandwidths (4 Hz, 6 Hz, 8 Hz, 10 Hz & 12 Hz). The ideal coherence value = 0 at infinity. Mathematically coherence inflation is defined as: Eq. 13 – Inflation of Coherence (white noise - signal) = [0 - Observed coherence] and as in calculus in equation 16. The curves in Figure 1 show that after 1 second of averaging the EEG coherence inflation values ranged from 1 to 0.10 (or 10%). Figure 1 also shows that the wider the band width then the larger the number of degrees of freedom. The equation to compute the degrees of freedom when using complex demodulation is: Eq. 14 - Df = 2BT Where B = bandwidth and T = time samples (Otnes and Enochson, 1972).

Bendat and Piersol (1980) as elaborated by Nunez et al (1997) provide another measure of the 95% interval for coherence which is expressed as:

Page 11: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

Eq. 15 - e

iFiFe

iF21)()(

21)(

−≤≤

+

Where F(i) applies to the auto or cross spectral density or coherence. The confidence interval depends on the error term e defined as the RMS error (i.e., root mean square error). In general, the error may be estimated by:

Eq. 16 - N

e f

1=

9- Is there an inherent time limit for EEG Coherence Biofeedback?

The answer is yes, because coherence is unique in EEG biofeedback because it depends upon averaging the phase delays. The lower the variance or the more constant the phase delays (or the greater the phase synchrony) then the higher the coherence. Similarly, as a property of statistics the greater the degrees of freedom then the less the statistical inflation of the real coherence value. Based on operant conditioning studies the feedback interval or feedback delay is crucial for the ability of the brain to link together two past events. Too short an interval or too long an interval reduces the likelihood of a person making a “connection” between the biofeedback display/sound or signal and the brain’s electrical state at a previous moment in time. In the case of amplitude and phase delay the calculation does not depend upon an average as it does when computing coherence. Thus, coherence EEG biofeedback inherently requires a longer feedback delay than does the nearly instantaneous computations of power, ratios of power, relative power, amplitude, amplitude asymmetries, phase delay, etc. To the best of our knowledge the minimum amount of inflation that leads to the greatest efficacy of biofeedback training using EEG coherence has not yet been published. The minimal interval is a function of at least two factors: 1- the stability of the signal being fed back, i.e., a noisy and jumpy signal has no connection formation value and, 2- the interval of time between the brain event and the feedback. Both are critical and seconds and milliseconds are the domain. This is the first publication on this topic from a digital signal processing point of view and not from empirical clinical studies.

Page 12: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

10- What is “Phase Delay” or Phase Angle? Coherence and phase angle are linked by the fact that the average temporal consistency of the phase angle between two EEG time series (i.e., phase synchrony) is directly proportional to coherence. For example, when coherence is computed with a reasonable number of degrees of freedom (or smoothing) and approaches unity, then the phase angle between the two time-series becomes meaningful because the confidence interval of phase is a function of the magnitude of the coherence and the degrees of freedom. If the phase angle is random between two time series then coherence = 0. Another way to view the relationship between phase consistency (phase synchrony) and coherence is to consider that if Coherence = 1, then once the phase angle relation is known the variance in one channel can be completely accounted for by the other. The phase relation is also critical in understanding which time-series lags or leads the other or, in other words the direction and magnitude of the delay. The phase angle is defined as:

Eq. 17 - Phase angle (f) = Arctan ))(cos())((

fpectrumSmoothedfadspectrumSmoothedqu

In the numerical example in Table II, Phase angle (1.25 Hz) = Arctan 0.031/0.073 = 22.7o

11- How large should coherence be before Phase Delay can be regarded as reliable? As mentioned previously, the confidence internal for the estimation of phase delay or phase angle is directly related to the magnitude of coherence. This means that when coherence is too low, e.g., < 0.2, then the estimate of the average phase angle may not be reliable and phase relationships could be non-linear. An example of a 30 degree phase delay using the NeuroGuide signal generation program is shown in figure 2:

Page 13: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

Figure 2 shows an example of two 10 uV sine waves with the second sine wave shifted by 30 degrees with increasing amounts of noise added to the signal in one channel (signal-to-noise ratio). The data is 60 seconds sampled at 128 Hz.(from Thatcher et al, 2004).

Page 14: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

Figure 3 (from Thatcher et al, 2004) shows increased variability of EEG phase delay as noise is systematically added to the 30 degree shifted sine wave. Note that non-linear dynamical processes are suggested by the fact that the mean = 30 degrees when coherence < 0.2. Chaotic dynamics and reproducible correlations are often embedded in similar time data.

Page 15: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

Figure 4 (from Thatcher et al, 2004) shows that EEG coherence

linearly decreases as a function of the signal-to-noise ratio. It can be seen that phase delays even with 248 degrees of freedom are instable and poorly estimated as coherence decreases. EEG coherence at 0.2 or less is used as a cut-off for accepting phase as a valid and stable linear measure. The instability of a non-linear system may be present because the mean phase delay = 30 degrees when coherence is less than 0.2, see Figure 2 Figures 1 – 4 were computed using the NeuroGuide signal generation program and by systematically increasing the amount of white “noise” added to one of the channels used to compute coherence and phase delay. In general, as the value of coherence decreases below approximately 0.2 or 20% (i.e., coherence x100) then phase delays are extremely variable and unstable at 248 degrees of freedom. The calculations in figures 1 - 4 exceed what is possible using a hand held calculator, however, computer simulations can produce results much faster than a hand calculator. The understanding of coherence and phase can be explored by any one who downloads the free NeuroGuide demo at: www.appliedneuroscience.com/Download Demo.html and tests coherence and phase for themselves and use a hand calculator to verify at least one of the calculations.

Page 16: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

12- What is “Inflation” of Coherence Coherence inflation is defined as any value of coherence (x) greater than zero when coherence is computed using pure Gaussian noise in one of the two channels and a pure sine wave in the other channel. Eq. 18- Coherence Inflation x > 0 This is the error term when one of the channels is pure Gaussian noise and the second channel is signal. Any value of coherence > 0 is due to error attributable to low degrees of freedom, inadequate signal resolution or too short of measurement interval, or improper sample rates within that interval, etc.

Figure 5 below shows an example of a 5 Hz 10uVsine wave in one channel and 100 uV (p-p) gausian noise in the second channel. The power spectrum of the two channels is shown in the upper right panel. Figure 5 is just one example of the analyses performed by the NeuroGuide Signal Generator that directly test EEG simulated EEG cross-spectra.

Page 17: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

Figure 5. Screen capture of the NeuroGuide signal generation program. Top trace is a 5 Hz 10 uV sine wave + 0 noise and the bottom trace is the mixture of a 5 Hz 10 uV sine wave + 100 uV Gaussian noise.

13- What are the limits of EEG Coherence and Phase Biofeedback As explained above, coherence requires averaging of time series data points in order to converge to an accurate estimate of shared activity between two time series. This means that coherence, unlike absolute power, is not instantaneous and always requires time to compute. The most important factors in EEG coherence biofeedback are: 1- The band width, 2- Sample rate and , 3- Interval of time over which Averaging occurs. Band width is directly related to the number of degrees of freedom. The wider the band width, the larger the number of degrees of freedom. However, with increased band width then there is reduced frequency resolution. In general, the standard band widths of EEG which are + & 1 2 Hz are adequate such as theta (4 – 7.5 Hz), Alpha (8 – 12 Hz), Beta (12.5 – 22 Hz) and Gamma (25 – 30 Hz), etc.. These are adequate ranges of frequency by which degrees of freedom can accumulate, however, shorter bandwidths, for example 0.5 Hz or 1 Hz will equal unity when coherence is computed unless there are sufficient degrees of freedom to resolve true “signals” in the brain, which in the case of the human scalp EEG a 2,000 Hz sample rate is more than adequate. Figure 6 below shows the results of tests using mixtures of signal and noise as in Figure 5 in which mean coherence is the Y – Axis as a function of sample rate (i.e., 512 Hz top left, 256 top right, 128 bottom left & 64 Hz bottom right). This figure will be replaced with a series of more clearly labeled figures in the next version of this paper. For the moment, accept the fact that the amount of time for averaging on the X - axis (125 msec., 250 msec., 500 msec. and 1,000 msec. results in lower coherence values, i.e., lower coherence inflation. This test involved computing coherence between one channel of pure sine waves (10 uV p-p) at different frequencies (theta, alpha, beta & gamma) and a second channel with pure Gaussian noise (also 10 uV p-p). It can be seen that the most important factor in determining coherence “Inflation” is the length of time for averaging. 1,000 msec. produces coherence = 0.1 (or 10%) inflation. Inflation is defined above as any value > 0 when pure Gaussian noise is in one of the channels. 500 msec produces coherence inflation = 0.2 (or 20%) inflation while 250 msec produces coherence inflation = 0.3 to 0.4 and 125 msec = 0.5 to 0.6 inflation. The coherence inflation is independent of band width, frequency

Page 18: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

and sample rate. The only critical factor is the interval of time over which the average is computed, the longer the interval the lower the inflation. The results of these analyses are that a minimum of a 500 millisecond delay is required in order to compute a reasonably accurate estimate of coherence. The amount of inflation is relative low (e.g., 0.2 or 20%) and as long as the same interval of time of averaging is used with a normative database, then the Z scores of real-time coherence will be valid and accurate. 1,000 milliseconds produces even lower inflation, however, a 1 second delay between a brain event and the feedback signal may be too long for connection formation in a biofeedback setting.

Figure 6. Mean coherence (y-axis) and the integration window size in milliseconds (x-axis). Top left is sample rate = 512Hz, top right sample rate = 256 Hz, bottom left sample rate = 128 Hz and bottom left sample rate = 64 Hz. Figure 7 below is the same as figure 6, but contains the standard deviations. A 500 msec. averaging delay = 0.15 standard deviation while 1,000 msec = 0.1 standard deviation. This figure shows that the choice of a 500 millisecond integration delay yields a reasonably stable estimate of

Page 19: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

coherence but that shorter intervals, such as 125 msec or 250 msec produce high inflation and high standard deviations.

Figure 7. Standard deviations of coherence (y-axis) and the integration window size in milliseconds (x-axis). Top left is sample rate = 512Hz, top right sample rate = 256 Hz, bottom left sample rate = 128 Hz and bottom left sample rate = 64 Hz. EEG phase is not the same as coherence and it can be computed instantaneously without averaging. However, instantaneous phase is quite variable and it is advisable to average the phase delay over the same interval of time as for coherence when using Z score biofeedback.

References Bendat, J. S. & Piersol, A. G. (1980). Engineering applications of correlation and spectral analysis. New York: John Wiley & Sons.

Page 20: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

Benignus, V.A. Estimation of the coherence spectrum and its confidence interval using the Fast Fourier Transform. IEEE Transactions on Audio and Electroacoustics, 1969a, 17: 145-150. Benignus, V.A. Estimation of the coherence spectrum of non-Gaussian time series populations. IEEE Transactions on Audio and Electroacoustics, 1969b, 17: 109-201. Dixon, W.J. Biomedical computer programs. Los Angeles: University of California Press, 1970. Dixon, W.J. Biomedical computer programs. X-series supplement. Los Angeles: University of California Press, 1970. Jenkins, G.M. and Watts, D.G. Spectral analysis and its applications. San Francisco, Holden-Day, 1969. Nunez, P. L. EEG coherency I: statistics, reference electrode, volume conduction, Laplacians, cortical imaging, and interpretation of multiple scales. EEG and Clin. Neurophysiol., 1997, 103: 499-515. Orr, W.C. and Naitoh, P. The coherence spectrum: An extension of correlation analysis with applications to chronobiology. Internat. J. of Chronobiology, 1976, 3: 171-192. Otnes, R. K. & Enochson, L. (1972). Digital time series analysis. New York: John Wiley and Sons. Thatcher, R.W., Biver, C.J. and North, D.N. EEG coherence and phase delays: Reference differences and phase delay reliability, in preparation, 2004. Tick, L.J. Estimation of coherence. B. Harris (Ed.), Inc: Spectral analysis of time series. New York: John Wiley & Sons, 133-152, 1967. Walter, D.O. Spectral analysis for electroencephalograms: mathematical determination of neurophysiological relations from records of limited duration. Experimental Neurology, 1963, 8: 155-181.

Page 21: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

Walter, D.O. A posteriori “Wiener filtering” of averaged evoked responses. D.O. Walter and M.A.B Brazier (Eds.). In: Advances in EEG analysis. Electroencephalography and Clinical Neurophysiol., 1969, Supplement No. 27, 61-70.

Appendix - A A.1 – Minimization of RMS Error Time series are sequences, discrete or continuous, of quantitative data of specific moments in time. They may be simple such as a single numerical observation at each moment of time and studied with respect to their distribution in time, or multiple in which case they consist of a number of separate quantities tabulated according to a common time base (e.g., a mixture of sine waves beginning at time = 0). The statistics of a time series is the science of predicting an immediate or long time future sequence based on a sample of past sequential quantitative data. In general, the longer the sample of past quantitative moments of time then the greater the accuracy of predicting future sequence(s). The fine details of accuracy of prediction of the future based upon past samples is generally governed by the relationship of 1 / sq rt. of N. To understand why this is the case let us define a statistic of a time series based on the “signal” or “message” that is transmitted and the “noise” or randomness that the signal is embedded in. This relationship was described by the Nobel laureate Normbet Wiener (N. Wiener, Time Series, MIT Press, Cambridge, Mass., 1949) in which a time series is a combination of a signal + noise or the signal f(t) and the message g(t) + noise, where noise is defined as f(t) – g(t). In other words noise is defined as the difference between the “message” and the measured quantitative values or f(t) – g(t). For example, noise = 0 when f(t) – g(t) = 0. Let us consider the output of an electrical circuit with input f(t). If the circuit has the response A (t) to a unit-step function, then the output is given by:

∫+∞

+−=0

)()0()()(')( tfAdtfAtF τττ

The goal is to have F(t) approximate as closely as possible the message g(f). That is, we want to minimize [F(t) – g(t)]. As a criterion

Page 22: Version 1.0 – June 29, 2004 Hand Calculator Calculations ... Calculator.pdf · Version 1.0 – June 29, 2004 Hand Calculator Calculations of EEG Coherence and Phase Delays Robert

The Ergotic goal of time series statistics is to minimize the difference between the measured values f(t) and the “signal” g(t). The time series can be divided into two general categories: 1- the statistics of short-time biological data and other short-time interval events such as economic, sociological, etc. and 2- long time span events such as astronomical, meterological, geologic and geophysical data . . . . . . . – to be continued [version 1.0 – June 29, 2004, version 1.1- 9/19/04 to be revised and extended in the future]