EEG signal processing with the parameters kept next to the output

Filtering, referencing, resampling and normalization, each writing a named stage that carries the settings it ran with — so a downstream result can always be traced back to the conditioning that produced it.

Signal conditioning is where the most consequential and least documented choices in an EEG study get made. A high-pass at 0.5 Hz and one at 1 Hz produce different ERPs; a scaler fitted before the train/test split produces a different accuracy than one fitted after. Neither difference shows up in a results table.

BCILattice treats conditioning as a stage rather than a preamble. Each operation writes a named output, carries its parameters with it, and leaves the input intact — which is what makes the difference between two filter settings something you can measure instead of something you argue about.

Conditioning operations by modality

The recommended habit is conservative: start with the least aggressive setting that makes the signal readable, and document every step away from it. The stage record does the documenting for you.

SignalUseful starting operations
EEGBandpass, notch, resampling, average reference, ICA where justified.
fNIRSOptical density, Beer-Lambert conversion, motion correction, short-channel regression.
EMGBandpass, rectification, envelope extraction, RMS envelope.

Bands that match the signal, not a default

Band definitions are presets per modality rather than one EEG-shaped set applied to everything. The fNIRS preset covers vlf (0.005–0.02 Hz), hemodynamic (0.01–0.08), Mayer (0.08–0.12), respiratory (0.2–0.4) and cardiac (0.8–1.5) — the higher bands being the physiological confounds you want to be able to measure rather than assume away.

The EMG preset covers low (20–50 Hz), mid (50–100), high (100–250) and very high (250–450). Sampling rate is always read from the loaded recording metadata rather than assumed, which is what keeps a roughly 10 Hz fNIRS file from being processed as if it were 250 Hz EEG.

Where conditioning turns into leakage

Normalization fits a scaler once over the whole recording. That is the right behaviour for a stage whose job is to make a signal comparable across channels — and the wrong thing to do with a scaler, feature selector or dimensionality reducer that will inform a model evaluation.

The documentation is explicit about it, and the Results validation tab flags it: fitting any of those on the full dataset before splitting inflates the score you report. A grouped split scores lower than a random one for the same reason, and the lower number is the honest one.

From conditioned signal to spectral features

Eighteen frequency-domain feature families are extractable directly: absolute, relative and log band power, band peak frequency, total power, mean and median frequency, spectral edge frequency, entropy, centroid, bandwidth, skewness, kurtosis, rolloff, flatness, slope, and the band-power ratios — theta/beta, alpha/beta and the engagement index.

Nine more sit in the time-frequency domain: wavelet sub-band energy and entropy, wavelet coefficient statistics, ERD/ERS, windowed band power, Hilbert envelope statistics, instantaneous frequency and time-frequency entropy.

Questions

Can I compare two filter settings without redoing the study?

Yes. Each conditioning run writes its own named stage rather than overwriting the input, so two settings can exist side by side in the same project and be carried through to two results.

Is the filtering the same as MNE?

The underlying processing is built on the standard Python scientific stack — MNE, NumPy, SciPy and scikit-learn among them — so the numerical behaviour is what a Python EEG pipeline would produce, with the parameters exposed in a UI instead of a call signature.

How do I avoid data leakage in the evaluation?

Do not fit scalers, feature selectors or dimensionality reduction on the full dataset before splitting, and use a grouped split when the same subject contributes many trials. The Results validation tab checks the design and states which comparisons it supports.

Does it handle non-EEG sampling rates correctly?

Yes. Every step derives the sampling rate from the loaded recording metadata rather than assuming an EEG-style rate, which is what makes a roughly 10 Hz fNIRS recording process correctly.

Read the reference

Related

Run a study end to end, on your own machine

The free plan covers two studies, the full analysis suite, and 118 of the 119 ML blocks.