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,
filtfiltvsfilt
Key Features
| Feature | Description |
|---|---|
| Lowpass / Highpass toggles | Enable each filter independently |
| Cutoff sliders | Adjust frequency in real time |
| Order sliders | Change filter steepness |
| Method menu | Switch between Butterworth and FIR |
| Mirror toggle | Enable mirror padding to reduce edge artifacts |
| Multi-condition | Compare filter effects across conditions side-by-side |
What You'll Learn
Launching the GUI for a single ERP
Focusing on a specific channel
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)