Module: signal_processing

Signal processing algorithms.

Most of these nodes require that the inbound data has a time axis, and some require that the data also has a space axis (i.e., channels). Some nodes will adapt themselves initially, and will buffer a certain amount of data for this; such nodes will also generally adapt themselves upon chunks that are marked as non-streaming unless the initialize_once parameter (if present) is set to True.

AlignStreams

Align several streams in time domain by comparing timestamps between streams, by trimming the streams to be of equal length if they have different start and end times.

Trims data before the latest start time (across all streams) as well as the data after the earliest end time (across all streams).

Version 1.0.0

Ports/Properties

  • 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)
  • data1
    Input data 1.

    • verbose name: Data1
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • data2
    Input data 2.

    • verbose name: Data2
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • data3
    Input data 3.

    • verbose name: Data3
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • data4
    Input data 4.

    • verbose name: Data4
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • data5
    Input data 5.

    • verbose name: Data5
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • data6
    Input data 6.

    • verbose name: Data6
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • data7
    Input data 7.

    • verbose name: Data7
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • data8
    Input data 8.

    • verbose name: Data8
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • data9
    Input data 9.

    • verbose name: Data9
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • data10
    Input data 10.

    • verbose name: Data10
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • outdata
    Output data.

    • verbose name: Outdata
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: OUT
  • standardize_packet_length
    Make sure that all packets are exactly the same length. This will trim all packets to the shortest packet length.

    • verbose name: Standardize Packet Length
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)

AlignWindows

Takes two packets with windows of different lengths and lines up the signals relative to the start of the window by trimming the data that falls outside of the max timestamp at the start of the packet and the min timestamp at the end of the packet.

Will optionally (default=True) also trim all packets to the same length (to account for rounding during the first trim.) Also performs a ShiftTimestamps to account for filter lag.

Version 1.0.0

Ports/Properties

  • 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)
  • data1
    Data input 1.

    • verbose name: Data1
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • data2
    Data input 2.

    • verbose name: Data2
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • standardize_packet_length
    Make sure that all packets are exactly the same length. This will trim all packets to the shortest packet length.

    • verbose name: Standardize Packet Length
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • shift_timestamps
    Run ShiftTimestamps to account for filter lag before alignment. Set to false if you've already run this node for all the incoming packets.

    • verbose name: Shift Timestamps
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)

ApplyLinearTransformation

Calculate the dot product of the data tensor with a filters tensor.

The data and filters tensor must both have an axis of the same type and size. This node may be used to apply to these data a spatial filter that was calculated elsewhere.

Version 0.1.0

Ports/Properties

  • 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)
  • filters
    The model through which the data will be transformed.

    • verbose name: Filters
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis along which to align data and filter tensors.

    • verbose name: Transform Along Axis
    • default value: space
    • port type: EnumPort
    • value type: object (can be None)

CombineChannels

Combine the given channels into new channels.

This node can be used to average multiple channels together into new channels (can also sum, take the max, etc.). Can be used, for instance, to merge region-of-interest activations.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • mapping
    Grouping of old channels into new channels. The syntax is {'new_channel1': [index0, index1, ...], 'new_channel2': [index3, index4, index5, ...], ...} where 'new_channelX' are examples of two new channel names being defined, and the indexX terms stand for where you list the old channels from which each new channel would be formed, given as numeric indices (counting from 0), or the name of the old channel (which may optionally contain asterisk wildcards). Example: {'mychan': [0,1,2], 'myotherchan': ['oldchanA','oldchanB','oldchanC']}.

    • verbose name: Channel Grouping
    • default value: None
    • port type: Port
    • value type: object (can be None)
  • operation
    Operation to perform on the old channel data to form the new channel.

    • verbose name: Combine Operation
    • default value: average
    • port type: EnumPort
    • value type: object (can be None)
  • write_back
    Define how new channels get written back into the list of channels. Replace-selected means that the selected old channels will be replaced by the new channels, replace-all means that only the new channels will be in the output, and append means that the new channels will be appended at the end.

    • verbose name: Write-Back Mode
    • default value: replace-selected
    • port type: EnumPort
    • value type: object (can be None)
  • ignore_nans
    If activated the channels containing nan values are ignored.

    • verbose name: Ignore Channels With Nan Values
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • support_wildcards
    Support wildcard matches in mapping. If enabled, then the old channel names in the mapping can be strings containing wildcards, such as 'FP*'.

    • verbose name: Support Wildcards
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

CumulativeAverage

Calculate the cumulative average of the data over time.

This node does not change the shape or axes of the signal, but each value will be replaced by the average of values up to that point. Note that this node maintains internal state. Also, this node assumes that the data has a time axis.

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • ignore_nans
    If enabled, nan values are skipped.

    • verbose name: Ignore Nan Values
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

CumulativeSum

Calculate the cumulative sum of the data over the specified axis.

This node does not change the shape or axes of the signal, but each value will be replaced by the sum of values up to that point. Note that this node maintains internal state (is not reset with every pass). nan values are ignored.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Calculate the cumulative sum over this axis.

    • verbose name: Axis
    • default value: time
    • port type: EnumPort
    • value type: object (can be None)

Decimate

Decimate (subsample) the signal by an integer factor.

This filter implements no anti-aliasing filter -- that is, you need to precede this filter by a low-pass filter (e.g., FIR or IIR) which cuts out below half of the new sampling rate. Important: If no anti-aliasing filter is used, then frequency content above the new sampling rate will be mirrored and appear as additional noise in the resampled signal. If this filter is ran along the time axis, it will maintain an internal state to ensure that every k'th sample is picked even across chunk boundaries.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • factor
    Decimation factor. Only every k'th data value will be transferred into the output.

    • verbose name: Decimate By Factor
    • default value: 2
    • port type: IntPort
    • value type: int (can be None)
  • axis
    Axis along which to decimate.

    • verbose name: Decimate Along Axis
    • default value: time
    • port type: EnumPort
    • value type: object (can be None)

DelayEmbedding

Perform delay embedding of the given signal.

