Skip to content

radiens_core.models.dsp

Digital Signal Processing (DSP) domain models and enums.

Attributes

FlexDSPParams module-attribute

FlexDSPParams = DSPParams | DSPParamsDict

DSPParams that also accepts a :class:DSPParamsDict typed-dict shorthand.

When used in set_dsp_group, the stage key is optional — the method injects it from its own stage= argument if omitted.

Example::

client.set_dsp_group(stage="stage1", params=[{"type": "highpass", "freq": 300.0}])

FlexDSPType module-attribute

FlexDSPType = DSPType | DSPTypeStr | int

DSPType that also accepts a string name or int value.

FlexFilterStage module-attribute

FlexFilterStage = FilterStage | FilterStageStr | int

FilterStage that also accepts a canonical string name or int index.

Use with @validate_call or pass to _coerce_filter_stage() for manual coercion::

stage_enum: FilterStage = _coerce_filter_stage(stage)

Classes

DSPGroup

Bases: BaseModel

Group of DSP filter stages, organized by hardware/software layers.

Attributes:

Name Type Description
hardware list[DSPParams]

List of hardware filter stages.

software_stage1 list[DSPParams]

List of software stage 1 filters.

software_stage2 list[DSPParams]

List of software stage 2 filters.

spike_sorter list[DSPParams]

List of spike sorter filters.

DSPParams

Bases: BaseModel

Configuration parameters for a single DSP filter stage.

Attributes:

Name Type Description
type DSPType | DSPTypeStr

DSP filter type. References DSPType. Also accepts string names (e.g. "highpass").

stage FilterStage | FilterStageStr | int

DSP filter stage. References FilterStage. Also accepts string names or int index.

freq float | None

Filter frequency. Defaults to None.

freq_spec_band FreqSpecBand | None

Frequency band specification. Defaults to None.

ref_ntv_chan_idx int | None

Reference native channel index. Defaults to None.

notch_bandwidth float | None

Notch filter bandwidth. Defaults to None.

user_label str

User-defined label for the filter. Defaults to "".

port Port | PortStr | int | None

Port configuration. References Port. Also accepts string name or int index. Defaults to None.

target_ntv_chan_idx float | None

Target native channel index. Defaults to None.

is_aux bool

Whether this is an auxiliary filter. Defaults to False.

aux_chan_idx int | None

Auxiliary channel index. Defaults to None.

filter_order int | None

Filter order. Defaults to None.

zero_phase bool

Whether to use zero-phase filtering. Defaults to False.

force_sos bool

Whether to force Second-Order Sections. Defaults to False.

DSPParamsDict

Bases: TypedDict

Typed dict shorthand for :class:DSPParams.

The type key is required; all other keys are optional. stage is injected from the calling method's stage= argument if omitted.

Example::

{"type": "highpass", "freq": 300.0}
{"type": "bandpass", "freq_spec_band": {"low_freq": 300.0, "high_freq": 5000.0}}

DSPType

Bases: IntEnum

Digital Signal Processing filter type. Values match proto common.DSPType.

FilterStage

Bases: IntEnum

Digital Signal Processing filter stage. Values match proto common.FilterStage.

FreqSpecBand

Bases: BaseModel

Frequency band specification for filters.

Attributes:

Name Type Description
low_freq float

Low frequency in Hertz.

high_freq float

High frequency in Hertz.