Professional Documents
Culture Documents
Alagapan JNeuralEng 2019
Alagapan JNeuralEng 2019
Alagapan JNeuralEng 2019
E-mail: hauwu@math.duke.edu
Abstract
Objective. Cortical oscillations, electrophysiological activity patterns, associated with
cognitive functions and impaired in many psychiatric disorders can be observed in intracranial
electroencephalography (iEEG). Direct cortical stimulation (DCS) may directly target these
oscillations and may serve as therapeutic approaches to restore functional impairments.
However, the presence of electrical stimulation artifacts in neurophysiological data limits the
analysis of the effects of stimulation. Currently available methods suffer in performance in
the presence of nonstationarity inherent in biological data. Approach. Our algorithm, shape
adaptive nonlocal artifact removal (SANAR) is based on unsupervised manifold learning. By
estimating the Euclidean median of k-nearest neighbors of each artifact in a nonlocal fashion,
we obtain a faithful representation of the artifact which is then subtracted. This approach
overcomes the challenges presented by nonstationarity. Main results. SANAR is effective in
removing stimulation artifacts in the time domain while preserving the spectral content of the
endogenous neurophysiological signal. We demonstrate the performance in a simulated dataset
as well as in human iEEG data. Using two quantitative measures, that capture how much of
information from endogenous activity is retained, we demonstrate that SANAR’s performance
exceeds that of one of the widely used approaches, independent component analysis, in
the time domain as well as the frequency domain. Significance. This approach allows for
the analysis of iEEG data, single channel or multiple channels, during DCS, a crucial step
10
Author to whom any correspondence should be addressed.
11
140 Science Drive, Physics building, Room 207 Durham, NC 27708,
United States of America.
in advancing our understanding of the effects of periodic stimulation and developing new
therapies.
2
J. Neural Eng. 16 (2019) 036010 S Alagapan et al
on ICA is it is currently the most widely adopted approach. In were swapped functionally. The sine wave frequency Fsignal
addition, we provide two measures that capture the efficacy of was set at 7 Hz and 5 Hz. Stimulation frequency Fstim was
SANAR in suppressing the artifacts and use them to quantify set at 5 Hz and 10 Hz and duration was set at 40 s. A total of
the performance difference between our approach and the 6 trials were collected (Fsignal 7 Hz, Fstim 10 Hz; Fsignal 7 Hz,
ICA-based approach. To the best of our knowledge, this kind Fstim 5 Hz; Fsignal 5 Hz, Fstim 10 Hz) resulting in 12 traces for
of performance measurement is seldom considered in the field testing the algorithm.
(but see Korhonen et al (2011)).
Computation setup
Materials and methods
All computations for the presented work including algorithm
Direct cortical stimulation and iEEG development, analysis and statistics were carried out using
Matlab (Mathworks Inc, Natick, MA, USA). A desktop comp
All experimental procedures were approved by the Institutional uter with quad core processor (Intel Core i7-4770k CPU) and
Review Board of University of North Carolina at Chapel 32 GB memory running Windows 7 Enterprise was used for
Hill (IRB Number 13-2710). iEEG was recorded from 114 all analysis.
electrodes implanted in a participant performing a working
memory task while being simultaneously stimulated. iEEG
Line noise removal using curve fitting
was recorded using a high-density EEG system (NetAmps
410, Electrical Geodesics Inc, Eugene, Oregon, United States). We adopted a curve fitting approach to remove line noise (60
Sampling rate was set at 1000 Hz. The amplifier has a software Hz) from the recording. This step preceded the stimulation
anti-aliasing filter with a cutoff frequency at 500 Hz in addi- artifact removal. This approach is advantageous compared
tion to the inbuilt hardware anti-aliasing filter with cutoff at to notch filtering since notch filtering may introduce dist
4000 Hz. Electrical stimulation was applied between pairs of ortion in artifact waveform (Mitra and Pesaran 1999, Luo and
adjacent recording electrodes and consisted of 5 s-long pulse Johnston 2010) and in the context of our algorithm, yielded
trains at with 110 ms between pulses (~9.1 Hz). Each biphasic better performance (figure S3 (stacks.iop.org/JNE/16/036010/
pulse was 2 mA in amplitude and 400 µs in duration. The mmedia)). We fit a sine wave with 60 Hz as frequency to the
pulse trains were generated by a cortical stimulator (Cerestim iEEG data from each electrode and each trial separately. A
M96, Blackrock Microsystems, Salt Lake City, Utah, United least square cost-function was used to estimate the amplitude
States). A total of 2 different electrode pairs were stimulated and phase offset of the sine wave. Then the fitted sine wave
and each electrode pair was stimulated 20 times. The loca- was subtracted from the raw data to remove the line noise.
tion of the recording electrodes and stimulation electrodes are
shown in figure 1(A).
The stimulation produces transient artifacts that vary in Shape adaptive nonlocal artifact removal
amplitude i.e. as the distance from the stimulating electrodes The proposed SANAR algorithm removes the artifact incurred
increases, the stimulation artifact amplitude decreases (figure from DCS by combining the manifold model and the nonlocal
1(B)). In most practical situations, it is impossible to recover Euclidean median algorithm (Chaudhury and Singer 2012).
any physiological data from the stimulation electrodes (not The basic idea is similar to the template subtraction (TS)
shown in figure 1(B)) and hence, we restrict our analyses to algorithm—find a template for the artifact and recover the
non-stimulation electrodes. Figure 1(C) provides examples EEG signal by subtracting the template from the recorded
of traces from electrodes that exhibit different artifact ampl iEEG signal. However, in the proposed artifact removal algo-
itudes relative to endogenous activity amplitude. rithm, we account for the structure hidden inside the artifact
pattern—different artifact waveforms are not linearly related
Simulated EEG signal and stimulation
and thus cannot be represented by a unique template with lin-
early transformation. Based on this structure, we design an
We used a ‘phantom’ setup to simulate iEEG and DCS where exclusive template for each artifact by designing a metric (see
the ‘endogenous’ signal is already known (figure 3(A)). We figure 2 for an illustration).
used a saline solution (0.15 M KCL) to simulate the conduc- Suppose the stimulation happens at times t1 < t2 < . . . < tn ,
tivity of the gray matter and placed an antenna connected to and we assume that ti − ti−1 is sufficiently large so that two
a function generator (SKMI, Taiwan) in the saline solution consecutive stimulation are separated far apart. The periodic
to act as a virtual dipole. A sine wave was generated by the stimulation experiment carried out in this study fulfills this
function generator and this served as the ground truth signal. criterion. In our setup, while we know when each pulse train
We immersed a strip consisting of 4 electrodes that is used (a set of 10 or 20 pulses) starts and how long it is but we
for ECoG in the saline. The electrodes were connected to do not know the exact timing of each pulse. We can guess
the stimulator and amplifier setup used in our experiments. based on the start time and duration, but it is not perfect, and
Stimulation was applied through one pair of electrodes while we need the help of a peak detection algorithm. Inspired by
the other two electrodes served as recording electrodes after the TS idea, we divide the recorded iEEG signal, X(t), sam-
which the stimulation electrodes and recording electrodes pled at 1000 Hz, into non-overlapping segments, so that each
3
J. Neural Eng. 16 (2019) 036010 S Alagapan et al
Figure 1. (A) Schematic of the location of electrodes on participant’s brain. The orange electrodes denote stimulation electrodes while
the blue electrodes denote recording electrodes. (B) Multichannel waveform of iEEG showing the differences in amplitudes of stimulation
artifacts (red arrows). (C) Example traces of artifacts exhibiting different amplitudes relative to endogenous activity.
segment contains one artifact. Note that over each segment, 1. Preprocessing the iEEG signal by removing the trend.
Ii ⊂ R , the iEEG is composed of at least three components— The trend is estimated by the median filter with a window
the unwanted artifact Ai, the wanted iEEG signal Ei, and the of length 200 ms, followed by a window smoothing of
inevitable noise Ni . In other words, if Xi is the restriction length 10 ms. To better align the stimulation artifacts
of X(t) on Ii , then Xi = Ai + Ei + Ni. Note that we do not when the artifact pattern is spiky, the signal is upsampled
assume what the artifact looks like; it can be of different pat- to 8000 Hz (Laguna and Sornmo 2000). To implement
tern, as long as we can isolate each artifact. The basic idea of the upsampling by the ratio of p/q, where p and q are
the proposed algorithm is composed of two steps. First, for coprime integer numbers and p > q, the input data is first
each Xi, find Xj so that Aj is the same or similar to Ai. This upsampled by a factor of the integer p by inserting zeros.
step is based on designing a metric that is not sensitive to the Then a least-squares linear-phase FIR filter designed with
existence of Ei + Ni . Note that the existence of Ei + Ni is the a Kaiser window, where the parameter for the window
main difficulty of designing this metric. In this work, we apply shape is set to 5, is applied to the upsampled data. Finally,
the modern machine learning techniques, including optimal the result is downsampled by a factor of the integer q by
shrinkage (Gavish and Donoho 2017) and diffusion distance throwing away samples.
(Coifman and Lafon 2006, El Karoui and Wu 2016, Singer Divide the recorded iEEG signal into segments Xi
2.
and Wu 2017) to remove Ei + Ni from Xj so that we can faith- according to the stimulation pattern, where i = 1, . . . , n ,
fully determine Aj that is the same or similar to Ai. Second, and n is the number of all artifact cycles. Specifically, the
we find Xij , j = 1, . . . , K , so that Aij is the same or similar to following two sub-steps are carried out. First, if the
Ai, then recover Ai from Xi by evaluating the median of Xij , timestamps of stimulation artifacts are unknown to us,
j = 1, . . . , K , at each sampling point. The step-by-step algo- detect the peaks of the stimulation artifacts using a peak
rithm is detailed below. detection algorithm in the electrode that has the strongest
4
J. Neural Eng. 16 (2019) 036010 S Alagapan et al
5
J. Neural Eng. 16 (2019) 036010 S Alagapan et al
Å ã
up, under these two conditions, the proposed algorithm may
respectively); that is, wij = exp − Hi −Hij , where
K work.
= median Hi − Hij j=1.
6. Remove the artifact Ai from the recorded iEEG signal Stimulation artifact removal using independent component
and obtain the desired artifact-free iEEG signal. To avoid analysis
the boundary effect, the estimated artifact Ai is tapered
To remove artifacts using the ICA-based method, we employed
by multiplying Ai by a window function h ∈ R p before
πi a trial-by-trial manual rejection approach (figure 3). We used
subtraction, Äwhere h (i)
ä = sin2 10 when i = 1, . . . , 5 , the infomax algorithm implemented in EEGlab toolbox for
h (i) = sin2 π( p−i+1)
10
when i = 1, . . . , 5 , and h (i) = 1 removal of artifacts caused by eye blinks, eye movement
otherwise. and muscle activity (Jung et al 2000, Delorme and Makeig
In this study, we choose k to be 30. Note that we do not 2004) to decompose the iEEG data into independent comp
intend to remove the noise. L is chosen here to be long enough onents. The components that captured the stimulation artifacts
to cover the possible spiky stimulation artifact. A discus- were rejected by visual inspection of component waveform
sion of the choice of k can be found in the supplementary and spectra (figures 3(B) and (C)). The rest of the comp
information. onents were used to reconstruct the iEEG data free of arti-
The time complexity of the SANAR algorithm mainly facts. Typically, each trial consisted of two components that
depends on the SVD for the singular value optimal shrinkage, captured the artifact without containing significant iEEG data
the nearest neighbor search algorithm for the diffusion dis- ascertained using visual inspection of spectra. In the example
tance and nonlocal Euclidean median, and the eigen-decom- shown in figures 2(B) and (C), the components indicated with
position for the diffusion distance. For SVD, since the matrix dashed red box were rejected.
is full, the time complexity is in general O(p2 n) when p n.
For the eigen-decomposition, the complexity is theoretically Measures of performance
O(nω+η ), where O(nω ) is the complexity of the chosen matrix For the real data, since we do not know the true EEG signal,
multiplication algorithm, and an arbitrary η > 0 (Demmel we consider the following artifact residue (AR) index, which
et al 2007). In general, for the matrix multiplication algo- was considered in Malik et al (2017) for other purposes. For
rithm, ω ≈ 2.376 when the matrix is dense (Coppersmith and the ith artifact cycle, define the ARi as
Winograd 1990). For the sparse matrix, ω can be improved to Ç ñ ô
1 med Ẽi − med Ẽi med |Ei − med (Ei )|
2 + η for an arbitrary η > 0 , when the number of neighbors
ARi := log +
m chosen in the affinity matrix satisfies m n0.14 (Yuster and 2 med |Ei − med (Ei )| med Ẽi − med E i
ñ ôå
Zwick 2004). In practice, m usually satisfies n0.14 m n0.68 , 1 Q95 Ẽi − med Ẽi max |Ei − med (Ei )|
so ω is between 2 + η and 2.376 . Here we give a conservative × + ,
2 max |Ei − med (Ei )| Q95 Ẽi − med Ẽi
bound O(n2.38 ). For the nearest neighbor search algorithm, we
count on the k-d tree based algorithm (Friedman et al 1976), where Ẽi is the estimated iEEG signal recovered over the
and the time complexity on average is O((n + K) log(n)). We ith simulation artifact, Ei is the concatenation of true iEEG
mention that when the dimension p is high, we can consider signal over the interval without any stimulation artifact from
randomized nearest neighbor search algorithm, like (Jones i − 30, . . . , i + 30 stimulation artifacts, med means median,
et al 2013). The other steps are at most O(n). As a result, Q95 means the 95% quartile, and max means the maximal
the time complex of the proposed SANAR algorithm takes value. Note that the first term measures how the EEG signal is
O(p2 n + n2.38 + (n + K) log(n)). overall recovered by the algorithm, which is introduced to pre-
In general, the proposed algorithm might not work if we vent over-smoothing. The second term measures the presence
do not impose any condition. First, although the stimula- of artifact residue. Overall, this index captures simultaneously
tions are well controlled from time to time, the artifact pat- how well the artifact is removed and how well the iEEG signal
terns could vary. However, like other algorithms that aim at is recovered. The AR index of a good reconstruction algorithm
removing such artifacts, we presume stimulation to not cause should be close to 0.
long-lasting changes in brain dynamics (Step 2). Therefore, Inspired by the spectral concentration (SC) index pro-
we could assume that the artifacts {Ai }ni=1 could be well posed in Castells et al (2005, equation (16)), we measure
parameterized by few parameters; like the height and the the performance in the frequency domain in the following
width. In a more mathematical terminology, we assume that way. The power spectral density is calculated using Welch’s
{Ai }ni=1 is identically and independently sampled from a low method, featuring 5000 discrete Fourier transform points,
dimensional manifold. This assumption allows us to apply the Hamming windows of 5000 samples, and 50% overlap-
diffusion distance to faithfully compare the artifacts in Step 4. ping. The 5000 point Fourier transform is chosen to reflect
Second, we assume that Ei + Ni and Ej + Nj are independent a 5 second window for a frequency resolution of 0.2 Hz.
when i is different from j, and that Ai and Ei + Ni are jointly The SC index for the iEEG signal sampled at 1000 Hz is
independent. This assumption allows us to apply the optimal defined as the ratio of the power change (relative to raw
shrinkage in Step 3 and Euclidean median in Step 5. To sum signal) over the fundamental frequency and the harmonics
6
J. Neural Eng. 16 (2019) 036010 S Alagapan et al
Figure 3. Stimulation Artifact Suppression using ICA. (A) Performance of ICA showing effective removal of stimulation artifacts (only
20 of 114 channels shown). (B) Waveform of the independent components obtained by decomposing the data. Red dashed box indicates
the components exhibiting stimulation artifact waveform. (C) Spectra of independent components. Red dashed box indicates components
exhibiting power in stimulation frequency and harmonics of stimulation frequency.
of the stimulation frequency to the energy over the rest of 2008). The SC index of a good reconstruction algorithm
the frequencies in the band (1–200 Hz). The band 1–200 Hz should be small.
is chosen to be sufficiently wide to cover the iEEG spec-
trum of interest. The canonical frequency band of interest
in studies of oscillations extend from 1 to 50 Hz and com- Results
prises delta (1–4 Hz), theta (4–8 Hz), alpha (8–13 Hz), beta
Removal of artifacts from phantom data
(13–30 Hz) and gamma (30–50 Hz) (Fröhlich 2016). In
addition, owing to the direct access to cortical surface in To test the performance of the algorithm in a controlled case
ECoG, activity in the frequency band 70–200 Hz also con- where the ground truth is available, we developed a ‘phantom’
tains information of brain activation. Activity in this band as shown in figure 4(A). In the example shown in figure 3(B),
is shown to be correlated with spiking activity (Ray et al stimulation was applied at 10 Hz and the ‘endogenous’ signal
7
J. Neural Eng. 16 (2019) 036010 S Alagapan et al
Figure 4. Demonstration of SANAR in simulated data. (A) Phantom setup used to simulate stimulation artifacts in the presence of periodic
signal. (B) Example traces showing simulated data recorded from ECoG electrodes without artifact, with artifact and after artifact is
removed.
Figure 5. Comparison of ICA and SANAR over real signal after removing 60 Hz artifact by the sine-wave fitting. (A) Example traces
showing the performance of ICA and SANAR in time domain. ICA (Blue trace) tends to produce a smoother interpolation of the data
segment in which artifact is present compared to SANAR (Red trace). (B) Spectra corresponding to the channels from which example
traces are shown. SANAR is more effective in removing not only the spectral content at stimulation frequency but also the harmonics of the
stimulation frequency compared to ICA. (C) Spectra zoomed in to the low frequency region showing that both ICA and SANAR faithfully
preserve the spectral content of the endogenous iEEG activity.
8
J. Neural Eng. 16 (2019) 036010 S Alagapan et al
9
J. Neural Eng. 16 (2019) 036010 S Alagapan et al
available as in the case of high density EEG or iEEG, PCA or domain, the sidebands were significantly reduced using this
ICA based methods have been used (Lu et al 2012, ter Braack approach.
et al 2013, Rogasch et al 2014). The methods involve decom- While we have demonstrated the algorithm in iEEG data
position of the data contaminated with stimulation artifacts with periodic electrical pulse stimulation, the proposed algo-
into distinct components that contain artifacts and neurophys- rithm has the potential to handle more general artifacts. For
iological data. By rejecting components that contain artifacts example, TMS-induced electrical artifacts that arise due to
and reconstruction of remaining components, artifact free the interaction between the electric field and the recording
data is obtained. These approaches work well when the data equipment (Veniero et al 2009, Rogasch et al 2017) in scalp
is stationary; particularly when the EEG recording is short. EEG exhibit similar impulse-like characteristics and can be
However, when the physiological signal is long as is typical in removed with the proposed algorithm albeit with additional
many situations, PCA and ICA may not yield robust decompo- modifications that are beyond the scope of the current study.
sition of signal into artifacts. For SANAR, the nonstationarity More specifically, TMS also induces a number of additional
is fully respected by the ‘nonlocal’ step. Thus, it can perform artifacts like muscle artifacts and sensory evoked artifacts
well even if the signal is long. Also, for the ICA approach, the (Veniero et al 2009, Korhonen et al 2011, Hernandez-Pavon
number of channels needs to be large enough. However, in the et al 2012, Rogasch et al 2017), and the algorithm proposed
proposed algorithm, it can be applied to the single channel here might need to be modified to accommodate these addi-
signal as seen in the case of the simulated signal. While we tional artifacts, as the artifact waveform may not be stereo-
have demonstrated the advantages of SANAR compared to typed. Additionally, in tACS, the stimulation waveform is
ICA in this case report, a more systematic comparison with sinusoidal, and hence the artifact is sine-wave like. Note that
other possible algorithms, like ensemble Kalman filters and while the same model and algorithm could potentially be
adaptive, is needed to ascertain the advantages of SANAR. applied to remove this kind of artifact, the AR index may not
Our choice of comparison against ICA was based on the fact be applied since there are no stimulation artifact-free periods.
that it still widely used in brain stimulation studies (Hamidi We will explore this direction in the future work.
et al 2010, Korhonen et al 2011, Lu et al 2012, Albouy et al
2017).
While the ICA-based method successfully suppressed Limitations
artifact in the fundamental frequency of the stimulation fre-
quency, the artifact content at higher harmonics were not sup- While the algorithm provides encouraging results and shows
pressed sufficiently. This is reflected in the higher SC values its potential, there are several limitations. One of the main lim-
that are observed compared to SANAR. The likely explana- itations of the currently proposed method is the computation
tion is the fact that we removed only those components that time. In our setup, a desktop with 4-core processor and 32 GB
did not contain significant spectral content outside the funda- memory running Matlab, we found that SANAR took 54 min
mental frequencies and harmonics of stimulation frequency. for running the iEEG data containing 110 312 artifacts. As
We regularly found components that had high spectral content the number of artifacts that must be suppressed increase, the
in the higher harmonics of the stimulation frequency while computational time required to identify neighbors based on
also containing spectral content in other frequencies. To pre- the manifold also increases. Since the designed metric is not
serve the spectral content of the iEEG signals, we did not Euclidean, we cannot count on the existing nearest neighbor
remove these components. In contrast, SANAR was effective search algorithms to find nearest neighbors efficiently. We
in suppressing the artifact at higher harmonics as the method thus need to develop a nearest neighbor search algorithm for
allows more robust reconstruction of the artifact waveform the des metric. We could also use available surrogate infor-
due to the fact that reconstruction depends on the manifold mation to narrow down the possible neighbor candidates; for
in which the artifacts exist. Hence, SANAR is effective in example, if heights of two artifacts are very different, we do
removing artifact content in higher frequencies. This property not expect them to be neighbors, and we can focus on finding
is of specific importance in analysis of iEEG data as the spec- neighbors from those beats with similar heights. A more sys-
tral content in higher frequencies reflect spiking activity of the tematic approach to treat the computational issue is needed
region (Ray et al 2008) and effective suppression of artifact to handle the high-throughput data in the near future. The
in these frequency bands are necessary to avoid confounding processing time of the infomax algorithm used in the study
effect of stimulation. to decompose one trial (3500 samples) of 114 channels into
One significant challenge we faced during the develop- independent components was approximately 15 s on average.
ment of SANAR is the interaction between line noise and Thus, for the dataset used in the study with 33 trials, the com-
stimulation artifacts. Since the stimulation artifact was putation time was approximately 8 min. However, each ICA
impulse-like, the spectrum at line noise frequency (60 Hz) computation was interleaved with manual rejection of comp
was confounded with the spectral content of the artifact. onents by visual inspection of component waveform and
Moreover, an amplitude modulation effect was observed with component spectra which was variable between the trials.
sidebands around 60 Hz (±stimulation frequency). The sine Therefore, the entire process of rejection took approximately
wave fitting approach described in the methods was more 30 min.
effective than a notch filter and resulted in the least distortion Another limitation of SANAR is the knowledge of stimu-
in the time domain waveform. In addition, in the frequency lation times. This is not a big issue if we could determine
10
J. Neural Eng. 16 (2019) 036010 S Alagapan et al
those artifacts relatively easily throughout the dataset, for low-frequency direct cortical stimulation is state-dependent
example, when there is a clear landmark, like in the exam- PLoS Biol. 14 e1002424
Al-ani T, Cazettes F, Palfi S and Lefaucheur J P 2011 Automatic
ples in this paper. If the artifact has morphology without a
removal of high-amplitude stimulus artefact from neuronal
clear landmark, or when there are multiple stimulations with signal recorded in the subthalamic nucleus J. Neurosci.
different morphologies, SANAR cannot be applied directly. Methods 198 135–46
We need to combine other techniques with SANAR to handle Albouy P, Weiss A, Baillet S and Zatorre R J 2017 Selective
the signal. For example, when there is a regular pattern of entrainment of theta oscillations in the dorsal stream causally
enhances auditory working memory performance Neuron 94
the appearance of artifacts, the recently developed de-shape
193–206
short time Fourier transform could help to determine the time Allen D P, Stegemoller E L, Zadikoff C, Rosenow J M and
stamps of artifacts, despite the artifact morphology. This kind Mackinnon C D 2010 Suppression of deep brain stimulation
of approach has been developed for the maternal abdominal artifacts from the electroencephalogram by frequency-domain
electrocardiogram signal to extract the fetal electrocardio- Hampel filtering Clin. Neurophysiol. 121 1227–32
Borchers S, Himmelbach M, Logothetis N and Karnath H O
gram signal. Although we expect a similar approach to handle
2012 Direct electrical stimulation of human cortex—the
this limitation, a systematic exploration is needed to confirm gold standard for mapping brain functions? Nature reviews
the performance. Neuroscience 13 63–70
From the algorithmic viewpoint, there are few parts that Castells F, Rieta J J, Millet J and Zarzoso V 2005 Associate.
could be improved, pending the theoretical development. Spatiotemporal blind source separation approach to atrial
For example, what is the optimal number of nearest neigh- activity estimation in atrial tachyarrhythmias IEEE Trans. Bio-
med. Eng. 52 258–67
bors for the algorithm? What is the best shrinkage policy
Chaudhury K N and Singer A 2012 Non-local euclidean medians
when we remove the EEG signal for the metric design? IEEE Signal Process. Lett. 19 745–8
What is the optimal metric when we determine the neigh- Coifman R R and Lafon S 2006 Diffusion maps Appl. Comput.
bors? While the chosen parameters and designed metric Harmon. A 21 5–30
work efficiently, we expect to improve the performance Coppersmith D and Winograd S 1990 Matrix multiplication via
by taking statistical development into account. The above- arithmetic progressions J. Symb. Comput. 9 251–80
Delorme A and Makeig S 2004 EEGLAB: an open source
mentioned algorithmic and theoretical challenges will be
toolbox for analysis of single-trial EEG dynamics including
explored in future work. independent component analysis J. Neurosci. Methods
134 9–21
Funding Demmel J, Dumitriu I and Holtz O 2007 Fast linear algebra is stable
Numer. Math. 108 59–91
Research reported in this publication was supported in part Duffau H et al 1999 Intra-operative direct electrical stimulations of
the central nervous system: the Salpetriere experience with 60
by the National Institute of Mental Health of the National
patients Acta Neurochir. 141 1157–67
Institutes of Health under Award Numbers R01MH101547, El Karoui N and Wu H T 2016 Graph connection laplacian methods
R21MH105557 and R01MH111889, National Institute of can be made robust to noise Ann. Stat. 44 346–72
Neurological Disorders and Stroke of the National Institutes Ezzyat Y et al 2017 Direct brain stimulation modulates encoding
of Health under award number R21NS094988-01A1. The states and memory performance in humans Curr. Biol.
27 1251–8
content is solely the responsibility of the authors and does not
Ezzyat Y et al 2018 Closed-loop stimulation of temporal cortex
necessarily represent the official views of the National Insti- rescues functional networks and improves memory Nat.
tutes of Health. Commun. 9 365
Friedman J H, Bentley J L and Finkel R A 1976 An algorithm for
finding best matches in logarithmic time ACM Trans. Math.
Conflict of interest Softw. 3 209–26
Frohlich F 2014 Endogenous and exogenous electric fields as
SA, HWS and HTW have no conflicts. FF is the lead inventor modifiers of brain activity: rational design of noninvasive brain
of IP filed on the topics of brain stimulation by UNC. FF is stimulation with transcranial alternating current stimulation
Dialogues Clin. Neurosci. 16 93–102 (https://www.dialogues-
the founder, CSO and majority owner of Pulvinar Neuro LLC. cns.org/contents-16-1/dialoguesclinneurosci-16-93/)
The work described here is unrelated. Fröhlich F 2016 Network Neuroscience (Amsterdam,
Boston, MA: Academic) (https://doi.org/10.1016/
B978-0-12-801560-5.02004-8)
ORCID iDs Gavish M and Donoho D L 2017 Optimal shrinkage of singular
values IEEE Trans. Inf. Theory 63 2137–52
Sankaraleengam Alagapan https://orcid.org/0000-0002- Hamidi M, Slagter H A, Tononi G and Postle B R 2010 Brain
2056-5450 responses evoked by high-frequency repetitive transcranial
Flavio Fröhlich https://orcid.org/0000-0002-3724-5621 magnetic stimulation: an event-related potential study Brain
Stimul. 3 2–14
Hau-tieng Wu https://orcid.org/0000-0002-0253-3156 Hashimoto T, Elder C M and Vitek J L 2002 A template subtraction
method for stimulus artifact removal in high-frequency deep
References brain stimulation J. Neurosci. Methods 113 181–6
Helfrich R F, Schneider T R, Rach S, Trautmann-Lengsfeld S A,
Engel A K and Herrmann C S 2014 Entrainment of brain
Alagapan S, Schmidt S L, Lefebvre J, Hadar E, Shin H W oscillations by transcranial alternating current stimulation Curr.
and Frhlich F 2016 Modulation of cortical oscillations by Biol. 24 333–9
11
J. Neural Eng. 16 (2019) 036010 S Alagapan et al
Hernandez-Pavon J C, Metsomaa J, Mutanen T, Stenroos M, Noury N, Hipp J F and Siegel M 2016 Physiological processes
Maki H, Ilmoniemi R J and Sarvas J 2012 Uncovering neural non-linearly affect electrophysiological recordings during
independent components from highly artifactual TMS-evoked transcranial electric stimulation NeuroImage 140 99–109
EEG data J. Neurosci. Methods 209 144–57 Qian X, Chen Y, Feng Y, Ma B, Hao H and Li L 2017 A method
Jones P W, Osipov A and Rokhlin V 2013 A randomized for removal of deep brain stimulation artifact from local
approximate nearest neighbors algorithm Appl. Comput. field potentials IEEE Trans. Neural Syst. Rehabil. Eng.
Harmon. A 34 415–44 25 2217–26
Jung T P, Makeig S, Humphries C, Lee T W, McKeown M J, Ray S, Crone N E, Niebur E, Franaszczuk P J and Hsiao S S
Iragui V and Sejnowski T J 2000 Removing 2008 Neural correlates of high-gamma oscillations
electroencephalographic artifacts by blind source separation (60–200 Hz) in macaque local field potentials and their
Psychophysiology 37 163–78 potential implications in electrocorticography J. Neurosci.
Kocabicak E, Temel Y, Hollig A, Falkenburger B and Tan S K H 28 11526–36
2015 Current perspectives on deep brain stimulation for severe Rogasch N C, Sullivan C, Thomson R H, Rose N S, Bailey N W,
neurological and psychiatric disorders Neuropsych. Dis. Treat. Fitzgerald P B, Farzan F and Hernandez-Pavon J C 2017
11 1051–66 Analysing concurrent transcranial magnetic stimulation
Korhonen R J, Hernandez-Pavon J C, Metsomaa J, Maki H, and electroencephalographic data: a review and introduction
Ilmoniemi R J and Sarvas J 2011 Removal of large muscle to the open-source TESA software NeuroImage
artifacts from transcranial magnetic stimulation-evoked EEG 147 934–51
by independent component analysis Med. Biol. Eng. Comput. Rogasch N C, Thomson R H, Farzan F, Fitzgibbon B M,
49 397–407 Bailey N W, Hernandez-Pavon J C, Daskalakis Z J and
Kucewicz M T et al 2018 Evidence for verbal memory Fitzgerald P B 2014 Removing artefacts from TMS-EEG
enhancement with electrical brain stimulation in the lateral recordings using independent component analysis: importance
temporal cortex Brain 141 971–8 for assessing prefrontal and motor cortex network properties
Laguna P and Sornmo L 2000 Sampling rate and the estimation NeuroImage 101 425–39
of ensemble variability for repetitive signals Med. Biol. Eng. Santillan-Guzman A, Heute U, Muthuraman M, Stephani U and
Comput. 38 540–6 Galka A 2013 DBS artifact suppression using a time-frequency
Lu Y L, Cao P J, Sun J J, Wang J, Li L M, Ren Q S, Chen Y and domain filter 2013 35th Annual Int. Conf. IEEE Engineering in
Chai X Y 2012 Using independent component analysis to Medicine and Biology Society (EMBC) pp 4815–8
remove artifacts in visual cortex responses elicited by electrical Singer A and Wu H T 2017 Spectral convergence of the
stimulation of the optic nerve J. Neural Eng. 9 connection Laplacian from random samples Inf. Inference
Luber B and Lisanby S H 2014 Enhancement of human cognitive 6 58–123
performance using transcranial magnetic stimulation (TMS) Sun Y, Farzan F, Garcia Dominguez L, Barr M S, Giacobbe P,
NeuroImage 85 961–70 Lozano A M, Wong W and Daskalakis Z J 2014 A novel
Luo S and Johnston P 2010 A review of electrocardiogram filtering method for removal of deep brain stimulation artifact from
J. Electrocardiol. 43 486–96 electroencephalography J. Neurosci. Methods 237 33–40
Malik J, Reed N, Wang C L and Wu H T 2017 Single-lead ter Braack E M, de Jonge B and van Putten M J A M 2013
f-wave extraction using diffusion geometry Physiol. Meas. Reduction of TMS induced artifacts in EEG using principal
38 1310–34 component analysis IEEE Trans. Neural Syst. Rehabil. Eng.
Matsumoto R, Nair D R, LaPresto E, Najm I, Bingaman W, 21 376–82
Shibasaki H and Luders H O 2004 Functional connectivity in Trebaul L, Rudrauf D, Job A S, Maliia M D, Popa I, Barborica A,
the human language system: a cortico-cortical evoked potential Minotti L, Mindruta I, Kahane P and David O 2016
study Brain 127 2316–30 Stimulation artifact correction method for estimation of
Mitra P P and Pesaran B 1999 Analysis of dynamic brain imaging early cortico-cortical evoked potentials J. Neurosci. Methods
data Biophys. J. 76 691–708 264 94–102
Morbidi F, Garulli A, Prattichizzo D, Rizzo C and Rossi S 2008 Veniero D, Bortoletto M and Miniussi C 2009 TMS-EEG
Application of Kalman filter to remove TMS-induced artifacts co-registration: on TMS-induced artifact Clin. Neurophysiol.
from EEG recordings IEEE Trans. Control Syst. Technol. 16 120 1392–9
1360-6 Wichmann T 2000 A digital averaging method for removal of
Morbidi F, Garulli A, Prattichizzo D, Rizzo C, Manganotti P and stimulus artifacts in neurophysiologic experiments J. Neurosci.
Rossi S 2007 Off-line removal of TMS-induced artifacts on Methods 98 57–62
human electroencephalography by Kalman filter J. Neurosci. Yuster R and Zwick U 2004 Fast sparse matrix multiplication Lect.
Methods 162 293–302 Notes Comput. Sci. 3221 604–15
12