This will add a new axis of type LagAxis to the data, which has n copies of the signal, each delayed by the respective n'th lag in samples. This axis can subsequently be folded into other axes using the Fold Into Axis node. One use of this filter is to convert filters that regularly combine multiple channels into filters that combine both channels and time points (i.e., to turn spatial filters into spatio-temporal filters). An example is to turn Common Spatial Patterns (CSP) into Common Spatio-Spectral Patterns (CSSP) by preceding CSP with a delay embedding node.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • lags
    Lags to use. This is a list of positive offsets, in samples, referring to past samples.

    • verbose name: Lags
    • default value: [0, 1, 2, 3]
    • port type: ListPort
    • value type: list (can be None)

Detrend

Remove trends from the given data.

For instance, linear slopes or constant offsets. Important: when detrending along time, note that this filter detrends each chunk separately -- on streaming data, these chunks can be very short and have variable length, so you almost certainly want to do this on extracted segments (see, e.g., Segmentation node for how to do this).

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • method
    Type of trend to remove. Constant will remove constant offsets, and linear will remove linear slopes.

    • verbose name: Type Of Trend
    • default value: linear
    • port type: EnumPort
    • value type: object (can be None)
  • axis
    Axis along which to remove trends. For instance, using frequency here means that linear slopes along the frequency axis will be removed (if the data has a frequency axis). Rarely anything other than 'time' is used here.

    • verbose name: Detrend Along Axis
    • default value: time
    • port type: EnumPort
    • value type: object (can be None)

ExponentialMovingAverage

Smooth the given data using an exponentially decaying window.

This filter outputs a weighted average of the past data, where more recent sampeles are weighted more strongly. The time constant of this exponential weighting is an adjustible parameter. This filter is meant to be run on continuous data. Therefore, it should not be preceded by a Segmentation node. This node maintains internal state.

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • forget_halftime
    Half-life time constant of filter, in seconds. Data that lies this many seconds in the past will be weighted half as much as the most recent data when designing the filter, and data twice as old will be weighted by 1/4, etc. Can also be thought of as the half-life of the weights for an exponentially weighted filter.

    • verbose name: Adaptive Filter Half-Life Constant
    • default value: None
    • port type: FloatPort
    • value type: float (can be None)
  • e_folding_time
    The e-fold time constant of filter , in seconds. Data that lies this many seconds in the past will be weighted 1/e as much as the most recent data when designing the filter.

    • verbose name: Adaptive Filter E-Folding Time Constant
    • default value: None
    • port type: FloatPort
    • value type: float (can be None)

ExponentialStandardization

Standardize the given data using an exponentially decaying window.

This filter aims to produce standardized output signals (that is, each channel has approximately mean zero and variance one). This is based on the statistics of the past data, where more recent data is weighted more strongly. The time constant of this exponential weighting is an adjustible parameter. This filter is meant to be run on continuous data. That is, it should not be preceded by a Segmentation node.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • forget_halftime
    Time constant of filter, in seconds. Data that lies this many seconds in the past will be weighted half as much as the most recent data when designing the filter, and data twice as old will be weighted by 1/4, etc. Can also be thought of as the half-time of an exponentially weighted filter.

    • verbose name: Adaptive Filter Time Constant
    • default value: 60
    • port type: FloatPort
    • value type: float (can be None)
  • ignore_nans
    If activated the channels containing nan values are ignored.

    • verbose name: Ignore Channels With Nan Values
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • collapse_axes
    Collapse the other axes except the time axis.

    • verbose name: Collapse Axes
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • across_all_chs
    If activated the standardization is performed across all channels, ie., the mean and standard deviation is averaged over all channels.

    • verbose name: Standardize Across All Channels
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

FIRFilter

Apply FIR filter to signal.

