physioex.data.FixedLength#

class physioex.data.FixedLength(seconds, fill=0.0)[source]#

Bases: PreprocessingStep

Pad the END with fill or truncate the END to a fixed length.

len(y) == round(seconds * fs_in). The output length depends on the input sampling rate only, so the sampling rate is unchanged.

Parameters#

secondsfloat

Target signal length in seconds (e.g. 36000 = 10 h).

fillfloat

Value used when padding (default 0.0).

__init__(seconds, fill=0.0)[source]#
Parameters:

Methods

__init__(seconds[, fill])

compile(fs_in[, header])

Precompute any expensive state and return a callable specialized for fs_in.

spec()

Return canonical, hashable text repr.

compile(fs_in, header=None)[source]#

Precompute any expensive state and return a callable specialized for fs_in.

header is an optional per-channel metadata dict (physical dimension, physical min/max, …) forwarded to steps that declare they need it (needs_header attribute, e.g. PhysicalScale). Steps that ignore it simply do not read it; the signature default keeps every existing compile(fs) call site working.

Parameters:
Return type:

CompiledStep

spec()[source]#

Return canonical, hashable text repr.

Format: ClassName(key1=val1,key2=val2,…) with sorted keys, floats normalized via f’{float(v):.10g}’.

Return type:

str

Parameters: