Skip to content

Denoise a recording

Question

What signal remains after removing noise?

See every package-generated example · Read the complete analysis pipeline

When to use

Use this to suppress noise while retaining the underlying sampled trace.

Example figure

Denoise a recording output generated by Circadian Workbench

This deterministic example is calculated by the denoise action and drawn by render_denoise_svg, the same renderer used for publication export. Empty or withheld elements are therefore visible exactly as they are in a real result.

import circadian_workbench as cw

cw.call("denoise", recording={"path": "mouse01.awd"})

Required inputs and controls

The public function is the registered action below. settings= is accepted as a friendlier alias for config= by cw.call; the calculation stores the complete normalized config in provenance.

Function reference

cw.call("denoise", recording, config=None, ssa_window_hours=24.0, ssa_components=2)

Arguments and parameters

Name Type Required Default Units Meaning
recording recording spec yes — - The record to analyse: {'path': 'data/m01.awd'} (a bare path string also works), {'demo': true} for the built-in deterministic record, {'inline': {'filename': ..., 'text': ...}} for tabular text, {'trace': {'hours': [...], 'values': [...], 'name': ...}} for one elapsed-time trace, or {'channels': {'hours': [...], 'values': {'reporter_a': [...], 'reporter_b': [...]}}} for several measurements from one subject. A returned processed_trace spec retains transformed values, their original clock, source identity and explicit processing history. Versioned recording_snapshot specs are self-contained numeric inputs for replaying in-memory Recording objects; they do not invoke a raw-activity importer.
config object no null - Partial scientific settings. Omitted or None values use the shared installed defaults; invalid fresh values are rejected. Run describe_config for names, meanings, units, bounds and choices. Explicitly load old saved mappings with load_saved_settings to report compatibility conversions.
ssa_window_hours float no 24.0 hours Singular spectrum embedding window; each uninterrupted segment needs at least twice this many samples.
ssa_components integer no 2 count Leading singular components retained during diagonal reconstruction.

Every nested config key, default, allowed value, and purpose is listed in the complete configuration reference.

How it works

The chosen denoising method acts on valid segments and preserves missing samples.

$$ y_{\mathrm{clean}}=D(y) $$

Implementation: analysis.py::denoise.

Outputs and interpretation

The result contains original and processed values, method settings and segment coverage.

cw.call returns a Result: use .data for calculated values, .warnings for scientific qualifications, .provenance for version and input identity, .script for an equivalent replay script, and .files for saved outputs.

Limitations

Smoothing can remove brief biological events as well as noise; compare with the original.

Example

The figure above is a real package result from a seeded, redistributable synthetic dataset. The flat gallery bundle retains figure_data_denoise.csv, a standalone plot_denoise.py, source hashes, an editable SVG, and a rendered preview.

Methods text

The selected denoiser was applied to valid recording segments and missing data were preserved.

See also

Remove a slow trend · Scale a recording · Analysis index · Gallery