Together with the IIR filter, this is one of the two default ways to select or remove frequency bands in a signal. The FIR filter delays the signal more than the IIR filter, but has less signal phase distortion in the region between passband (retained frequencies) and stopband (suppressed frequencies); however, the FIR filter is more CPU intensive for the same amount of filtering, especially when the low cutoff frequencies are being used. This filter maintains internal state to filter seamlessly across chunk boundaries. On the first few samples the filter will exhibit some minor artifacts, but is initialized to have minimal step response.

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis along which to filter. Rarely anything other than 'time' is used here.

    • verbose name: Filter Along Axis
    • default value: time
    • port type: EnumPort
    • value type: object (can be None)
  • order
    Filter order. If unspecified, this will be auto-determined based on the tightness of the transition bands and the desired stopband attenuation (using the Kaiser window rule). Note that high orders (e.g., 1000 or greater) will be fairly heavy on the CPU, especially with many channels.

    • verbose name: Filter Order
    • default value: None
    • port type: IntPort
    • value type: int (can be None)
  • frequencies
    Transition frequencies. For a lowpass/highpass filter, you can either give the cutoff frequency, or two freqencies to determine the rolloff curve. For a bandpass/bandstop filter, you can give two cutoff frequencies, or 4 frequencies to determine the rolloff curve. The syntax for 'free-form' filters is [(frequency1, gain1), (frequency2, gain2), ...], and you can use the special frequency value -1 as a stand-in for the highest frequency at which a filter can be designed for the given sampling rate (the signal's Nyquist frequency).

    • verbose name: Frequencies
    • default value: [0.25, 0.5, 45, 50]
    • port type: ListPort
    • value type: list (can be None)
  • mode
    Filter mode. Low/highpass lets low/high frequencies through, bandpass lets frequencies in a limited band through, and bandstop (a.k.a. notch) removes frequency in a limited band. The freeform mode (rarely used) can design arbitrary filters by specifying frequencies in the spectrum and corresponding desired gain factors.

    • verbose name: Filter Mode
    • default value: bandpass
    • port type: EnumPort
    • value type: object (can be None)
  • minimum_phase
    Design minimum-phase filter. If enabled, a filter with minimum signal delay will be designed, which will distort the signal phases, especially in the transition region. If disabled, a linear-phase filter will be designed, which will not distort the signal at all, but which incurs a delay of half the filter order in samples.

    • verbose name: Minimum Phase
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • antisymmetric
    Design antisymmetric filter. This designs rarely-used / special-purpose filters for signal differentiation or 90 degree phase shifting.

    • verbose name: Antisymmetric
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • stop_atten
    Minimum attenuation in stopband. This is the minimum acceptable attenuation, in dB, in the stopband, which is ideally infinitely suppressed, but in practice 30-80 dB are enough, depending on the amplitudes of the signals to attenuate.

    • verbose name: Min Stopband Attenuation
    • default value: 50.0
    • port type: FloatPort
    • value type: float (can be None)
  • convolution_method
    FIRFilter coefficients can be convolved with the input signal using multiple methods. The standard method performs time-domain convolution. For long signals (>214 samples) using filters with a modest number of coefficients (>24), it can be faster to do the convolution in the frequency domain using the overlap-add method.

    • verbose name: Method Of Convolution
    • default value: standard
    • port type: EnumPort
    • value type: object (can be None)
  • cut_preringing
    Cut off the pre-ringing portion generated by the filter. This is currently only supported in linear-phase mode and offline.

    • verbose name: Cut Preringing
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

FixGaps

Fix up data gaps in time series.

This node can be used to perform some basic "repairs" of gaps in time-series data to mitigate erratic behavior of later-stage processing nodes, such as filters and other signal processing. When a gap occurs in a time series, it means that a piece of signal is missing. If one were to stitch the data together as if the gap did not happen, then at the very least there will be jump in signal level, which causes filter "ringing" artifacts. This node can be used to correct level jumps by shifting the subsequent data by the correct amount. The node can also be used to rewrite the time stamps to make the gap undetectable to subsequent nodes. Note that this is not necessarily a good thing, since it can result in data being apparently co-located that may have been separated by an arbitrarily long stretch of data -- however, doing so will prevent "hard failures" where an algorithm would otherwise refuse to to run due to it not being able to handle gaps.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • stitch_level_jumps
    Whether to fix level jumps by moving the time series following a gap up or down to match the signal level.

    • verbose name: Stitch Level Jumps
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • squeeze_time_gaps
    Whether to squeeze out gaps in the time stamps, making the time series appear continuous.

    • verbose name: Squeeze Time Gaps
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • gap_threshold
    Gap length in seconds above which the stitcher kicks in.

    • verbose name: Gap Threshold
    • default value: 0.1
    • port type: FloatPort
    • value type: float (can be None)

FrequencyNormalization

Correct for 1/f frequency falloff.

The frequency spectrum of the given data will be multiplied by its repective frequencies to correct for the typical 1/f falloff curve observed in spectral energy from natural sources. This filter will only process chunks that have a frequency axis (i.e., after transform into the spectral domain).

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • alpha
    The exponent of 1/f^alpha used in the correction. Set to None to determine the value automatically.

    • verbose name: Alpha
    • default value: 1.0
    • port type: FloatPort
    • value type: float (can be None)
  • fit_frequency_range
    Fit the spectra between these frequency ranges to calculate alpha value. Default: all frequencies.

    • verbose name: Fit Frequency Range
    • default value: None
    • port type: ListPort
    • value type: list (can be None)

IIRFilter

Apply IIR filter to signal.

Together with the FIR filter, this is one of the two default ways to select or remove frequency bands in a signal. The IIR filter delays the signal less than the FIR filter, at the cost of increased signal phase distortion, especially in the region between passband (retained frequencies) and stopband (suppressed frequencies). The IIR filter is also less CPU intensive for the same amount of filtering. This filter maintains internal state to filter seamlessly across chunk boundaries. On the first few samples the filter will exhibit some minor artifacts, but is initialized to have minimal step response. Note that filter instability is not a concern with this implementation, since it is realized as a cascade of second-order sections (or biquads), rather than a simple direct-form I or II filter design.

More Info...

Version 1.1.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis along which to filter. Rarely anything other than 'time' is used here.

    • verbose name: Filter Along Axis
    • default value: time
    • port type: EnumPort
    • value type: object (can be None)
  • order
    Filter order. If unspecified, this will be auto-determined based on the tightness of the transition bands and the desired attenuation strength, except for the 'freeform' filter mode and the 'Bessel' filter design, where it must be given. A larger order (e.g., 8 or higher) will result in larger signal delay, but can handle steeper and more complex frequency responses.

    • verbose name: Filter Order
    • default value: None
    • port type: IntPort
    • value type: int (can be None)
  • frequencies
    Transition frequencies. For a lowpass/highpass filter, you can either give the cutoff frequency, or two freqencies to determine the rolloff curve. For a bandpass/bandstop filter, you can give two cutoff frequencies, or 4 frequencies to determine the rolloff curve. The syntax for 'free-form' filters is [(frequency1, gain1), (frequency2, gain2), ...], and you can use the special frequency value -1 as a stand-in for the highest frequency at which a filter can be designed for the given sampling rate (the signal's Nyquist frequency).

    • verbose name: Frequencies
    • default value: [0.1, 0.5, 45, 50]
    • port type: ListPort
    • value type: list (can be None)
  • mode
    Filter mode. Low/highpass lets low/high frequencies through, bandpass lets frequencies in a limited band through, and bandstop (a.k.a. notch) removes frequency in a limited band. The freeform mode (rarely used) can design arbitrary filters by specifying frequencies in the spectrum and corresponding desired gain factors.

    • verbose name: Filter Mode
    • default value: bandpass
    • port type: EnumPort
    • value type: object (can be None)
  • design
    Filter design rule to use. A Butterworth filter has a flat passband response, Chebychev Type-I has a steeper rolloff than Butterworth at the expense of larger passband ripples, and Chebychev Type-II also has steeper rolloff but larger stopband ripples. The Elliptic filter has maximally steep rolloff at the cost of larger ripple in both stopband and passband. The Bessel filter has a maximally linear phase response, meaning that the signal in the rolloff region is least distorted. For a freeform filter, the Yule-Walker method is always used and the design parameter is ignored.

    • verbose name: Filter Design
    • default value: butter
    • port type: EnumPort
    • value type: object (can be None)
  • pass_loss
    Maximum attenuation in passband. This is the maximum amount of signal attenuation, in dB, that is tolerated in the passband (which is ideally flat, i.e., 0 dB deviation).

    • verbose name: Max Passband Attentuation
    • default value: 3.0
    • port type: FloatPort
    • value type: float (can be None)
  • stop_atten
    Minimum attenuation in stopband. This is the minimum acceptable attenuation, in dB, in the stopband, which is ideally infinitely suppressed, but in practice 30-80 dB are enough, depending on the amplitudes of the signals to attenuate.

    • verbose name: Min Stopband Attenuation
    • default value: 50.0
    • port type: FloatPort
    • value type: float (can be None)
  • ignore_nans
    If activated the channels containing nan values are ignored.

    • verbose name: Ignore Channels With Nan Values
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • offline_filtfilt
    If the signal is not streaming (i.e ., offline), then perform a zero-phase filtfilt operation.

    • verbose name: Offline Filtfilt
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

InfomaxICA

Compute an ICA solution on calibration data and subsequently transform data into component space.

Note that this filter does not update itself incrementally -- once it is calibrated, the solution will remain fixed, and is used to transform both the calibration data, and any subsequent streaming data. The difference between this filter and the ICA method under the Feature Extraction category is that this one accepts a channels by time signal, and outputs a channels by time signal, whereas the other method can operate on data of any dimensionality and axes, and outputs a feature axis (which is not as readily usable if you want to chain other nodes from the filters category after it). Also, Infomax ICA is considered a higher-quality approach for EEG and MEG than the FastICA algorithm used in the other node. 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.

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • max_iters
    Number of iterations. This will determine how long it takes for the algorithm to calibrate itself once the calibration data has been collected. Lower values will result in less accurate components being learned.

    • verbose name: Number Of Iterations
    • default value: 1200
    • port type: IntPort
    • value type: int (can be None)
  • learning_rate
    Learning rate. Reduce if the algorithm diverges on your data.

    • verbose name: Learning Rate
    • default value: 0.5
    • port type: FloatPort
    • value type: float (can be None)
  • verbosity
    Verbosity level.

    • verbose name: Verbosity
    • default value: 1
    • port type: IntPort
    • value type: int (can be None)
  • calib_seconds
    Minimum amount of data to gather for calibration. When this filter is run online and has not yet been calibrated, then it will first buffer this many seconds of data in order to compute its solution before any output is produced. Note that, when you have many channels, this algorithm requires quite a bit of calibration data.

    • verbose name: Gather This Much Calibration Data
    • default value: 300
    • port type: IntPort
    • value type: int (can be None)
  • use_caching
    Enable caching. This will significantly speed up re-use of the same data.

    • verbose name: Use Caching
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • order_by_var
    Reorder components by descending variance of component activations in calibration data.

    • verbose name: Order By Var
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)

Interpolate

Interpolate the given data along a desired axis.

This node supports either interpolation at a regular rate, or at some desired sampling points (if given). The node can also be used in a real-time setting, in which case the online_lookahead should be set to a value that fits the use case. Also note that for online operation, the time domain of the data should be on NeuroPype's real time clock, which is the one used by LSLInput and OverrideTimestamps, among others.

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • new_points
    Optional list of points at which to calculate the data.

    • verbose name: New Points
    • default value: None
    • port type: DataPort
    • value type: list (can be None)
    • data direction: IN
  • axis
    Axis along which the interpolation should be applied.

    • verbose name: Interp Along Axis
    • default value: time
    • port type: EnumPort
    • value type: object (can be None)
  • sampling_rate
    Desired sampling rate. This is in number of samples per data unit to produce (e.g., for the time axis, it is in Hz) if a regular output is desired. In the online case this may also be set to 0 (irregular), which causes the node to produce exactly one output sample on each update, and therefore the effective sampling rate equals the rate with which the node is being updated.

    • verbose name: Sampling Rate
    • default value: 10
    • port type: FloatPort
    • value type: float (can be None)
  • kind
    Specifies the kind of interpolation. ‘zero’, ‘slinear’, ‘quadratic’ and ‘cubic’ refer to a spline interpolation of zeroth, first, second or third order. If specify_order is selected then the order param must also be specified (expert parameter).

    • verbose name: Kind Of Interpolation
    • default value: quadratic
    • port type: EnumPort
    • value type: object (can be None)
  • online_lookahead
    Desired lookahead for online operation. Since this node needs to see future samples for real-time use, its output will be delayed by this amount. If the gap between two successive data points exceeds this amount, there will be an observable hitch.

    • verbose name: Online Lookahead
    • default value: 2
    • port type: FloatPort
    • value type: float (can be None)
  • order
    Polynomial degree for spline interpolation. This is alternative to the values for 'kind', and orders 0 to 3 are equivalent to zero, linear, quadratic, and cubic -- kind should be set to 'specify_order'.

    • verbose name: Spline Order
    • default value: None
    • port type: IntPort
    • value type: int (can be None)
  • assume_sorted
    Assume that the data are sorted along the desired axis. It is slower to set this to False, but will work if e.g., interpolating data with jittery time stamps.

    • verbose name: Assume Sorted
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • allow_extrapolation
    You probably shouldn't use this. Extrapolation is only warranted in extreme circumstances where the data being interpolated/extrapolated is highly smoothed and the extrapolated samples are within 1/fs sec away. This might be the case if e.g. you are trying to align two time series after already using SelectRange to slice their axes to the minimum overlap.

    • verbose name: Allow Extrapolation
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

MSeq

This node generates m sequence time series for the given order (m).

The length of sequence is L = 2^m-1. It can repeat each element of sequence r times. If the parameter m-repeat is set to zero, the m sequence is not going to be repeated. The sequence can be circularly shifted for the given values in parameter m_shift.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Output reference signals

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: OUT
  • m_order
    Sequence order.

    • verbose name: M Order
    • default value: 3
    • port type: FloatPort
    • value type: float (can be None)
  • seq_shift
    The number of bits that the sequence is shifted.

    • verbose name: Seq Shift
    • default value: [0, 2, 4, 6]
    • port type: ListPort
    • value type: list (can be None)
  • bit_repeat
    The number of times that each element is repeated.

    • verbose name: Bit Repeat
    • default value: 3
    • port type: FloatPort
    • value type: float (can be None)
  • repeat_unit
    Unit in which the sequence is shifted.

    • verbose name: Unit Of Measurement For Window Length
    • default value: seconds
    • port type: EnumPort
    • value type: object (can be None)
  • seq_repeat_or_length
    The number of times that the sequence is repeated. If the Repeat unit is repeats, the sequence is repeated by the given number. If the Repeat unit is seconds, the sequence is repeated to fill the time length with the given sampling frequency. If the Repeat unit is samples, the sequence is going to have that many samples

    • verbose name: Seq Repeat Or Length
    • default value: 0.5
    • port type: FloatPort
    • value type: float (can be None)
  • fs
    The sampling frequency. This is only used if Repeat unit is time.

    • verbose name: Fs
    • default value: 500
    • port type: FloatPort
    • value type: float (can be None)

MedianFilter

Calculate a sliding-window median over the data.

This node requires that the data is a continuous time series (that is, has a time axis and is not segmented). The node works both with streaming and offline data, and replaces each value by the median of the k preceding input samples (where k is window_len worth of samples). This filter is a robust alternative to the MovingAverage filter, and can be used to e.g., track the signal drift or offset in the presence of artifacts.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • window_len
    Window length for median calculation. In seconds.

    • verbose name: Window Len
    • default value: 1
    • port type: FloatPort
    • value type: float (can be None)

MovingAverage

Smooth the signal using a moving average.

Each output sample is the average of the k input samples up to that sample. The window length can be given in seconds or samples. This filter is much more CPU-efficient for smoothing than using an FIR or IIR filter, especially for long window lengths. This filter maintains internal state to smooth seamlessly across chunk boundaries.

More Info...

Version 1.1.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis to average over. Rarely used. If you select instance, then successive trials will be averaged in a moving window, and the window length will be given in trials (choosing 'seconds' as the unit has no effect).

    • verbose name: Axis To Average Over
    • default value: time
    • port type: EnumPort
    • value type: object (can be None)
  • order
    Window length (order) of the filter. This is the number of samples or seconds (see unit parameter) over which we average.

    • verbose name: Window Length
    • default value: 100
    • port type: FloatPort
    • value type: float (can be None)
  • order_unit
    Unit in which the window length is given.

    • verbose name: Unit Of Measurement For Window Length
    • default value: samples
    • port type: EnumPort
    • value type: object (can be None)
  • ignore_nans
    If activated, NaN values are ignored as in nanmean.

    • verbose name: Ignore Nan Samples
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • output_nans
    If enabled, values that were NaN in the input data will be set to NaN in the output.

    • verbose name: Output Nans
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

MovingWindow

Output a moving window of a streaming time series.

This node is meant to be used in online processing only. On every tick, this node outputs the last window_length seconds of the signal.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • window_length
    Sliding window length. A longer window will yield a better estimate, but the spectrum will change more slowly and will also react more slowly to changes. Typical settings for EEG phenomena are 0.5 to 5 seconds, but for very slowly (or rapidly) changing brain dynamics, longer (or shorter) windows may be used.

    • verbose name: Sliding Window Length
    • default value: 2
    • port type: FloatPort
    • value type: float (can be None)
  • unit
    Unit in which the window length is given.

    • verbose name: Unit Of Measurement For Window Length
    • default value: seconds
    • port type: EnumPort
    • value type: object (can be None)
  • flag_as_offline
    Flag output as offline data.

    • verbose name: Flag As Offline
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • verbose
    Verbose output.

    • verbose name: Verbose
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

PeakAmplitude

Find the amplitude of the tallest peak along an axis.

This node finds the largest element along an axis and outputs the value of that element along the axis (and if the data has other axes, e.g., channels, then for each channel/etc the amplitude is computed separately). One can optionally also find the smallest element (i.e., negative peak). The chosen axis will generally be replaced by a one-element feature axis.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis along which to find the peak. This axis will drop out of the data and be replaced by a one-element feature axis.

    • verbose name: Find Peak Along Axis
    • default value: time
    • port type: EnumPort
    • value type: object (can be None)
  • negative
    Apply to negative peaks. If checked, the smallest element will be searched, instead of the largest.

    • verbose name: Find Negative Peaks
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

PeakFinding

Find all peaks in the given data along a given axis.

This method uses a continuous wavelet based approach to be able to identify multiple peaks of various shapes and sizes. By default, the offset is returned as the index of the element, counting from zero for the first element. However, in the special case that the node is applied over the time axis, it is possible to measure the offset instead in seconds, and one may also look up the position in seconds from the time axis (e.g., relative to whatever is 0 in the time axis). One can also optionally account for the delay of previous filter nodes, to the extent that the data is annotated with it.

Version 1.0.0

Ports/Properties

  • 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)
  • indata
    Input data.

    • verbose name: Indata
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • latencies
    Output peak latencies.

    • verbose name: Latencies
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: OUT
  • amplitudes
    Output peak amplitudes.

    • verbose name: Amplitudes
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: OUT
  • axis
    Axis along which to find the peak. This axis will drop out of the data and be replaced by a one-element feature axis.

    • verbose name: Find Peak Along Axis
    • default value: time
    • port type: EnumPort
    • value type: object (can be None)
  • negative
    Apply to negative peaks. If checked, the smallest element will be searched, instead of the largest.

    • verbose name: Find Negative Peaks
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • unit
    Unit of measurement to use, depending on axis that the peak is searched along. Using seconds here works only if the operation is performed along the time axis, and if the axis has a sampling rate set.

    • verbose name: Unit Of Measurement
    • default value: samples
    • port type: EnumPort
    • value type: object (can be None)
  • wavelet
    Type of wavelet to use for matching.

    • verbose name: Wavelet
    • default value: ricker
    • port type: EnumPort
    • value type: object (can be None)
  • min_width
    Minimum peak width. Expressed in the selected unit of measurement (seconds or samples). For other units (e.g., Hz), this is still measured in samples.

    • verbose name: Min Width
    • default value: 5
    • port type: FloatPort
    • value type: float (can be None)
  • max_width
    Maximum peak width. Expressed in the selected unit of measurement (seconds or samples). For other units (e.g., Hz), this is still measured in samples.

    • verbose name: Max Width
    • default value: 15
    • port type: FloatPort
    • value type: float (can be None)
  • num_widths
    Number of intermediate widths to consider. The algorithm will separately scan for a number of intermediate widths between min_width and max_with. Choosing a finer resolution here may improve the accuracy of peak finding, but at increased computational cost.

    • verbose name: Num Widths
    • default value: 10
    • port type: IntPort
    • value type: int (can be None)
  • subtract_filter_delay
    Subtract filter delay (time axis only). Note that this is most reliable when used with only linear-phase filters (e.g., FIR filter without minimum phase option), since otherwise the delay will depend on the frequency content of the signal.

    • verbose name: Subtract Filter Delay
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • account_for_time_axis
    Look up latency from the time axis. If unchecked, the lantency will be computed relative to the beginning of the data segment, but if checked, it will be relative to whatever is 0.0 in the time axis (and would even work with irregularly sampled data).

    • verbose name: Respect Time Axis
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • update_on_streaming
    Update on streaming data. If enabled (default), then this node will update its output measure on every chunk, whether it is marked as streaming or not. If False, then it will only update on non-streaming, chunks, such as calibration data.

    • verbose name: Update On Streaming Data
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • min_snr
    Minimum signal-to-noise ratio.

    • verbose name: Min Snr
    • default value: 1
    • port type: FloatPort
    • value type: float (can be None)
  • noise_percentile
    Percentile of where the noise floor lies.

    • verbose name: Noise Percentile
    • default value: 10
    • port type: FloatPort
    • value type: float (can be None)

