Skip to content

Plot ERP Filter GUI

This demo shows how to use the interactive filter GUI to explore the effect of different filter settings on ERP waveforms.

Why an Interactive Filter Tool?

  • Teaching — show students how filters affect ERP signals in real time

  • Parameter selection — experiment with cutoff frequency and filter order before committing

  • Method comparison — toggle between IIR (Butterworth) and FIR filters, filtfilt vs filt

Key Features

FeatureDescription
Lowpass / Highpass togglesEnable each filter independently
Cutoff slidersAdjust frequency in real time
Order slidersChange filter steepness
Method menuSwitch between Butterworth and FIR
Mirror toggleEnable mirror padding to reduce edge artifacts
Multi-conditionCompare filter effects across conditions side-by-side

What You'll Learn

  1. Launching the GUI for a single ERP

  2. Focusing on a specific channel

  3. Comparing filter effects across multiple conditions

Code Examples

Show Code
julia
# Demo: ERP Filter GUI
# Shows how to launch the interactive filter exploration tool
# to compare the effect of different filter settings on ERP waveforms.

using EegFun
# Note: EegFun.example_path() resolves bundled example data paths.
# When using your own data, simply pass the file path directly, e.g.:
# dat = EegFun.read_raw_data("/path/to/your/data.bdf")

#######################################################################
# LOAD DATA AND CREATE ERPS
#######################################################################

dat = EegFun.read_raw_data(EegFun.example_path("data/bdf/example1.bdf"))
layout = EegFun.read_layout(EegFun.example_path("layouts/biosemi/biosemi72.csv"))
EegFun.polar_to_cartesian_xy!(layout)
dat = EegFun.create_eegfun_data(dat, layout)

# Some minimal preprocessing (average reference and highpass filter)
EegFun.rereference!(dat, :avg)
EegFun.highpass_filter!(dat, 0.5)

# EPOCHS
epoch_cfg = EegFun.EpochCondition(name = "ExampleEpoch1", trigger_sequences = [[1]])
epochs = EegFun.extract_epochs(dat, epoch_cfg, (-0.5, 1.0))

# Create ERP
erp = EegFun.average_epochs(epochs)

# interactive GUI with sliders for cutoff, order, method
EegFun.plot_erp_filter_gui(erp)

See Also