Skip to content

← signal_processing package

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

Ports/Properties

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
ComboPort
value type
str (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
str (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)

subtract

Subtract from data.

verbose name
Subtract From Data
default value
False
port type
BoolPort
value type
bool (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)