PeakLatency

Find the latency or offset of the tallest peak along an axis.

This node finds the largest element along an axis and outputs the offset/shift of that element along the axis (and if the data has other axes, e.g., channels, then for each channel/etc the offset is computed separately). One can optionally also find the smallest element (i.e., negative peak). The chosen axis will generally be replaced by a one-element feature axis. By default, the offset is returned as the index of the element, counting from zero for the first element. However, in the special case that the node is applied over the time axis, it is possible to measure the offset instead in seconds, and one may also look up the position in seconds from the time axis (e.g., relative to whatever is 0 in the time axis). One can also optionally account for the delay of previous filter nodes, to the extent that the data is annotated with it.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis along which to find the peak. This axis will drop out of the data and be replaced by a one-element feature axis.

    • verbose name: Find Peak Along Axis
    • default value: time
    • port type: EnumPort
    • value type: object (can be None)
  • negative
    Apply to negative peaks. If checked, the smallest element will be searched, instead of the largest.

    • verbose name: Find Negative Peaks
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • unit
    Output unit, depending on axis that the peak is searched along. Using seconds here works only if the operation is performed along the time axis, and if the axis has a sampling rate set.

    • verbose name: Unit Of Measurement
    • default value: samples
    • port type: EnumPort
    • value type: object (can be None)
  • subtract_filter_delay
    Subtract filter delay (time axis only). Note that this is most reliable when used with only linear-phase filters (e.g., FIR filter without minimum phase option), since otherwise the delay will depend on the frequency content of the signal.

    • verbose name: Subtract Filter Delay
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • account_for_time_axis
    Look up latency from the time axis. If unchecked, the lantency will be computed relative to the beginning of the data segment, but if checked, it will be relative to whatever is 0.0 in the time axis (and would even work with irregularly sampled data).

    • verbose name: Account For Time Axis
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • update_on_streaming
    Update on streaming data. If enabled (default), then this node will update its output measure on every chunk, whether it is marked as streaming or not. If False, then it will only update on non-streaming, chunks, such as calibration data.

    • verbose name: Update On Streaming Data
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)

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.0

