SignalWhitening¶
Perform a whitening (sphering) transform of the signal.
This can yield better data alignment across subjects and studies. 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.2.0
Ports/Properties¶
data¶
Data to process.
regularization¶
Shrinkage regularization strength. Larger values yield more conservative (but less adapted) whitening transforms. Typically only a very small value (e.g., 0.001) is necessary to avoid degenerate solutions.
robust¶
Perform robust estimation.
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.
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.
emit_calib_data¶
Emit the data buffer that was used for calibration, after calibration is complete, in a single chunk. If False, this filter will discard the calibration data. Since this chunk can be quite long, it is often preferable to discard it in a real-time pipeline, but if subsequent nodes need to see the processed calibration data to calibrate themselves (quite likely the case), it needs to be emitted.
subtract_mean¶
Subtract the mean from the data.
riemannian¶
Perform Riemannian average. This will take a riemannian average over successive covariance matrix estimates.
block_size¶
Block size. Used for the riemannian method, as well as the robust method. For riemannian, this should be at least on the order of the number of channels, and the lower it is, the more regularization is needed.
use_pseudoinverse¶
Use pseudoinverse method. This will work if data is rank-deficient even when the regularization parameter is set to 0.
store_matrices¶
Store transform matrices in packet properties.
apply_model_to_all_streams¶
If a loaded whitening model contains exactly one stream, apply that model to other stream names as well when no stream-specific model is available. This only affects model application and does not rename or duplicate the stored model entries.
offline_use_all¶
If init_on is specified and processing offline data, then setting this True will use all data to calculate the whitening transform. The data will be processed chunk-by-chunk with chunk size and the first chunk determined by init_on.
offline_cores¶
Number of cores to use to calculation covariance matrices of chunked input, when offline_use_all is set. Set to 0 or 1 to disable multiprocessing, set to a larger integer to use that many, or set to -1 to use all available CPUs.
segsize¶
Set the total number of samples (space x time) per segment of the output signal on which the spatial filter is applied. 0 (default) will use all samples, but this may run out of memory for long signals. Any other positive value will be rounded up to the next factor of the time axis length. Set to -1 to skip applying the spatial filter altogether, useful if all that is desired is the sphering and covariance matrices.
constrain¶
Constrain whitening. This is currently mostly to mimic other forms of scale standardization for comparison purposes. none applies no constraints and results in full (regular) whitening. diag constrains the covariance matrix to a diagonal matrix and results in per-channel scaling. Univariate additionally locks all channels to receive the same scale, and is thus equivalent to multiplying by a scalar.
ignore_resets¶
Ignore state resets.
initialize_once¶
Initialize (adapt state parameters) only once. If False, this node will recalibrate itself on any qualifying chunk (based on the setting of adapt on streaming chunks).
use_caching¶
Enable caching.
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.