Station 3 · Lesson 6

Channel interpolation

Core10 minBefore this lesson: Bad channelsPrint the card
Starts from: eeglab_data.set (D1) · Already applied: High-pass & low-pass filtering, Removing line noise (50/60 Hz), Bad channelsDownload the data (opens in a new tab)
Script to reach this state
MATLAB
[ALLEEG, EEG, CURRENTSET, ALLCOM] = eeglab;
eeglabRoot = fileparts(which('eeglab'));
EEG = pop_loadset('eeglab_data.set', fullfile(eeglabRoot, 'sample_data'));
fullLocs = EEG.chanlocs;

% Main dataset: high-pass at 0.1 Hz, then 60 Hz line-noise removal
EEG = pop_eegfiltnew(EEG, 'locutoff', 0.1);
EEG = pop_eegfiltnew(EEG, 'locutoff', 58, 'hicutoff', 62, 'revfilt', 1);
EEG.filename = ''; EEG.filepath = ''; EEG.datfile = ''; EEG.saved = 'no';
[ALLEEG, EEG, CURRENTSET] = pop_newset(ALLEEG, EEG, 0, 'setname', 'D1 hp0.1 notch60', 'gui', 'off');

% Bad channels you removed earlier, e.g. {'T7'}; leave empty if none
badChans = {};
if ~isempty(badChans)
    EEG = pop_select(EEG, 'rmchannel', badChans);
end
EEG.filename = ''; EEG.filepath = ''; EEG.datfile = ''; EEG.saved = 'no';
[ALLEEG, EEG, CURRENTSET] = pop_newset(ALLEEG, EEG, CURRENTSET, 'setname', 'D1 badch', 'gui', 'off');
eeglab redraw;

The idea in brief

In the previous lesson you removed the bad channels. Now you rebuild them by interpolationEstimating a removed channel's signal from the channels around it.: EEGLAB computes each removed channelThe signal recorded from one electrode, as shown in EEGLAB. from the channels around it, based on the electrodeThe physical sensor placed on the scalp to pick up the signal. locations on the head. D1 has no bad channelA channel that is flat or noisy for most of the recording., so you practice on a temporary copy that you do not save.

Why not carry on without them? For three reasons:

Before and after

Show
Scalp map after removing channel C3: no dot at the C3 position, and the colours around it come from the plot smoothing.
Before: D1 noC3Data: EEGLAB sample data (eeglab_data.set)
The same map after interpolation, same time point and colour limits: the C3 dot is back and the pattern is very close to the original.
After: D1 C3 backData: EEGLAB sample data (eeglab_data.set)

Your next questions, each answered in its own section:

Why do I need this step?

The reasons in detail, and the terms you need
  1. The average referenceA reference equal to the mean of all scalp channels. needs channels spread over the whole head. A missing channel on one side tilts the average toward the other side.
  2. Comparing participants needs the same channels for everyone.
  3. Scalp maps draw a gap where a channel is missing.

But interpolation has a price. An interpolated channel is a mix of the other channels, so it adds no new information. That is why each interpolated channel reduces the data rankThe number of truly independent channels; it drops after interpolation or average reference. by one. You will need this in the ICAA method that separates the recording into independent sources, some brain and some artifact. lessons.

How do I do it in EEGLAB?

12 steps in the menus

Start with the Starting point. Its scriptA MATLAB file of commands that runs processing steps in order. puts the datasetOne EEG data file loaded in EEGLAB together with its information. from before channel removal, D1 hp0.1 notch60, in dataset 1, and the main dataset D1 badch in dataset 2. You will need the number of dataset 1 for your own data, because it holds the locations of all channels.

First: practice on a good channel

  1. With D1 badch current, open Edit then Select data. Type C3 in Channel(s), check the box under on->remove these, then press OK.
  2. Name the new dataset D1 noC3. In the main window, Channels per frame is now 31.
  3. Open Tools then Interpolate electrodes. A window titled Interpolate channel(s) — pop_interp() appears.
  4. Press Use all channels from other dataset, type 2, the number of the D1 badch dataset, in Dataset index, then OK. The name C3 appears under What channel(s) do you want to interpolate.
  5. In Interpolation method, keep Spherical, leave Time range [min max] (s) empty, then press OK.
  6. The command window prints Interpolating 1 channels.... Name the dataset D1 C3 back. The channel count is 32 again.
  7. Compare C3 in D1 badch and in D1 C3 back with Plot then Channel data (scroll). The two signals are very similar.
  8. These are exercise copies, so do not save them. Go back to D1 badch.