Ports/Properties

  • 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)
  • 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. If a channel has a longer flatline than this, it will be removed. In seconds.

    • 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)
  • calib_seconds
    Minimum amount of data to gather for calibration. When this filter is run online and has not yet been calibrated, then it will first buffer this many seconds of data in order to compute its measures before any output is produced.

    • verbose name: Gather This Much Calibration Data
    • default value: 15
    • port type: IntPort
    • value type: int (can be None)
  • init_on
    Time range to initialize on. If two numbers are given, either in seconds, or as fractions of the calibration data (if both below 1), then the filter will be initialized only on that subset of the calibration data. Another use case is to select an initial baseline period in a longer recording, in order to avoid having to re-run the (fairly expensive) filter in each fold of a cross-validation.

    • verbose name: Initialize On This Time Range
    • default value: []
    • port type: ListPort
    • value type: list (can be None)

QuantileStandardization

Standardize data by converting into quantiles relative to a sliding window.

If data were perfectly Gaussian-distributed, a similar result could be achieved by z-scoring the data in a rectangular sliding window and then applying a sigmoid transform with a slope that is tuned to yield an approximately uniform output distribution.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • window_len
    Window length for robustly tracking the signal drift. Use 0 to standardize against the entire packet (for offline use only).

    • verbose name: Window Length
    • default value: 1
    • port type: FloatPort
    • value type: float (can be None)

