Station 3 · Lesson 2

High-pass & low-pass filtering

Core15 minBefore this lesson: ResamplingPrint the card
Starts from: eeglab_data.set (D1) · Nothing yet: the data as downloaded.Download 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'));
[ALLEEG, EEG, CURRENTSET] = pop_newset(ALLEEG, EEG, 0, 'setname', 'Continuous EEG Data', 'gui', 'off');
eeglab redraw;

The idea in brief

Raw EEGA recording of the brain's electrical activity from electrodes on the scalp. contains things that do not come from the brain. There is slow drift from sweat and electrodeThe physical sensor placed on the scalp to pick up the signal. movement, and fast noiseAny part of the recording that does not carry the information we want. from muscles and the powerThe squared amplitude; how strong a signal is at a given frequency. line. On our path you save only a 0.1 Hz high-passA filter that passes high frequencies and weakens slow drifts. copy now, and try the low-passA filter that passes low frequencies and weakens fast ones such as muscle activity. as an exercise without saving it.

Before and after

Try turning on each filterA tool that weakens some frequencies in a signal and keeps others. on its own, and watch what disappears from the signalValues that change over time, such as the voltage recorded on a channel..

The simulation needs JavaScript. Here is a still image of the same idea.

This is a simulation. The pipeline setting in this lesson is high-pass 0.1 Hz with no low-pass

What does this show?

Notice in the panel that the number you type in EEGLAB is the passband edgeThe last frequency passed almost unchanged; the number you enter in pop_eegfiltnew., not the actual cutoff.

Notice also that a 30 Hz low-pass removed the line-noise peak. That is why the line-noise lesson matters more if you keep high frequencies. This happens in ICAA method that separates the recording into independent sources, some brain and some artifact., spectral, and time-frequencyAnalysis showing how power at each frequency changes over time. analysis. The line frequencyThe number of cycles per second, measured in hertz (Hz). depends on where the data were recorded: 60 Hz in Saudi Arabia and the US, 50 Hz in Europe and most other Arab countries. Check the spectrum before you assume.

Simplifications in this demo: one channel with a synthetic signal, not real EEG, and a fixed sampling rate of 250 Hz. Your data may have a different rate, so the filter order will differ.

Your next questions, each answered in its own section:

Why do I need this step?

The reasons in detail, and the terms you need

A high-pass filter lets high frequencies through and removes the slow ones. A low-pass filter lets low frequencies through and removes the fast ones.

Without filtering, slow drift can bury the brain signal you are looking for, and every later step gets harder.

Quick reminder

frequency is how many times a wave repeats per second, measured in hertz (Hz). A spectrum is a plot of how strong each frequency is in the signal. Alpha waves, for example, show up as a peak near 10 Hz.

How do I do it in EEGLAB?

13 steps in the menus

Start with eeglab_data.set loaded, as in the Starting point. We apply two filters, each as a separate step.

First: high-pass filter

  1. Open Tools then Filter the data then Basic FIR filter (new, default).
  2. In Lower edge of the frequency pass band (Hz), type 0.1.
  3. Leave Higher edge of the frequency pass band (Hz) empty.
  4. Leave FIR Filter order (Mandatory even. Default is automatic*) empty, so EEGLAB computes it for you.
  5. Keep Plot frequency response checked, then press OK.
  6. The filter response window opens. Notice how the response rises from zero to one around 0.1 Hz, then close it.
  7. A window asks what to do with the new dataset. In Name it:, type a clear name such as D1 hp0.1.
  8. Leave Overwrite it in memory (set=yes; unset=create a new dataset) unchecked, so the original stays available for comparison. Press OK.
  9. Save this dataset now with File then Save current dataset as as D1_hp0.1.set. It is the main dataset of the path and the starting point of the next lesson.

Second, exercise: low-pass filter on the new dataset

  1. Open the same menu: Tools then Filter the data then Basic FIR filter (new, default).
  2. This time, leave Lower edge of the frequency pass band (Hz) empty.
  3. In Higher edge of the frequency pass band (Hz), type 30.
  4. Press OK, then name the dataset D1 hp0.1 lp30. This is the exercise dataset. Use it only in the checking section, and do not save it.
About the filter order

The filter order field says that manual definition is recommended. That is true once you understand the transition band and want to control it. The automatic value is a safe start for beginners. What matters most is using the same setting for every participant.

How do I write it as code?

The same steps in 8 lines of MATLAB

The same two steps as a script. Each filter is on its own line, and the low-pass goes into a separate variable because it is an exercise.

MATLAB
% High-pass: passband edge at 0.1 Hz (removes slow drift)
EEG = pop_eegfiltnew(EEG, 'locutoff', 0.1);
EEG.setname = 'D1 hp0.1';
EEG = eeg_checkset(EEG);
EEG = pop_saveset(EEG, 'filename', 'D1_hp0.1.set', 'filepath', pwd);   % path copy: the next lesson starts here

