Skip to content

← signal_processing package

PruneFlatlineChannels

Prune channels that flat-line for extended periods of time in the calibration data.

Note that it is enough for a channel to flat-line for only a few seconds at a time to be considered a flat-lining channel (since such channels can cause adaptive filters to break). If this filter is used on streaming data and has not yet been calibrated, then it will first buffer n seconds of calibration data to determine some statistics, before any output is produced. Version 1.0.3

Ports/Properties

data

Data to process.

verbose name
Data
default value
None
port type
DataPort
value type
Packet (can be None)
data direction
INOUT

diagnostic

Diagnostic Information.

verbose name
Diagnostic
default value
None
port type
DataPort
value type
Packet (can be None)
data direction
OUT

max_duration

Maximum allowed flat-line duration, in seconds. If a channel has a longer flatline than this, it will be removed. In seconds. You can pass infinity or a very large number to require that a channel must be flat the whole time.

verbose name
Max Duration
default value
5
port type
FloatPort
value type
float (can be None)

max_jitter_rel

Allowed relative jitter. This is relative to the absolute signal value. If a channel has lower jitter than this in a time window, it is considered a flatline.

verbose name
Max Relative Jitter
default value
1e-05
port type
FloatPort
value type
float (can be None)

max_jitter_abs

Allowed absolute jitter. If a channel has lower jitter than this in a time window, it is considered a flatline.

verbose name
Max Absolute Jitter
default value
1e-05
port type
FloatPort
value type
float (can be None)

init_on

Time range to calibrate (initialize) the filter on. This parameter can take a single number or two numbers. In case of streaming data, this should always be a single number, representing the number of seconds to buffer from the start of the data, for calibration. In case of offline (recorded) data, this can either be a single number, in which case it represents the window of time in seconds from the beginning of the recording to be used; or, it can be a list of two numbers, in which case this refers to a range of data in seconds, relative to the start of the data, to be used for calibration. The latter allows you to calibrate on data other than the first segment of the data (i.e., if known to be bad), or to avoid running the (fairly expensive) filter on a very long file or on each fold of a cross-validation. Note that a value of 0 here will in the case of offline data be interpreted as the entire file, and in the case of streaming data will raise an error.

verbose name
Calibration Range
default value
[]
port type
ListPort
value type
list (can be None)

calib_seconds

Amount of data, in seconds, to buffer for calibration on streaming data. For offline (non-streaming) data use the "calibration range" (init_on) parameter instead.

verbose name
Calib Seconds
default value
20
port type
IntPort
value type
int (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)