RectangularMovingWindowStandardization

Standardize the signal in a sliding rectangular window.

This node estimates the running mean and running standard deviation in a rectangular window (that is, with equal weighting). Then, each sample is converted to z scores by subtracting the running mean and dividing by the running standard deviation, which are estimated from the k samples prior to that sample. This filter maintains internal state to work seamlessly across chunk boundaries. On the first window length samples, the result will not yet be standardized fully since the filter first needs to collect sufficient data.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • means
    Estimated averages. This is an additional diagnostic.

    • verbose name: Means
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: OUT
  • stddevs
    Estimated standard deviations. This is an additioanl diagnostic.

    • verbose name: Stddevs
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: OUT
  • window_length
    Length of sliding window. This is the window length over which the variance of the signal is estimated.

    • verbose name: Window Length
    • default value: 30
    • port type: FloatPort
    • value type: float (can be None)
  • window_length_unit
    Unit in which the window length is given.

    • verbose name: Unit Of Measurement For Window Length
    • default value: seconds
    • port type: EnumPort
    • value type: object (can be None)
  • ignore_nans
    If activated the channels containing nan values are ignored.

    • verbose name: Ignore Channels With Nan Values
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

RefSignals

This node generates sinusoidal reference signals with given frequencies.

A sampling rate (fs in Hz), the number of harmonics, and length of signals (ref_len in sec) should be specified as the node parameters.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Output reference signals

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: OUT
  • fs
    Sampling frequency (Hz).

    • verbose name: Fs
    • default value: 500
    • port type: FloatPort
    • value type: float (can be None)
  • ref_len
    Length of reference signals (sec).

    • verbose name: Ref Len
    • default value: 5
    • port type: FloatPort
    • value type: float (can be None)
  • num_harmonics
    Number of harmonics for each sinusoidal reference signal.

    • verbose name: Num Harmonics
    • default value: 3
    • port type: IntPort
    • value type: int (can be None)
  • freqs
    Frequencies of the sinusoidal reference signals in Hz.

    • verbose name: Freqs
    • default value: [5, 10, 15, 20]
    • port type: ListPort
    • value type: list (can be None)
  • ouput_stream_name
    The name of output stream.

    • verbose name: Output Stream Name
    • default value: Ref_signals
    • port type: StringPort
    • value type: str (can be None)

