orphan: |
---|
In short, data repair using spherical spline interpolation :footcite:`PerrinEtAl1989` consists of the following steps:
Spherical splines assume that the potential V(ri) at any point ri on the surface of the sphere can be represented by:
where the C = (c1, ..., cN)T are constants which must be estimated. The function gm(⋅) of order m is given by:
where Pn(x) are Legendre polynomials of order n.
To estimate the constants C, we must solve the following two equations simultaneously:
where Gss ∈ RN×N is a matrix whose entries are Gss[i, j] = gm(cos(ri, rj)) and X ∈ RN×1 are the potentials V(ri) measured at the good channels. Ts = (1, 1, ..., 1)⊤ is a column vector of dimension N. Equation :eq:`matrix_form` is the matrix formulation of Equation :eq:`model` and equation :eq:`constraint` is like applying an average reference to the data. From equation :eq:`matrix_form` and :eq:`constraint`, we get:
Ci is the same as matrix \begin{bmatrix} TsT 0Ts Gss but with its first column deleted, therefore giving a matrix of dimension (N + 1)×N.
Now, to estimate the potentials X̂ ∈ RM×1 at the bad channels, we have to do:
where Gds ∈ RM×N computes gm(ri, rj) between the bad and good channels. Td = (1, 1, ..., 1)⊤ is a column vector of dimension M. Plugging in equation :eq:`estimate_constant` in :eq:`estimate_data`, we get
To interpolate bad channels, one can simply do:
>>> evoked.interpolate_bads(reset_bads=False) # doctest: +SKIP
and the bad channel will be fixed.
Examples: