The theory behind the linear filtering of TEPs as well as the modelling of TMS–EEG data has been extensively covered in Hernandez-Pavon et al. (
2022). Here, we briefly outline the fundamental mathematical formulations required for beamforming-based data cleaning.
We assume that the recorded
\(M_{\mathrm {}}\times T\) data matrix
\(\textbf{X}\), from an
\(M_\mathrm {}\)-channel EEG recording containing
T samples, are due to
N hidden components, of which
\(N_\textrm{brain}\) are of neuronal and
\(N_\textrm{art}\) of artifactual origin. The data are generated by the summation of the neural signals
\(\textbf{X}_\textrm{brain}\) and artifactual data
\(\textbf{X}_\textrm{art}\), which arise according to the linear model:
$$\begin{aligned} \textbf{X}=\textbf{X}_\textrm{brain}+\textbf{X}_\textrm{art}=\textbf{A}_\textrm{brain}\textbf{S}_\textrm{brain}+\textbf{A}_\textrm{art}\textbf{S}_\textrm{art}=\begin{bmatrix} \textbf{A}_\textrm{brain},\; \textbf{A}_\textrm{art} \end{bmatrix}\begin{bmatrix} \textbf{S}_\textrm{brain} \\ \textbf{S}_\textrm{art} \end{bmatrix}=\textbf{AS}, \end{aligned}$$
(1)
where
\(\textbf{A}_\textrm{brain}\),
\(\textbf{A}_\textrm{art}\), and
\(\textbf{S}_\textrm{brain}\),
\(\textbf{S}_\textrm{brain}\) are the mixing matrices and the time-course matrices for neuronal, and artifactual components generating the data, respectively. Concatenating the neuronal and artifactual mixing matrices horizontally and the time-courses vertically yields the total
\(M_\mathrm {}\times {N}\) mixing and the
\({N} \times T\) time-course matrices
\(\textbf{A}\), and
\(\textbf{S}\), respectively. The columns of the mixing matrix are the topographies and the rows of the time-course matrices are the waveforms of the components, denoted by
\(\textbf{s}_i^\mathrm T\) for component
i. Often times, a noise data matrix
\(\textbf{N}\) with the same dimensions as the data is added as a separate term in Eq. (
1), i.e.,
\(\textbf{X}=\textbf{AS}+\textbf{X}_\textrm{noise}\). Here, we consider noise to be generated by underlying noise components
\(\textbf{X}_\textrm{noise}=\textbf{A}_\textrm{noise}\textbf{S}_\textrm{noise}\). Throughout this paper, we assume that the temporal activity of the neural, artifactual, and noise components are mutually uncorrelated and that their topographies are not affected by the activity of the other components. Additional assumptions may be set, and defined separately in conjunction with each specific type of data cleaning application.
We now consider a spatial filter
\(\textbf{w}_i\) that uncovers the time-course of source
i as
\(\textbf{s}_i^\mathrm T= \textbf{w}_i^\mathrm T \textbf{X}\). To extract the time-courses of all the artifact components, we would need a spatial filter matrix
\(\textbf{W}_\textrm{art}\), with all the spatial filter vectors in the columns, to be applied as
\(\textbf{W}_\textrm{art}^\mathrm T\textbf{X}=\textbf{S}_\textrm{art}\). The respective artifact data are given as
$$\begin{aligned} \textbf{X}_\textrm{art}=\textbf{A}_\textrm{art}\textbf{S}_\textrm{art}=\textbf{A}_\textrm{art}\textbf{W}_\textrm{art}^\textrm{T}\textbf{X}. \end{aligned}$$
(2)
Popular TMS–EEG data cleaning methods, ICA, SSP(–SIR), SOUND, and the Berg–Scherg methods, are based on spatial filtering, which can be expressed as matrix multiplications from the left by the cleaning matrix
\(\textbf{M}_{\textrm{clean}}\):
$$\begin{aligned} \textbf{M}_{\textrm{clean}}\textbf{X}=\textbf{M}_{\textrm{clean}}\textbf{AS}=[\textbf{M}_{\textrm{clean}}\textbf{A}_\textrm{brain},\; \textbf{M}_{\textrm{clean}}\textbf{A}_\textrm{art}]\begin{bmatrix} \textbf{S}_\textrm{brain} \\ \textbf{S}_\textrm{art} \end{bmatrix}\approx [\textbf{A}_\textrm{brain},\; \textbf{0}]\begin{bmatrix} \textbf{S}_\textrm{brain} \\ \textbf{S}_\textrm{art} \end{bmatrix}=\textbf{A}_\textrm{brain}\textbf{S}_\textrm{brain}, \end{aligned}$$
(3)
where the artifact topographies are set close to zero, while the neuronal topographies would optimally stay intact. With the help of Eq. (
2), we can construct the optimal cleaning matrix
\(\textbf{M}_{\textrm{clean}}\), to get purely neuronal data
\(\textbf{X}_\textrm{brain}\), as
$$\begin{aligned} \textbf{M}_{\textrm{clean}}\textbf{X}=(\textbf{I}-\textbf{A}_\textrm{art}\textbf{W}^\textrm{T}_\textrm{art})\textbf{X}=\textbf{AS}-\textbf{A}_\textrm{art}\textbf{S}_\textrm{art}=\textbf{A}_\textrm{brain}\textbf{S}_\textrm{brain}=\textbf{X}_\textrm{brain}. \end{aligned}$$
(4)
In Hernandez-Pavon et al. (
2022), it was shown that we can formulate all existing spatial filter-based cleaning techniques within the framework of beamforming, by which the spatial filter matrix for Eq. (
4) is obtained as
$$\begin{aligned} \textbf{W}^\mathrm {}_\textrm{art}=\Sigma _\mathrm {}^{-1} \textbf{A}_\textrm{art} (\textbf{A}_\textrm{art}^\mathrm T \Sigma _\mathrm {}^{-1} \textbf{A}_\textrm{art})^{-1}, \end{aligned}$$
(5)
where
\(\Sigma _\mathrm {}\) is the data covariance matrix. As neither the true artifact topographies nor the covariance matrix are known, we use their estimates
\(\hat{\Sigma }\),
\(\hat{\textbf{A}}_\textrm{art}\) instead. The advantage of Eq. (
5) is that the single formula can be used to derive novel adapted EEG cleaning approaches for various artifacts and data. In practice, this is accomplished by estimating
\(\hat{\Sigma }\), and
\(\hat{\textbf{A}}_\textrm{art}\) in different ways as described later.
To estimate the beamforming filter by Eq. (
5), we need to define the topographies spanning the artifact subspace, the data covariance matrix, and the regularization for computing the inverse of the covariance. There are two main options for estimating the data covariance matrix. In context of beamforming, sample-based covariance is most often used as
\(\Sigma _\mathrm {}\approx \textbf{XX}^\textrm{T}/T\). As discussed in (Hernandez-Pavon et al.
2022), the sample-based estimate can get biased with evoked (time-dependent) components, so mean-subtraction, suggested in (Metsomaa et al.
2016), is useful. Mean subtraction is simply obtained by subtracting the trial-averaged evoked response
\(\varvec{\bar{X}}\) from each single-trial response
\(\textbf{X}_r\) in trial
r, which yield the sample-based covariance estimate as
$$\begin{aligned} \hat{\Sigma }^\textrm{sample}=\langle (\textbf{X}_r-\varvec{\bar{X}} )(\textbf{X}_r-\varvec{\bar{X}})^\textrm{T}\rangle _{r}\, \end{aligned}$$
(6)
where
\(\langle \cdot \rangle _r\) denotes taking sample mean over the trials.
Another approach is to use the model-based covariance matrix, which is estimated by
$$\begin{aligned} \hat{\Sigma }^\textrm{model}=\Sigma _{\textrm{brain}}+\Sigma _{\textrm{art}}+\Sigma _{\textrm{noise}}=\textbf{A}_{\textrm{brain}}\Lambda _{\textrm{brain}}\textbf{A}_{\textrm{brain}}^\textrm{T}+\textbf{A}_{\textrm{art}}\Lambda _{\textrm{art}}\textbf{A}_{\textrm{art}}^\textrm{T}+\textbf{A}_{\textrm{noise}}\Lambda _{\textrm{noise}}\textbf{A}_{\textrm{noise}}^\textrm{T}, \end{aligned}$$
(7)
where
\(\Sigma _{\textrm{brain}}\),
\(\Sigma _{\textrm{art}}\), and
\(\Sigma _{\textrm{noise}}\) are the data covariance matrices of the three types of data, neuronal, artifactual, and noise, respectively, while
\(\Lambda _{\textrm{brain}}\),
\(\Lambda _{\textrm{art}}\), and
\(\Lambda _{\textrm{noise}}\) are the covariance matrices of the corresponding underlying components. The covariance matrices of the three data types add up since they are assumed mutually uncorrelated. We note here, that strictly speaking, temporally coexisting artifacts and neural activity may appear correlated; few preprocessing steps, including baseline resetting or the so-called ’mean-subtraction’, have been previously proposed to overcome this issue (Metsomaa et al.
2014,
2016; Hernandez-Pavon et al.
2022).
To use Eq. (
7), we should define the mixing matrices and the component covariance matrices. Common choices for the covariance matrices are diagonal matrices, e.g.,
\(\Lambda =\textrm{diag}(\lambda _1, \ldots , \lambda _N)\). In the simplest case, all diagonals are set uniform
\(\Lambda =\textbf{I}\lambda\). Similarly to the source localization problem, the neuronal mixing matrix
\(\textbf{A}_\textrm{brain}\) can be computed by, e.g., boundary-element model after inserting a set of distributed dipolar sources in a multi-compartment head model, yielding the so-called lead-fied matrix.
The topographies of the artifacts for using Eqs. (
4), (
5), and (
7) could be estimated using statistical methods, for example, ICA or principal component analysis (PCA). In “
Estimating Artifact Topographies” section, some more detailed suggestions are given for topographic estimation. Different ways of choosing the artifact topographies and covariance matrices yield different previously published cleaning algorithms as has been shown in Hernandez-Pavon et al. (
2022).
Importantly, we are not limited to the established spatial-filter -based cleaning methods, but we may use Eq. (
5) creatively to optimize the cleaning result for the data at hand. For example, the covariance matrix could be estimated using the sample- or model-based estimation, or their combination. In the following sections, we illustrate several types of implementations based on Eqs. (
4) and (
5) to accommodate the needs of different types of data and artifacts.
Estimating Artifact Topographies
Perhaps the most challenging part of preparing the spatial filter operator
\(\textbf{W}_\textrm{art}\) by Eq. (
5) is to define a set of topographies representing the artifact components
\(\textbf{A}_\textrm{art}\). While for the neuronal EEG data, we can use physical modelling to estimate the mixing matrix
\(\textbf{A}_\textrm{brain}\), for the artifact components such a model is commonly not available. Thus, we need to make use of the statistical properties of the data to estimate topographies which most likely represent artifacts. Here, we describe different ways to estimate the artifact topographies to get
\(\hat{\textbf{A}}_\textrm{art}\), which can then be inserted into (
5) to derive the spatial filter.
Importantly, two properties of beamforming make the artifact topography estimation task easier. Firstly, we do not need to define the topography
\(\textbf{a}_{\textrm{art},i}\) of each artifact component
i. Instead, we can estimate a set of
\(\hat{N}\) topographies
\({\hat{\textbf A}}_\textrm{art}=[{\hat{\textbf a}}_{\textrm{art},1},\;\ldots ,\;{\hat{\textbf a}}_{\textrm{art},\hat{N}}]\), which together span the artifact subspace, i.e., all true artifact topographies can be represented as a weighted sums of the estimated topographies,
\(\textbf{a}_{\textrm{art},i}=\sum _j c_{i,j} \,{\hat{\textbf a}}_{\textrm{art},j}\), where
\(c_{i,j}\)’s denote the weights. Moreover, the span of the estimated topographies does not need to be exactly same as the span of the true artifacts; it is enough if the estimated span includes the true span:
$$\begin{aligned} \textrm{span}(\textbf{A}_\textrm{art})\subset \textrm{span}({\hat{\textbf A}}_\textrm{art}), \end{aligned}$$
(8)
which means that the estimate artifact subspace may also contain some part of artifact-free data (Hernandez-Pavon et al.
2022). However, the wider the span of the estimated artifact subspace, the greater the risk for undesired suppression of neuronal EEG signals. If the span fully includes some neuronal EEG topographies, the cleaning will also remove these interesting signals completely because beamforming by (
5) yields the time course estimates
\({\hat{\textbf S}}_\textrm{art}\) for all components lying within the span of
\({\hat{\textbf A}}_\textrm{art}\); for detailed theoretical reasoning please see Hernandez-Pavon et al. (
2022). Such biased cleaning is termed as overcorrection. The opposite effect, undercorrection, takes place if some artifact topography is partly not included in the span of the estimated artifact subspace. We also note here that, alternatively, one could as well determine the topographies spanning the neural EEG
\(\textbf{A}_\textrm{brain}\), and then use beamforming to extract the clean data for such a neural subspace. In this case, the practical challenge are the leakage signals from high-amplitude artifacts into neural EEG estimates because, in our experience, it is difficult to extract a sufficiently accurate set of neural basis topographies (by PCA or other means).
In general, the most common ways to estimate artifact topographies are PCA and ICA. As ICA assumes statistical independence, one should carefully think whether this assumption is valid for the types of artifacts that are removed. If the assumption is invalid, the ICA-estimated topographies may combine all EEG activity overlapping temporally with the artifact (Hernandez-Pavon et al.
2022; Metsomaa et al.
2014).
PCA is useful in extracting the topographies, which cover most of the data power. Prior to PCA, it can be beneficial to apply temporal filtering to the data. This
\(T\times T'\) filter
\(\textbf{F}\), retrieving a filtered waveforms of length
\(T'\), should be designed so as to enhance the artifact-to-signal-ratio of the EEG since the topographies stay intact in temporal filtering applied as
\(\textbf{X} \textbf{F}=\textbf{AS} \textbf{F}=\textbf{A}\tilde{\textbf{S}}\). This idea was introduced in Mäki and Ilmoniemi (
2011), where high-pass filtering was applied to highlight the TMS-evoked muscle artifacts which also contain power within high frequencies.
We would like to emphasize that different types of temporal filters can be useful before PCA, depending on the properties of the data and artifacts. For example, a simple
\(T\times T-1\) difference filter
\(\textbf{F}^\textrm{diff}\), defined as
$$\begin{aligned} \begin{aligned} {F}^\textrm{diff}_{i,j}&=1,\,\,\,\,\,\,\textrm{when}\, i=j \\ {F}^\textrm{diff}_{i,j}&=-1,\, \textrm{when}\, i=j+1\\ F^\textrm{diff}_{i,j}&=0,\, \,\,\,\,\,\textrm{otherwise}, \end{aligned} \end{aligned}$$
(9)
can be used to highlight rapidly and monotonically changing artifact components. If there is a spike-like artifact, meaning a short-lived high-amplitude deflection, a
\(T\times T-2\) second-order difference filter (Laplacian)
\(\textbf{F}^\textrm{Lap}\) may be beneficial:
$$\begin{aligned} \begin{aligned} {F}^\textrm{Lap}_{i,j}&=1,\, \,\,\,\,\,\textrm{when}\, i=j \\ {F}^\textrm{Lap}_{i,j}&=-2,\, \textrm{when}\, i=j+1\\ F^\textrm{Lap}_{i,j}&=1,\, \,\,\,\,\,\textrm{when}\, i=j+2\\ F^\textrm{Lap}_{i,j}&=0,\, \,\,\,\,\,\textrm{otherwise}. \end{aligned} \end{aligned}$$
(10)
The goal of the temporal filtering is to ensure that the artifacts have a high relative power compared to other signals. PCA then is run and a set of topographies containing most of the power are set as the columns of
\({\hat{\textbf A}_\textrm{art}}\) to estimate the spatial span of the artifacts.
In some cases, the artifact topographies are set based on physical generative assumptions. In SOUND and in the data-driven Wiener filter (DDWiener) (Mutanen et al.
2018), we assume that the artifact/noise topographies show non-zero activity in one electrode only. Thus, we can set all such single-sensor topographies as separate uncorrelated artifacts. See “
Case 2: Implementation of Fast SOUND via Beamforming” section, for a detailed description of how to formulate SOUND via beamforming.
It may also be possible to measure artifact EEG
\(\textbf{X}_\textrm{art}\) purely generated by the problematic sources. By directly applying PCA to these artifact data, we can obtain the basis for artifact topographies. For instance, TMS-evoked EEG also contain auditory- and somatosensory-evoked neural responses, which are difficult to separate from the direct cortical-evoked TEPs. Sham-stimulation, only delivering the peripheral stimuli, has been suggested as a control condition for TMS. The sham-evoked data are driven by non-interesting mechanisms only, so we may treat them as artifact data
\(\textbf{X}_\textrm{art}\). Such control-condition recording is described in detail in “
Experiment 2: Realistic Sham TMS Versus Real TMS at Supplementary Motor Area
” section, and in “
Adaptive Cleaning with Non-stationary Data Covariance or Changing Artifact Patterns” section, where we explain how to remove the peripheral-evoked potentials from the TEPs by beamforming.
Different Regularization Types
The usage of beamforming (Eq. (
5)) requires inverting the data covariance matrix. In practice, the covariance matrix is often ill-posed since the number of channels exceeds the number of sufficiently high-amplitude components in the data (degrees of freedom). The ill-posedness results in unstable beamforming filters due to the numerical problems in the inversion, for which reason regularization is used. Here, we consider three types of regularization briefly described below.
When eigendecomposition (ED) is applied to the covariance matrix
\(\Sigma\), we get
$$\begin{aligned} \Sigma _\mathrm {}=\textbf{U D U}^\textrm{T}=\sum _{i=1}^{M_\mathrm {}} d_{i} \textbf{u}_i \textbf{u}_i^\textrm{T}, \end{aligned}$$
(11)
where
\(M_\mathrm {}\times M_\mathrm {}\) \(\textbf{U}=[\textbf{u}_1,\,\ldots ,\, \textbf{u}_{M_\mathrm {}}]\) is an orthogonal matrix with eigen vectors as columns, and
\(M_\mathrm {}\times M_\mathrm {}\) \(\textbf{D}\) is a diagonal matrix with eigenvalues,
\(d_1,\,\ldots ,\,d_{M_\mathrm {}}\), as its diagonal elements in a descending order. This eigendecomposition is also used for retrieving the components in PCA, where the eigenvectors are interpreted as the EEG (basis) topographies.
Inverse of the covariance matrix becomes
$$\begin{aligned} \Sigma _\mathrm {}^{-1}=\textbf{U D}^{-1} \textbf{U}^\textrm{T}=\sum _{i=1}^{M_\mathrm {}} d_{i}^{-1} \textbf{u}_i \textbf{u}_i^\textrm{T}. \end{aligned}$$
(12)
In the case of EEG, there are several eigenvalues which are close or equal to 0. Numerical problems arise when the small eigenvalues turn into very large inverted values, dominating the inverse matrix computation in Eq. (
12).
To avoid the numerical problems, regularization is applied. Tikhonov regularization equals to setting
\(\Sigma \leftarrow \Sigma +\textbf{I}\gamma,\; \mathrm{with\; \gamma>0}\). As a result, the inverse becomes
$$\begin{aligned} \Sigma ^{\dagger ,\textrm{Tikhonov}}=\textbf{U}( \textbf{D}+ \gamma \textbf{I})^{-1} \textbf{U}^\textrm{T} =\sum _{i=1}^{M_\mathrm {}} (\gamma +d_{i})^{-1} \textbf{u}_i \textbf{u}_i^\textrm{T}, \end{aligned}$$
(13)
which reduces the contribution of the small eigenvalues in the inverse estimate.
The eigenvalue truncation-based regularization means that the small eigenvalues are cut out and only
P largest values are preserved, giving
$$\begin{aligned} \Sigma ^{\dagger ,\textrm{ED}}=\sum _{i=1}^P d_{i}^{-1} \textbf{u}_i \textbf{u}_i^\textrm{T}. \end{aligned}$$
(14)
Note that this regularization is similar to the so called singular-value truncation technique, which is commonly used in EEG source estimation, when inverting the lead-field matrix. Additionally, preserving the largest components is also often the application for which PCA is used to reduce data dimensionality for simplifying the data interpretation/analysis.
The third type tested here is based on the alternative formulation of beamforming derived in Hernandez-Pavon et al. (
2022). As a prerequisite, we need to have an orthonormal set of basis vectors spanning the estimated artifact subspace set as columns of
\({\hat{\textbf A}_\textrm{art}}\), which fully spans the artifacts as defined in Eq. (
8). We also need its orthocomplement, which only contains neuronal data and is spanned by another orthonormal set of topographies, the columns of
\(\textbf{B}\). In practice, this orthocomplement is retrieved from PCA as the topographies remaining after extracting the artifact topographies, and thus indexed by
\({\hat{N},\hat{N}+1,\ldots , M}\), which are considered purely neural. Consequently,
\({\hat{\textbf A}_\textrm{art}}\) and
\(\textbf{B}\) span the entire data. It is noteworthy that
\(\textbf{B}\) is not an estimate of
\(\textbf{A}_\textrm{brain}\) because the estimated artifact subspace may (and is allowed to) partly overlap with neural EEG as discussed in “
Estimating Artifact Topographies” section.
Now the beamforming filter is retrieved by
$$\begin{aligned} \textbf{W}^\mathrm {}_\textrm{art}= {\hat{\textbf A}_\textrm{art}}-\textbf{B} (\textbf{B}^\mathrm T{\Sigma }\textbf{B})^{-1} \textbf{B}^\mathrm T \Sigma {\hat{\textbf A}_\textrm{art}} , \end{aligned}$$
(15)
where we use the eigenvalue truncation -based pseudoinverse (similar to Eq. (
14)) to compute the inverse in the second term:
\((\textbf{B}^\mathrm T{\Sigma }\textbf{B})^{\dagger ,ED}\). Taking a closer look at this invertable matrix, we see that it includes the EEG covariance matrix projected to the subspace defined by the columns of
\(\textbf{B}\), which is free of artifacts, so the inverse is applied to a covariance matrix of dimensions
\((M-\hat{N}) \times (M-\hat{N})\). Here, we refer to this regularization as ED regularization type 2, while the conventional ED truncation by Eq. (
14) is referred to as ED regularization type 1. We compare the two types of ED regularization with simulated data as described in “
Simulating and Cleaning Artifactual TEPs” and “
Simulation Results” sections.
Adaptive Cleaning with Non-stationary Data Covariance or Changing Artifact Patterns
Using the BF-based cleaning by Eqs. (
5) and (
4), we assume that the covariance matrix and the artifact topographies stay fixed. In some cases, however, it may be useful to adapt the cleaning matrix to the changes in the data covariance. For example, we might expect that the data statistics are changing as a function of time after a TMS pulse, as also illustrated by the fact that averaged TEPs consist of time-dependent deflections. Additionally, during a long measurement, the data statistics may be changing, e.g., the sensor noise levels (the noise variances) can change, which needs to be taken into account in real-time data cleaning (Makkonena et al.
2021). As BF makes use of the data covariance matrix, the changes in this variable should be taken into account, for example, by windowing the data into segments within which we can assume stationarity. Commonly, we can expect that a particular artifact preserves the same topographic pattern throughout a measurement session if the physical phenomenon generating the pattern stays the same. In such a case, we can simply update the cleaning matrix, by updating the data covariance matrix estimate in Eq. (
5). For example, in real-time cleaning, we could expect that eye blinks topographies keep constant. Hence, it is enough to estimate them once, after which blink removal requires re-estimating the covariance, which idea was presented in Makkonena et al. (
2021).
There may also be cases where the artifact topographies are changing significantly, so that the artifact mixing matrix should be adapted to the time window at hand. If TEPs contain several types of artifacts, which can be divided into separate windows, it can be feasible to use a separate subset of artifact topographies when applying Eqs. (
5) and (
4) in each window.
The artifact topographies may also change due to data processing. If the data in Eq. (
1) are modified by multiplying by a spatial filter matrix
\(\textbf{P}_\textrm{spat}\), the underlying mixing matrix is modified accordingly. This modifies the artifact topographies as
\(\tilde{\textbf{A}}_\textrm{art}=\textbf{P}_\textrm{spat}\textbf{A}_\textrm{art}\), along with all the other topographies. Naturally, spatial filtering also modifies the covariance matrix by
\(\tilde{\Sigma }=\textbf{P}_\textrm{spat}\Sigma \textbf{P}_\textrm{spat}^\textrm{T}\). Inserting these new terms into Eq. (
5) and assuming that
\(\textbf{P}_\textrm{spat}\) is invertible gives the modified spatial filter:
$$\begin{aligned} \tilde{\textbf{W}}_\textrm{art}= \textbf{P}_\textrm{spat}^{-\textrm{T}}{\textbf{W}}_\textrm{art}. \end{aligned}$$
(16)
In practice, computing the cleaning matrix starting from the definition in Eqs. (
4) and (
5) with appropriate regularization could be preferable over the shortcut version given in Eq. (
16) because
\(\textbf{P}_\textrm{spat}\) are often not stable to invert as such, which may lead to distorted cleaning results. In “
Case 4: Adaptive BF-Based Cleaning to Eliminate Peripheral-Evoked Potentials” section, we explain how to make use of adaptive cleaning approaches in removing ocular artifacts and peripheral-evoked responses from TEPs.