Simply EEGLAB

Re-referencing

Station 3 · Lesson 7 · EEGLAB 2026.1

In the GUI

  1. Channels per frame
  2. ToolsRe-reference the datapop_reref - average reference or re-reference data
  3. Current data reference state is: unknown
  4. Compute average reference
  5. Huber average ref. with threshold
  6. Exclude channel indices (EMG, EOG)... EOG1EOG2
  7. Add old ref. channel back to the data
  8. OK Re-referencing data
  9. Overwrite it in memory (set=yes; unset=create a new dataset) D1 main
  10. FileSave current dataset as
  11. PlotChannel data (scroll) EOG1EOG2

Script

EEG_before = EEG;
eogIdx = find(ismember({EEG.chanlocs.labels}, {'EOG1', 'EOG2'}));
EEG = pop_reref(EEG, [], 'exclude', eogIdx);
EEG.setname = 'D1 main';
scalpIdx = setdiff(1:EEG.nbchan, eogIdx);
fprintf('Reference: %s\n', EEG.ref);
fprintf('Largest sum over scalp channels: %g uV\n', max(abs(sum(EEG.data(scalpIdx, :), 1))));
oz = find(strcmp({EEG.chanlocs.labels}, 'Oz'));
t = 1:5*EEG.srate;
figure;
plot(t / EEG.srate, EEG_before.data(oz, t), t / EEG.srate, EEG.data(oz, t));
legend('Original reference (mastoid)', 'Average reference');
xlabel('Time (s)'); ylabel('Amplitude (uV)');
EEG = pop_saveset(EEG, 'filename', 'D1_main.set', 'filepath', pwd);

Which value should I choose?

SettingValue
Reference for the ICA path and source analysisAverage reference
Reference for comparing with earlier ERP studiesThe same reference as those studies, often linked mastoids
Excluded channelsEOG, ECG, and EMG channels
Adding the old reference channel backOnly if its location is defined in the channel editor
HuberNot before ICA

Check

  • Main window
  • The script check
  • The eye channels did not change
  • The scalp channels changed

For your Methods

Data were re-referenced to the average of all scalp channels (pop_reref, EEGLAB 2026.1); EOG channels were excluded from the reference.

Full lesson: https://simplyeeglab.pages.dev/en/lesson/rereferencing/

Content license: CC BY-NC-SA 4.0 · MIT (code)

An independent learning site, not affiliated with EEGLAB or SCCN.