Simply EEGLAB
Removing line noise (50/60 Hz)
Station 3 · Lesson 3 · EEGLAB 2026.1
In the GUI
- PlotChannel spectra and maps
- Plotting frequency range [lo_Hz hi_Hz]:
2 251 64 - Frequencies to plot as scalp maps (Hz):OK
10 60 - ToolsFilter the dataBasic FIR filter (new, default)
- Lower edge of the frequency pass band (Hz)
58 - Higher edge of the frequency pass band (Hz)
62 - Notch filter the data instead of pass band
- OKPlot frequency response
- Overwrite it in memory (set=yes; unset=create a new dataset)
D1 hp0.1 notch60 - 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?
| Setting | Value |
|---|---|
| Line frequency | 60 Hz in D1 and in Saudi Arabia, 50 in Europe and most other Arab countries |
| Notch edges | Line frequency ± 2 Hz: 58 to 62, or 48 to 52 |
| Filter order | Leave it empty (automatic) |
| Harmonics (120, 180 Hz…) | Not needed in D1 |
| Method | When to use it |
Notch filter (pop_eegfiltnew) | ERPs and most cases. This is the method on our path |
| CleanLine | Spectral 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-plus | Spectral 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).