34 Repovs G: Dealing with Noise in EEG Recording and Data Analysis Research Review Paper ■ Dealing with Noise in EEG Recording and Data Analysis Spoprijemanje s šumom pri zajemanju in analizi EEG signala Grega Repovš Abstract. EEG recording is highly susceptible to various forms and sources of noise, which present significant difficulties and challenges in analysis and interpretation of EEG data. A number of strategies are available to deal with noise effectively both at the time of EEG recording as well as during preprocessing of recorded data. The aim of the paper is to give an overview of the most common sources of noise and review methods for prevention and removal of noise in EEG recording, including elimination of noise sources, signal averaging, data rejection and noise removal, along with their key advantages and challenges. Izvleček. EEG signal je zelo občutljiv na raznolike vire in oblike šuma, ki predstavlja pomemben izziv pri analizi in interpretaciji zajetega signala. Za uspešno spoprijemanje s šumom tako v času zajemanja EEG signala kot v okviru priprave podatkov na analizo je na voljo več strategij. Namen prispevka je predstaviti najpogostejše vire šuma ter podati pregled tehnik za njegovo preprečevanje in odstranjevanje, kot so odstranjevanje virov šuma, povprečevanje signala, zavračanje podatkov ter odštevanje šuma. Podane so tudi prednosti in izzivi pri uporabi teh tehnik. ■ Infor Med Slov: 2010; 15(1): 18-25 Author's institution: Department of Psychology, Faculty of Arts, University of Ljubljana, Slovenia. Contact person: Grega Repovš, Oddelek za psihologijo, Univerza v Ljubljani, Aškerčeva 2, SI-1000 Ljubljana. email: grega.repovs@psy.ff.uni-lj.si. Prejeto / Received: 16.08.2010 Sprejeto / Accepted: 26.08.2010 Informatica Medica Slovenica 2010; 15(1) 19 Introduction Electroencephalography (EEG) is one of the key tools for observing brain activity. While it can not match the precision and resolution of spatial localisation of brain activity of many other brain imaging methods, its main advantages are low costs, relative ease of use and excellent time resolution. For these reasons, EEG is widely used in many areas of clinical work and research. One of the biggest challenges in using EEG is the very small signal-to-noise ratio of the brain signals that we are trying to observe, coupled by the wide variety of noise sources. Four general strategies are employed to deal with the issue of noise in EEG recording and analysis, each with their own advantages, challenges and limitations: elimination of noise sources, averaging, rejection of noisy data, and noise removal. Elimination of noise sources The best way of dealing with noise is to not have any in the first place. Some sources of noise can be relatively easyly removed, others present more of a challenge and can introduce unwanted consequenes, while some sources of noise are in principle unavoidable. The easiest sources of noise to deal with are external, environmental sources of noise, such as AC power lines, lighting and a large array of electronic equipment (from computers, displays and TVs to wirelles routers, notebooks and mobile phones). The most basic steps in dealing with environmental noise are removing any unnecessary sources of electro-magnetic (EM) noise from the recording room and its immediate vicinity, and, where possible, replacing equipment using alternate current with equipment using direct current (such as direct current lighting). A more advanced and costly measure is to insulate the recording room from EM noise by use of a Faraday cage. While very effective in eliminating most of environmental EM noise, EM insulation requires either advance planning or costly rebuilding work. Another tractable source of noise in EEG recording is physiological noise that can be caused by various noise generators. Common examples of such noise are cardiac signal (electrocardiogram, ECG), movement artifacts caused by muscle contraction (electromyogram, EMG) and ocular signal caused by eyeball movement (electrooculogram, EOG). Of these, ECG signal is not preventable, but also has the lowest effect on the recorded EEG signal. Noise caused by EMG and EOG signals can often be avoided. EMG noise can be avoided or reduced by asking the participant to find a comfortable position and relax before the start of a recording session, and by avoiding tasks that require verbal responses or large movements. When such tasks can not be avoided, one should try to plan the experiment so that the periods of movement do not overlap with critical periods of data collection. EOG signals are generated by eye saccades or pursuit movements as well as blinks. Saccade and pursuit movement signals can be avoided by designing tasks that do not require eye movements but rather encourage participants to hold gaze in the same location throughout the critical periods of the task. Blinks are more difficult to avoid; one possibility is to ask participants not to blink during critical periods of the task and then provide cues for periods when they can blink freely. While such strategies can effectively reduce occurence of blinks and eye movements in critical task periods, they also have significant drawbacks one has to consider. As both blinking and spontaneous eye movement are automatic behaviors, withholding either of them requires voluntary attention that might interact with task performance as well as introduce EEG signal.1 Withholding them can be especially problematic when it is required for longer periods of time, and virtually impossible when recording resting EEG. When dealing with physiological sources of noise, skin potentials, which occur due to insulating properties of the outer layer of the skin and ionic potential of sweat glands, need to be considered as 20 Repovs G: Dealing with Noise in EEG Recording and Data Analysis well. The best way of reducing skin potentials while increasing signal-to-noise ratio of the recorded signal is by reducing or removing the insulating barier, most commonly by using an abrasive creme, scratching using an hypodermic needle or puncturing using a prick needle. Nevertheless, there are some sources of noise that are unavoidable. When recording EEG, we are most often interested in a very specific signal, such as the signal related to task-evoked cognitive processing or epileptiform discharges in an epileptic patient. These signals always appear on the background of other spontaneous, stimulus- or task-related neuronal activity of a living brain. Signal averaging Possibly the simplest way to deal with noise in the recorded data is signal averaging. The key assumption in signal averaging is that the noise in the signal is random, or at least occurs with a random phase in relation to the event of interest, whereas the signal of interest is stable. If we record EEG signal over a number of occasions, noise at each timepoint will increase the signal on some, reduce on others, but on average cancel itself out, leaving us with the stable EEG response to the event of interest. Signal averaging is a simple and powerful way of dealing with noise, but it has a number of limitations and caveats. Firstly, signal averaging can only be used when we are looking for a stable, event-locked signal that we can record over a large number of trials, as is the case in event related potential (ERP) studies. Signal averaging can not be used in cases when we are studying rare events that we can not time-lock to a known point in time, or when the signal of interest is itself variable. An example might be the study of epileptiform discharges in epilepsy. Secondly, only noise that is random and symetric can be eliminated using signal averaging. If (for any reason) noise is time-locked to the event of interest, it can not be averaged out but will rather be summed to the signal of interest. Such example can be the noise arising from presentation of the stimuli. Large changes in brightness on poorly insulated CRT screen could lead to event locked spikes in noise. Similarly, if the noise is not symmetric (introducing balanced increases as well as decreases in signal), its average across time will not be zero but it will rather lead to overall increases or decreases of averaged signal. This might not be an issue when the amount of noise is constant throughout the recording session or at least each recorded trial, as in that case the signal of interest will stay the same compared to baseline. It might, however, lead to significant artefacts when it occurs only on some parts of trial, where it can appear as systematic decrease or increase of signal and can thus be mistaken for ERP components. Lastly, relying on signal averaging as the main strategy for noise removal can be quite expensive in terms of the number of trials needed to sufficiently increase the signal-to-noise ratio. Specifically, as signal-to-noise ratio only increases as a square root of the number of samples (repetitions or trials in an ERP experiment), the number of trials required to counteract the noise increases with the power of two. In other words, two-fold increase in noise requires four times the number of repetitions to get the same signal-to-noise ratio. For these reasons, it is best to rely on signal averaging as a last resort for truly unavoidable noise sources only, and use other strategies to prevent noise before recording and remove it after recording. Rejection of noisy data Whenever noise in the recorded data is sparse and easily recognizable, the most obvious way of dealing with it is to eliminate the parts of the data where the noise is present. The most straightforward procedure for rejection of noisy data is by visual inspection. Most eye-movements, Informatica Medica Slovenica 2010; 15(1) 21 blinks and movement artefacts are relatively easily recognizable and can be marked for rejection before averaging and data analysis. Relying on visual inspection of the data is however not always feasible or effective. When dealing with large datasets, visual inspection might be prohibitively time consuming. In addition, some types of noise can be difficult to recognize and identify even for the most experienced EEG analist. For these reasons a number of strategies have been developed that help identify noise in the data based on its statistical properties. To identify bad channels, a number of EEG analysis tools offer options for visualizing frequency spectra and testing the distribution of the data. Channels with lots of noise are usually characterised with high power at high frequencies or spikes in the power spectrum at some characteristic frequencies (such as 50 or 60Hz frequency of power line noise). Noisy channels can also show significantly higher variability in the signal across time compared to other channels, as well as stronger deviation from Gaussian distribution. Other features of the data can be used to to identify and reject specific segments of the recording. EEGLAB analysis package2 provides a number of such options. Among rather straightforward methods are detecting extreme values caused by noise artefacts or abnormal trends due to linear drift. More advanced methods are based on computing the range of expected values or statistics across all the trials and then identifying trials that represent outliers. In one such method a probability of a value occuring at a specific timepoint within a trial is computed and values that are highly improbable are identified. Another method depends on computing kurtosis of distribution of values across a trial. The most effective method based on an empirical analysis3 might be detection of abnormal frequency spectra within the trial. While potentially highly effective in identifying noisy data segment, even these methods require careful selection and tuning of rejection criteria as well as additional visual inspection, to make sure both that "clean" data is not rejected as well as that as that all the identifiable noise artefacts are. Despite relative ease of rejection of noisy data there are a number of cases where such strategy is not feasible. In research the design of the experimental task might require the subject to speak or move their eyes. The length of the individual trials might be too long, or the frequency of blinking too high to eliminate all the trials containing blinks and/or eye movements. The analysis of the data itself might require long continuous segments of data. In clinical use detection of each individual occurence of a specific signal might be cruical, or the signal itself might be inseparably related to the source of noise, such as movements during an epileptic seisure. In all these cases rejection of noisy data is not an option, necessitating development of methods that enable removal of noise from the raw data. Removal of noise Filtering Possibly the easiest way to remove noise from the raw data is by filtering. To be able to filter it, the noise needs to fall within one of the three categories: the frequency of the noise needs to be either below the frequency of the phenomena we are trying to observe, above it, or it needs to fall within a very narrow well-specified range. High-pass filtering (filtering that passes only the signal varying above the selected cut-off frequency) is rutinely used already during acquisition itself. A number of factors such as sweating and drifts in electrode impendance can lead to slow changes in the measured voltage, which can in turn lead to saturation of the amplifyer and lost data during recording, as well as to significant distortions in the averaged event-related timecourse.4 For those reasons, it is often recommended to filter the frequencies below 0.01 Hz. 22 Repovs G: Dealing with Noise in EEG Recording and Data Analysis Low-pass filtering (filtering that passes only the signal varying below the selected cutoff frequency) is used to remove noise at the other end of the spectrum of frequencies that we are interested in. Contraction of muscles typically lead to strong signal with frequencies above 100 Hz, so supression of frequencies above 100 Hz would (to a large extent) remove movement artefacts in the acquired signal. Additionally, sampling of the data itself can lead to aliasing — a phenomena in which frequencies higher than the sampling frequency can appear as artifactual low frequencies in the sampled data. To eliminate aliasing, the data should be low-pass filtered at frequencies at least one third lower than the sampling rate.4 Unfortunately, lots of noise falls within the range of frequencies we are interested in and so can not be removed using filtering without also removing the signal of interest. However, there are signals that are of a very narrow and predictable frequency, such as the 50 (or in some cases 60) Hz frequency of the electricity lines. Such noise can be removed by a notch filter that supresses or eliminates signal in a very narrow frequency range. When filtering data, one needs to be aware that filtering — depending on the nature of the filter used — can also significantly affect the data in the non-filtered frequency ranges, thus affecting estimates of onsets and/or amplitude of observed ERP waves as well as introducing artifactual oscillations. Hence, it is advisable4 to limit filtering only to what is necessary and unavoidable. Subtraction using linear regression When dealing with predictable noise that can be recorded independently on a separate channel, it is possible to remove the noise from the data by estimating the amount of noise transtered to data using linear regression and then subtracting it. A typical example is the noise produced by blinks and eye movements. To remove such noise, linear regression is computed between each data channel and nuisance channels used to record horizontal (HEOG — difference between voltages recorded above and below eyes), vertical (VEOG — difference between voltages recorded at the left and right outer canthi of the eyes) and radial (REOG — difference between average voltage at the eyes and EEG reference) movement. The estimated fi coefficients are then used to subtract values from each nuisance channel multiplied with corresponding fi coefficient from the measured data channel.5 The process can be represented by the formula EEGc = EEGci-Y,PncEOGm where EEGci and EEG'ci represent the measured and estimated true EEG signal at channel c and timepoint i respectively, finc is the regression coefficient between data channel c and EOG nuisance channel n and EOGni is the value of EOG nuisance channel n at timepoint i. Subtraction using linear regression is a simple and powerful method that has long represented the golden standard in oculomotor artefact removal. However, it is hindered by some important drawbacks. Firstly, information recorded using HEOG, VEOG and REOG channels might not capture all the signal due to blinks and eye movement. Any signal not represented in the nuisance channels will remain as noise in the cleaned data. Secondly, due to their close proximity to the data channels, nuisance channels will invariably also capture some of the cerebellar signal of interest, which will then be subtracted from the data channels. And thirdly, most of the methods in use require a number of calibration trials at the start of the session to correctly compute the appropriate regression coefficients, which can be impractical in some situations. Subtraction using adaptive filtering As EOG signals are mostly of lower frequency than the cerebellar signal of interest, the problem of EOG signals contamination by signal of interest can be somewhat reduced by low-pass filtering the EOG channels before applying substraction using linear regression,6 thus aleviating some of the Informatica Medica Slovenica 2010; 15(1) 23 problem of removing cerebellar signal of interest along with EOG in subtraction using linear regression. Sume authors have gone even a step further.7 Based on the assumption that the true EOG signals are uncorrelated with the cerebellar signal of interest, they formulated an adaptive filter algorithm. The filter is used to process EOG signals before they are being subtracted from the data signals. The filter is computed on the initial set of samples and then adjusted with each new sample both to improve it as well as adjust it to possible changes in the transfer function between EOG and data channels. The authors have shown that the filter converges quickly and is stable while effectively removing EOG artefacts. Besides resolving the problem of cerebellar contamination of EOG signals, the adaptive nature of the filtering also eliminates the need for separate calibration session and can be used online during recording. It does however still depend on separate recording of EOG channels and their quality. Subtraction using data decomposition The only way to fully remove the nuisance signal while avoiding removal of signal of interest is to efficiently estimate and remove only the nuisance signal related to a specific source of noise. A number of methods for estimating specific sources of EEG signal developed and tested in the recent years fall under the umbrella of blind source separation (BSS).8 The key assumption of BBS is that the observed signal can be understood as a mixture of original source signals. The specific methods differ in the algorithms and information used to estimate the mixing matrix and the original source signals. Second order statistics (SOS) methods are based on the assumption that the original source signals are uncorrelated and aim to decompose the observed signal into a number of uncorrelated components. Probably the most widely known method is pricipal component analysis (PCA), which decomposes the time series into a number of orthogonal (uncorrelated) sources with decreasing significance, such that a small number of components contain most of the variance of the measured signal. PCA is most often used as a data reduction method. Recently, new SOS methods have been developed that make use of the temporal structure of the signal by relying on time-lagged covariance matrices. Two representatives of this approach are algorithm for multiple unknown signals extraction (AMUSE)9 and second-order blind identification (SOBI).10 When original signal sources are assumed to be independent, methods based on higher order statistics (HOS) can be used to decompose the measured signal. Again, a number of methods for independent component analysis (ICA) exist, making use of varius measures of statistical independence. Possibly most widely known and used is INFOMAX,11 which aims to minimize the mutual information between the components. Other examples of frequently used ICA methods are JADE12 and FASTICA.13 To provide reliable signal decomposition, ICA methods require a large number of samples, preferably at least a few times the square of the number of channels used.2 Applying any of the listed methods decomposes the measured signal into a number of original source signals and a mixing matrix that provides information on the degree to which each of the original source signals is represented in each of the data channels. To remove unwanted nuisance signal from the EEG recording, both time-course and topography of the original source signals can be used to identify the components of the data representing nuisance signal. Once nuisance components are identified, the remaining original source signals can be mixed back together to reconstruct a clean EEG signal. BSS methods provide a powerfull tool for not only identifying and removing noise and nuisance 24 Repovs G: Dealing with Noise in EEG Recording and Data Analysis signal, but also identifying and separating possible signals of interest. Besides choosing the most appropriate method, providing a sufficient amount of data and performing appropriate preprocessing steps, the most challenging part of using BBS methods for a novice user is identifying the right components to be removed or kept in the final dataset. If topography, time-course and/or frequency composition properties of the nuisance signal source are known, probable candidates can be identified by computing correlation between identified components and nuisance signal template or their best estimate. In the case of blinks, component topography can be correlated either with average blink EEG14 topography or a set of previously identified EOG components,15 or alternatively, component signal can be correlated with each of the EOG signals. The advancements in refinement and complexity of BSS methods in the recent years have been staggering and often difficult to follow. To relieve the experimenter of the burden of identifying nuisance components, as well as to ensure the objectivity and reliability of noise removal using BSS methods, a number of automated procedures and algorithms have been proposed and implemented in advanced commercial and freely available software packages. The burden and responsibility of making informed decisions on when and how to use them, though, still lies with the user. Conclusion Noise can present a significant challenge in analysis and interpretation of EEG data, necessitating efficient strategies for noise prevention and removal. A large amount of noise can be avoided by taking care of the appropriate recording environment and carefull planning of experiments and recording sessions. Additionally, a number of methods and algorithms can be employed to reject noisy data, remove noise signal and improve signal-to-noise ratio of the data. In order to effectively choose and use methods of dealing with noise, their advantages and challenges need to be considered in relation to the properties of the data and the analytical questions being asked. References 1. Verleger R: The instruction to refrain from blinking affects auditory P3 and N1 amplitudes. Electroencephalography and Clinical Neurophysiology 1991; 78: 240-251. 2. Delorme A, Makeig S: EEGLAB: an open source toolbox for analysis of single-trial EEG dynamics. Journal of Neuroscience Methods 2004; 134:9-21. 3. Delorme A, Sejnowski T, Makeig S: Improved rejection of artifacts from EEG data using highorder statistics and independent component analysis. Neuroimage 2007; 34(4): 1443-1449. 4. Luck S: An Introduction to the Event-Related Potential Technique. Cambridge, MA 2005: MIT Press. 5. Croft RJ, Barry RJ: Removal of ocular artifact from the EEG: a review. Neurophysiologie clinique 2000; 30(1): 5-19. 6. Gasser TH, Ziegler P, Gattaz WF. The deleterious effects of ocular artefacts on the quantitative EEG, and a remedy. Eur Arch Psychiatry Neurosci 1992; 241: 352-6. 7. He P, Wilson G, Russel C: Removal of ocular artifacts from electro-encephalogram by adaptive filtering. Medical & biological engineering & computing 2004; 42(3): 407-12. 8. Romero S, Mananas MA, Barbanoj MJ: A comparative study of automatic techniques for ocular artifact reduction in spontaneous EEG signals based on clinical target variables: a simulation case. Computers in biology and medicine 2008; 38(3): 348-60. 9. Tong L, Liu RW, Soon WC, Huang YF: Indeterminacy and identifiability of blind identification. IEEE Trans Circuits Syst 1991; 5: 499-509. 10. Belouchrani A, Abed-Meraim K, Cardoso JF, Moulines E: A blind source separation technique using second-order statistics. IEEE Trans Signal Process 1997; 45: 434-444. 11. Bell AJ, Sejnowski TJ: An information maximization approach to blind separation and blind deconvolution. Neural Comput 1996; 7: 1129-1159. Informatica Medica Slovenica 2010; 15(1) 25 12. Cardoso JF, Souloumiac A: Blind beamforming for non Gaussian signals. IEE Proc—F 1993; 140: 362370. 13. Hyvarinen A, Oja E: A fast fixed-point algorithm for independent component analysis. Neural Comput 1997; 9: 1483-1492. 14. Dien J: The ERP PCA Toolkit: an open source program for advanced statistical analysis of event- related potential data. Journal of neuroscience methods 2010: 187(1): 138-45. 15. Li Y, Ma Z, Lu W, Li Y: Automatic removal of the eye blink artifact from EEG using an ICA-based template matching approach. Physiological measurement 2006; 27(4): 425-36.