Second: interpolation on your own data

  1. With the dataset you removed bad channels from as current, open Tools then Interpolate electrodes.
  2. Press Use all channels from other dataset and type the number of the dataset from before the removal. The names of the removed channels appear.
  3. Keep Spherical and press OK. Name the result D1 interp and save it.
  4. In D1 no channel was removed, so if you try, EEGLAB says No new channels selected. The main dataset stays D1 badch, and the re-referencingChanging the reference after recording by expressing voltages relative to a new one. lesson starts from it.

How do I write it as code?

The same steps in 15 lines of MATLAB
MATLAB
% Rebuild the removed channels from the full channel list (fullLocs)
if ~isempty(badChans)
    EEG = pop_interp(EEG, fullLocs, 'spherical');
end
EEG.setname = 'D1 interp';
fprintf('Channels after interpolation: %d\n', EEG.nbchan);
EEG = pop_saveset(EEG, 'filename', 'D1_interp.set', 'filepath', pwd);

% Exercise: remove a good channel, rebuild it, compare with the original
testChan = 'C3';
EEG_drop = pop_select(EEG, 'rmchannel', {testChan});
EEG_back = pop_interp(EEG_drop, fullLocs, 'spherical');
iOrig = find(strcmp({EEG.chanlocs.labels}, testChan));
iBack = find(strcmp({EEG_back.chanlocs.labels}, testChan));
r = corrcoef(double(EEG.data(iOrig, :)), double(EEG_back.data(iBack, :)));
fprintf('Correlation between original and interpolated %s: %.2f\n', testChan, r(1, 2));

The variable fullLocs comes from the Starting point script: a copy of all channel locations before any removal. Always keep it at the start of processing.

Which value should I choose?

Suitable values for your analysis goal
SettingValueWhy
Interpolation methodSphericalThe first option in the window and the default in pop_interp. It uses electrode positions on the surface of the head.
Source of locationsAll channels from the dataset before removal, or fullLocs in a scriptThis is how EEGLAB knows the names and positions of the missing channels, and puts them back in their original order.
Where in the pipelineAfter removing bad channels, before re-referencingThe average reference needs all channels.
Number of interpolated channelsFewEach interpolated channel reduces the data rank by one and adds no new information.
Interpolate removed channel(s) in the re-referencing windowNot on our pathIt interpolates and re-references in one step. We do the two steps separately so you can check each one.

How do I check it worked?

4 quick checks
  1. The channel count is complete: Channels per frame in the main window equals the original number. In D1 it is 32.
  2. Same order: in Plot then Channel locations then By name the interpolated channels appear in their places.
  3. The exercise: the script prints a correlation close to 0.98 between the original and the interpolated C3.
  4. The signal makes sense: in Plot then Channel data (scroll) the interpolated channel looks like its neighbors, with no flat line and no jumps.

What mistakes do people make?

4 mistakes and how to avoid them
  • Re-referencing before interpolating. An average reference over missing channels leans toward the side with more channels. Interpolate first, then re-reference.
  • Losing the original locations. Once a channel is removed, EEGLAB only knows where it was from an earlier dataset or from fullLocs. Keep the locations before any removal.
  • Forgetting that the rank dropped. If you interpolate two channels, the data rank is two below the channel count, and three below after an average reference: 32 channels give rank 29. Write this number down and compare it with what pop_runica prints when you run ICA.
  • Trusting edge channels too much. A channel at the edge of the cap, such as T7, has neighbors on one side only, so its interpolation is less accurate than for a central channel such as C3.

How do I write it in my paper?

A Methods template: edit the data, settings and versions to match what you ran

A template: edit the data, settings and versions to match what you ran.

Removed channels were interpolated using spherical spline interpolation (pop_interp, EEGLAB 2026.1).

Where can I read more?

3 sources, official docs first

Written for EEGLAB 2026.1 · 2026-10-29

Need help?

Ask, share feedback, or report an error