Rereferencing

Subtract the average of some reference data.

The two most common use cases of this are a) re-referencing of EEG/EMG, where one or more channels are averaged, and the result is subtracted from all channels, and b) baseline removal, where the average in some baseline time window is taken, and subtracted from the whole time period. The range can be given either as a list of values (e.g., indices or channel names in single quotes), formatted as [value1, value2, ...], or as a range expression of the form start:stop, where all successive indices beginning with start and up to one prior to stop are included. This node also supports robust averaging using the median, which can be useful for robust re-referencing, where one or more channels are particularly noisy. Alternatively, instead of specifying a data range from the current data packet to use as reference, you can use data from another packet fed into this node through the reference_data port. This reference data must have the same shape as the data to be subtracted from except along the axis to be rereferenced.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • reference_data
    Reference data to subtract

    • verbose name: Reference Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • axis
    Axis along which to take the reference or baseline.

    • verbose name: Select Reference Along Axis
    • default value: space
    • port type: EnumPort
    • value type: object (can be None)
  • reference_range
    Data range to use as reference / baseline. When the space axis is used (standard re-referencing), this is typically a channel range, e.g. ':' or ['TP8', 'TP9'] or 'Chn1':'Chn10', and the reference unit is set to 'names'. When the time axis is used (baseline removal), this is typically the baseline time window in seconds, e.g., -0.2:0.0. If [] (empty list), the data is not rereferenced.

    • verbose name: Reference Selection
    • default value: :
    • port type: Port
    • value type: object (can be None)
  • reference_unit
    Unit in which the reference range is given. Depending on the axis, different units are applicable, e.g., names for space, seconds for time, indices for any axis.

    • verbose name: Unit Of Measurement For Selection
    • default value: auto
    • port type: EnumPort
    • value type: object (can be None)
  • estimator
    Estimator to use. Mean is the standard choice, median is a robust alternative (tolerates, e.g., bad channels) and trim_mean is a robust alternative which does not inlcude the outliers in the mean calculation.

    • verbose name: Use Estimator
    • default value: mean
    • port type: EnumPort
    • value type: object (can be None)
  • cut_prop
    Fraction of the outliers to cut off for trim_mean option.

    • verbose name: Proportion Cutoff For Trim Mean Option
    • default value: 0.1
    • port type: FloatPort
    • value type: float (can be None)
  • use_separate_reference
    If checked, the range property will be ignored and the data in the reference_data port will be used instead. The reference_data tensor must include the axis selected above, and be the same size as the data except along the selected axis.

    • verbose name: Use Separate Reference
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

Resample

Resample signal to a given sampling rate.

This uses a polyphase implementation. This node currently only supports resampling during offline processing, and uses a zero-phase FIR filter (that is, it is not strictly causal, but the filter is usually quite short).

Version 0.1.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • rate
    Target sampling rate.

    • verbose name: Rate
    • default value: None
    • port type: FloatPort
    • value type: float (can be None)
  • kaiser_param
    Kaiser window parameter.

    • verbose name: Kaiser Param
    • default value: 5.0
    • port type: FloatPort
    • value type: float (can be None)

RobustRectangularStandardization

Robustly standardize the signal in a sliding rectangular window.

This node estimates the running median and running median absolute deviation in a rectangular window (that is, with equal weighting for all samples in the window). Then, each sample is converted to robust z scores by subtracting the running median and dividing by the robust standard deviation, estimated from the median absolute deviation, both of which are estimated from the k samples prior to that sample. This filter maintains internal state to work seamlessly across chunk boundaries. On the first window length samples, the result will not yet be standardized fully since the filter first needs to collect sufficient data.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • window_len
    Window length for standardization. In seconds.

    • verbose name: Window Len
    • default value: 30
    • port type: FloatPort
    • value type: float (can be None)

ShiftedWindows

Extract overlapped windows from the given time series.