% Exercise only: low-pass with passband edge at 30 Hz (removes fast noise)
EEG_lp = pop_eegfiltnew(EEG, 'hicutoff', 30);   % exercise only: do not save
EEG_lp.setname = 'D1 hp0.1 lp30';

In a script, the frequency response window does not open, because 'plotfreqz' defaults to 0. Add 'plotfreqz', 1 if you want it.

Which value should I choose?

Suitable values for your analysis goal
Your goalHigh-passLow-passWhy this number
ERP analysis0.1 Hz30 HzLuck’s recommendation for most ERP analyses (Luck, Ch. 4). Removes drift without distorting slow components such as P3 and N400.
Computing ICA1 Hz, sometimes 2Usually not neededOfficial tutorial: ICA quality is notably higher with a high-pass above 1 Hz (Filtering and RunICA pages). Apply it to a separate copy only, as shown in the Running ICA lesson.
Spectral analysis0.5 to 1 HzNot below the highest frequency you studyA practical starting rule, not a number from the official docs. A 30 Hz low-pass, for example, removes upper beta and gamma.

The other filters in the menu: Tools then Filter the data also lists Windowed sinc FIR filter, Parks-McClellan (equiripple) FIR filter, and Moving average FIR filter, from the same firfilt plugin, and Basic FIR filter (legacy), the older filter kept for old scripts; do not use it for new work. Each one asks you to choose the filter order and other details yourself, so you need them only when a paper or a special case asks for a specific filter design. On this path Basic FIR filter (new, default) is enough.

A note on Luck’s numbers: Luck uses ERPLAB filters, where the number is the half-amplitude cutoff. In EEGLAB the number is the passband edge, so 0.1 and 30 give actual cutoffs (-6 dB) at 0.05 Hz and about 33.6 Hz for D1. The difference is small and acceptable in practice.

About these numbers: choose the edges based on your goal. The official tutorial itself gives no fixed high-pass value for ERPs and says the effect of filters on ERPs is still under discussion. The numbers in the table are starting points, not laws.

On this site’s core path the goal is ERP analysis. We apply the 0.1 Hz high-pass to the main dataset now, and postpone the 30 Hz low-pass until after cleaning the data with ICA. The reason is that ICA and ICLabel benefit from high frequencies, so the low-pass comes at the end of continuous processing. So the 30 Hz filter in this lesson is an exercise to see its effect.

How do I check it worked?

3 quick checks
  1. Read what EEGLAB printed in the command window. With D1 (128 Hz), the high-pass prints a line such as performing 4225 point highpass filtering, with an actual cutoff of 0.05 Hz. The low-pass uses a 59-point filter with an actual cutoff of about 33.64 Hz.
  2. Compare the spectrum. Open Plot then Channel spectra and maps on the original dataset, then on D1 hp0.1 lp30. Switch between datasets from the Datasets menu. Change Plotting frequency range [lo_Hz hi_Hz]: from 2 25 to 1 64, because the default range hides everything above 25 Hz. Keep the other fields as they are.
    • Power should drop above about 34 Hz.
    • In D1, the sharp line-noise peak at 60 Hz disappears.
    • The alpha peak near 10 Hz should stay the same.
    • Small ripples in the removed range are normal, and the official tutorial mentions them.
    • The effect of the 0.1 Hz high-pass does not show in this spectrum, because its resolution is about 1 Hz. You check it in the next step.
  3. Look at the signal itself. Open Plot then Channel data (scroll) on the original, then on D1 hp0.1. Each channel should stay centered on a steady line instead of slowly rising and falling.

What mistakes do people make?

5 mistakes and how to avoid them
  • Treating the number as the actual cutoff. The number you type is the passband edge. For a high-pass, the actual cutoff is lower: 1 Hz means a cutoff near 0.5 Hz. For a low-pass, it is higher: 30 Hz means about 33.6 Hz for D1.
  • Too high a high-pass on ERP data. A 1 or 2 Hz filter shrinks P3 and N400 and creates opposite-polarity deflections before and after them. Try it yourself:

The simulation needs JavaScript. Here is a still image of the same idea.

This is a simulation. The pipeline setting in this lesson is high-pass 0.1 Hz with no low-pass

  • Filtering after epoching. Filter the continuous data before extracting epochs. Epoching first multiplies edge effects in every short segment.
  • Applying both filters in one step. If you fill in both edges in the same window, both filters share the same transition bandwidth, so the low-pass becomes steeper than needed. The official tutorial recommends applying each filter separately.
  • Different settings across participants. Use the same edges and the same method for every participant in a study. Otherwise, differences between them come from the filter, not the brain.

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.

Data were high-pass filtered using a zero-phase Hamming-windowed sinc FIR filter (passband edge 0.1 Hz, cutoff frequency [0.05] Hz at −6 dB, transition bandwidth [0.1] Hz, filter length [4225] points; pop_eegfiltnew, firfilt plugin 2.8, EEGLAB 2026.1; Widmann et al., 2015).

Where can I read more?

4 sources, official docs first

Written for EEGLAB 2026.1 · 2026-10-29

Need help?

Ask, share feedback, or report an error