Writing

What a reference is for

  • iEEG
  • Preprocessing

A recorded voltage is always a difference between two points. Choosing the second point is a modelling decision, not a formality.

Every voltage is a difference. There is no such thing as the potential at a contact — only the potential at that contact relative to somewhere else. When a clinical amplifier reports a number for electrode 7, it is reporting the difference between electrode 7 and whatever it was told to call zero.

Which means the reference is not a technicality you deal with before the analysis. It is part of the analysis, and picking it badly will produce a result that looks real and is not.

The problem in one equation

Take a contact ii on a depth electrode. What the amplifier writes down is

xi(t)=si(t)+c(t)+ni(t)x_i(t) = s_i(t) + c(t) + n_i(t)

where sis_i is the local signal you want, nin_i is noise particular to that contact, and cc is everything shared across the array: line noise, the amplifier’s own reference activity, distant sources far enough away that they arrive at every contact alike, and — if you are stimulating — the stimulation artefact.

That cc term is the whole difficulty. It is often much larger than sis_i, and because it is identical across contacts, it manufactures correlations between channels that have nothing to do with the brain. Two contacts in unrelated structures will look coupled, because they are both looking at the same cc.

Subtracting the neighbour

Bipolar referencing takes the difference between adjacent contacts on the same shaft:

bi(t)=xi(t)xi+1(t)=(si(t)si+1(t))+(ni(t)ni+1(t))b_i(t) = x_i(t) - x_{i+1}(t) = \bigl(s_i(t) - s_{i+1}(t)\bigr) + \bigl(n_i(t) - n_{i+1}(t)\bigr)

The cc term is gone. It was common to both contacts, so subtraction removed it exactly — no filter, no estimate, no assumption about its spectrum.1

What is left is a local difference: the signal at contact ii minus the signal at its neighbour a few millimetres away. That is a genuinely different quantity from “activity at contact ii”, and it is worth being clear-eyed about the trade. You gain spatial specificity and immunity to everything shared. You lose one channel per shaft, you lose any component of the local signal that the two contacts also share, and your units are now volts per contact spacing whether you say so or not.

In practice

import mne

raw = mne.io.read_raw_edf("session.edf", preload=False)

# Contacts along one shaft, in order: LA1, LA2, ... LA8
anodes   = [f"LA{i}" for i in range(1, 8)]
cathodes = [f"LA{i}" for i in range(2, 9)]

bipolar = mne.set_bipolar_reference(
    raw.load_data(),
    anode=anodes,
    cathode=cathodes,
    drop_refs=True,
)

Two things are easy to get wrong here and both are silent. The first is pairing contacts that are not actually adjacent, which happens whenever channel names sort lexicographically rather than anatomically — LA10 lands between LA1 and LA2, and the subtraction quietly becomes meaningless. The second is pairing across shafts, where the two contacts share no local field at all and the difference is just two unrelated signals stapled together.

Why this matters more under stimulation

In a stimulation study the artefact is the common-mode term. It is orders of magnitude larger than the response you are looking for, and it arrives at every nearby contact at effectively the same time. A reference scheme that leaves it in place does not leave you with a noisy result; it leaves you with a result that is mostly artefact, shaped like a finding.

The useful discipline is to decide the reference before looking at the data, on physical grounds, and then not revisit it because a different choice produced a cleaner figure.

That is the entire argument for making the referencing decision first, in writing, as part of the analysis plan — not as a preprocessing step that someone tunes until the effect appears.

Footnotes

  1. More precisely, bipolar referencing is a first-order spatial derivative along the shaft, which acts as a spatial high-pass. Sources broad enough to be near-identical at both contacts are attenuated along with the noise — which is usually what you want, and occasionally exactly what you did not.

← All writing