Note that this node is currently only usable in offline mode. In the output the time axis is replaced by two axes, an instance axis called timewindow which indicates the average time of the window and the time axis which indicates the relative time in the window with the reference to the middle time-point. If remove_gaps is True, all windows which overlap gaps in the time-sequence will be removed.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • win_len
    Sliding window length. A longer window will yield a better estimate, but the spectrum will change more slowly and will also react more slowly to changes. Typical settings for EEG phenomena are 0.5 to 5 seconds, but for very slowly (or rapidly) changing brain dynamics, longer (or shorter) windows may be used.

    • verbose name: Sliding Window Length
    • default value: 2
    • port type: FloatPort
    • value type: float (can be None)
  • offset_len
    Amount of shift or offset between the beginning of the time window segments. If this value is not set, it is assumed that the overlap length is half of the window length, corresponding to 50% overlap.

    • verbose name: Offset Length
    • default value: None
    • port type: FloatPort
    • value type: float (can be None)
  • unit
    Unit in which the window and offset length is given.

    • verbose name: Unit Of Measurement For Window Length
    • default value: seconds
    • port type: EnumPort
    • value type: object (can be None)
  • remove_gaps
    Remove all windows which overlap gaps in the data.

    • verbose name: Remove Gaps
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • max_gap_length
    Maximum length of time-stamp gaps that are allowed in segments. If a gap between successive samples is larger than this duration in seconds, then the affected segment is not extracted. Optional. Note that if your time stamps are jittered, this will generate a lot of false positives unless you use a very generous cutoff. You can use the DejitterTimestamps node early during your processing to fix that.

    • verbose name: Max Gap Length
    • default value: 0.2
    • port type: FloatPort
    • value type: float (can be None)

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.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • regularization
    Shrinkage regulariation 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.

    • verbose name: Regularization Strength
    • default value: 0
    • port type: FloatPort
    • value type: float (can be None)
  • robust
    Perform robust estimation.

    • verbose name: Robust
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • calib_seconds
    Minimum amount of data to gather for calibration. When this filter is run online and has not yet been calibrated, then it will first buffer this many seconds of data in order to compute its measures before any output is produced.

    • verbose name: Gather This Much Calibration Data
    • default value: 45
    • port type: IntPort
    • value type: int (can be None)
  • init_on
    Time range to initialize on. If two numbers are given, either in seconds, or as fractions of the calibration data (if both below 1), then the filter will be initialized only on that subset of the calibration data. Another use case is to select an initial baseline period in a longer recording, in order to avoid having to re-run the (fairly expensive) filter in each fold of a cross-validation.

    • verbose name: Initialize On This Time Range
    • default value: []
    • port type: ListPort
    • value type: list (can be None)
  • emit_calib_data
    Emit calibration-data chunk. If disabled, this filter will 'eat' the calibration data. Since this chunk is quite long, it can be good 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.

    • verbose name: Emit Calibration Data
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • subtract_mean
    Subtract the mean from the data.

    • verbose name: Subtract Mean
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • use_pseudoinverse
    Use pseudoinverse method. This will work if data is rank-deficient even when the regularization parameter is set to 0.

    • verbose name: Use Pseudoinverse
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • store_matrices
    Store transform matrices in packet properties.

    • verbose name: Store Matrices
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

TRCA

Perform Task-Related Component Analysis (TRCA) of the input data.

The shape of the input is [#channels x #time-points x #trials].

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

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

UnitNormalization

\ Normalize the data along an axis by dividing each data point by the sum of all data points (within each row), or the sum of the squares of all data points.

(Negative values are not made absolute.)

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis along which to perform the unit normalization.

    • verbose name: Axis
    • default value: frequency
    • port type: EnumPort
    • value type: object (can be None)
  • normalization
    Type of normalization: divide by the sum of all values of each row of the axis, or divide by the sum of all squares of the values in each row along the axis.

    • verbose name: Normalization
    • default value: sum
    • port type: EnumPort
    • value type: object (can be None)

WindowFunction

Apply a window function to the given data along some axis.

This node will basically multiply a window function (e.g., a bell curve) element-by-element with the data along that axis. This can be used to get a soft weighting of different places in the data, instead of a sharp-edged data range. The most common use case of this node is to apply it along the time axis on data that has previously been segmented using the Segmentation node. For more information on the different window functions and their tradeoffs, follow the below "more..." link.

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis along which the window function should be applied. The window will be multiplied element-by-element with the data along the axis.

    • verbose name: Apply Window Function Along Axis
    • default value: time
    • port type: EnumPort
    • value type: object (can be None)
  • func
    Type of window function to use. Different functions have different spectral and temporal localization characteristics (see documentation of the node). One of the simplest well-behaved smooth windows is the Hann window (the default).

    • verbose name: Window Function
    • default value: hann
    • port type: EnumPort
    • value type: object (can be None)
  • param
    Window parameter. Some of the window functions are parametric, and in those cases this parameter must be specified. Needed for kaiser, gaussian, slepian, and chebwin.

    • verbose name: Window Parameter (Parametric Windows Only)
    • default value: None
    • port type: FloatPort
    • value type: float (can be None)
  • apply_to_range
    The range of data to select along the desired axis. The simplest form is a list of indices (with unit set to indices), which must be formatted as in [0,1,2,5,6] (indices count from 0). Another option is to use an inclusive range of the form 3...4 (inclusive means that both 3 and 4 are included in the range). And finally, you can also generally use Python's "slice" syntax, as in 0: 3 -- but this is more error prone as the range is half-open, that is, it does not include the last value of the slice (so the previous slice gives the same result as using the indices [0,1,2]). In slices, you can also use negative numbers, which count from the end, or you can omit the value before or after the :, which is then assumed to stand for the first element (if the value before the colon is omitted) or the last element (if the value after the colon is omitted). For instance, -3: retains the last 3 items along te axis. You can also give these values in units other than array indices, such as in seconds, Hz, channel names, and so on. See Unit for the most common examples.

    • verbose name: Apply To Range
    • default value: :
    • port type: Port
    • value type: object (can be None)
  • range_unit
    Unit in which the selection is given. Depending on the axis, different units are applicable. For axes such as time, frequency, or space, you usually want to use not array indices but other units of measurement: for instance, for the time axis, you generally want to set the unit to 'seconds' -- then, a range like 10:50 is interpreted as "all the data starting at 10 seconds and up to (but not including) 50 seconds". For the frequency axis, the most useful unit would be 'Hz'. For channels, it is often desirable to be able to give channel names, e.g., ['C3','C4',CZ'], or 'A1':'A32' -- all you need to do for this is set the unit to 'names'.

    • verbose name: Unit Of Measurement For Range
    • default value: indices
    • port type: EnumPort
    • value type: object (can be None)