Simply EEGLAB

Removing line noise (50/60 Hz)

Station 3 · Lesson 3 · EEGLAB 2026.1

In the GUI

  1. PlotChannel spectra and maps
  2. Plotting frequency range [lo_Hz hi_Hz]: 2 251 64
  3. Frequencies to plot as scalp maps (Hz):OK 10 60
  4. ToolsFilter the dataBasic FIR filter (new, default)
  5. Lower edge of the frequency pass band (Hz) 58
  6. Higher edge of the frequency pass band (Hz) 62
  7. Notch filter the data instead of pass band
  8. OKPlot frequency response
  9. Overwrite it in memory (set=yes; unset=create a new dataset) D1 hp0.1 notch60
  10. FileSave current dataset as

Script

lineFreq = 60;
figure; pop_spectopo(EEG, 1, [], 'EEG', 'freqrange', [1 64], 'freq', [10 lineFreq]);
EEG = pop_eegfiltnew(EEG, 'locutoff', lineFreq - 2, 'hicutoff', lineFreq + 2, 'revfilt', 1);
EEG.setname = 'D1 hp0.1 notch60';
figure; pop_spectopo(EEG, 1, [], 'EEG', 'freqrange', [1 64], 'freq', [10 lineFreq]);
EEG = pop_saveset(EEG, 'filename', 'D1_hp0.1_notch60.set', 'filepath', pwd);

Which value should I choose?

SettingValue
Line frequency60 Hz in D1 and in Saudi Arabia, 50 in Europe and most other Arab countries
Notch edgesLine frequency ± 2 Hz: 58 to 62, or 48 to 52
Filter orderLeave it empty (automatic)
Harmonics (120, 180 Hz…)Not needed in D1
MethodWhen to use it
Notch filter (pop_eegfiltnew)ERPs and most cases. This is the method on our path
CleanLineSpectral analysis where you want to keep the frequencies around 50 or 60 Hz. It estimates the line-noise wave and subtracts it instead of removing a whole band. The official tutorial says its result can be spectacular when it works, and that it does not always work
Zapline-plusSpectral or time-frequency analysis above 40 Hz, or strong line noise with many harmonics. It finds the noise and removes it automatically

Check

  • Compare the spectrum
  • Neighboring frequencies did not change
  • The scalp map at 60 Hz
  • In the command window

For your Methods

Line noise was attenuated with a zero-phase Hamming-windowed sinc FIR band-stop (notch) filter (passband edges 58 and 62 Hz, −6 dB cutoffs [59] and [61] Hz, filter length [213] points; pop_eegfiltnew with 'revfilt', firfilt plugin 2.8, EEGLAB 2026.1).

Full lesson: https://simplyeeglab.pages.dev/en/lesson/line-noise/

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

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