Signal processing

Cedalion’s signal processing modules cover the full preprocessing pipeline for continuous-wave fNIRS data. A typical workflow proceeds in this order:

  1. Quality assessment (cedalion.sigproc.quality) — compute channel-level quality metrics (scalp coupling index, SNR, peak-power ratio), build boolean masks, and prune channels that fail quality thresholds.

  2. CW fNIRS conversions (cedalion.nirs.cw) — convert raw light intensities to log-ratio optical density changes — apply the modified Beer-Lambert law to obtain HbO and HbR concentration changes, etc. Note that (cedalion.nirs.fd) and (cedalion.nirs.td) also exist but are currently limited to reading/writing SNIRF files.

  3. Motion artefact correction (cedalion.sigproc.motion) — detect and correct motion-induced spikes and baseline shifts using methods such as TDDR, CBSI, and wavelet-based artefact rejection.

  4. Temporal filtering (cedalion.sigproc.frequency) — apply band-pass or low-pass filters to remove cardiac noise, high-frequency interference, and slow drifts.

  5. Physiological signal extraction (cedalion.sigproc.physio) — functions for regression or advanced analysis of systemic physiological fluctuations (cardiac, respiratory, vasomotor).

  6. Epoching (cedalion.sigproc.epochs) — extract stimulus-locked trial segments from the continuous timeseries.

The cedalion.sigproc.tasks module provides high-level @task-decorated wrappers for each step that operate directly on a Recording object.

cedalion.nirs

Functionality to process NIRS data.

cedalion.nirs.cw

Functionality for continous wave NIRS.

cedalion.nirs.fd

Functionality for frequency-domain NIRS.

cedalion.nirs.td

Functionality for time-domain NIRS.

cedalion.sigproc.epochs

Extract epochs from a time series based on stimulus events.

cedalion.sigproc.frequency

Frequency-related signal processing methods.

cedalion.sigproc.motion

Various algorithms for motion correction of fNIRS data.

cedalion.sigproc.quality

Signal quality metrics and channel pruning functionality.

cedalion.sigproc.physio

Algorithms for handling physiogical components in fNIRS data.

Examples