Skip to content

← signal_processing package

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

new_points

Optional list of points at which to calculate the data.

  • verbose name: New Points
  • default value: None
  • port type: DataPort
  • value type: AnyArray (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: ComboPort
  • value type: str (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: str (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)

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)