dispel.signal.interpolators module#

Specific functionality for signal processing of interpolations.

dispel.signal.interpolators.cubic_splines(path, up_sampling_factor)[source]#

Interpolate x and y coordinates of a trajectory using cubic splines.

According to Scipy documentation, Interpolate data with a piecewise cubic polynomial which is twice continuously differentiable. Here spline interpolation is preferred to polynomial interpolation because it yields similar results, even when using low degree polynomials, while avoiding Runge's phenomenon for higher degrees.

Parameters:
  • path (ndarray) – The given 2 dimensional path to interpolate.

  • up_sampling_factor (float) – The up-sampling factor.

Returns:

The interpolated trajectory.

Return type:

numpy.ndarray

dispel.signal.interpolators.custom_interpolator_1d(path, up_sampling_factor, kind)[source]#

Interpolate x and y coordinates of a trajectory.

Parameters:
  • path (ndarray) – The given 2 dimensional path to interpolate.

  • up_sampling_factor (float) – The up-sampling factor.

  • kind (str) – Specifies the kind of interpolation as a string or as an integer specifying the order of the spline interpolator to use. The string has to be one of ‘linear’, ‘nearest’, ‘nearest-up’, ‘zero’, ‘slinear’, ‘quadratic’, ‘cubic’, ‘previous’, or ‘next’. ‘zero’, ‘slinear’, ‘quadratic’ and ‘cubic’ refer to a spline interpolation of zeroth, first, second or third order; ‘previous’ and ‘next’ simply return the previous or next value of the point; ‘nearest-up’ and ‘nearest’ differ when interpolating half-integers (e.g. 0.5, 1.5) in that ‘nearest-up’ rounds up and ‘nearest’ rounds down. Default is ‘linear’.

Returns:

The interpolated trajectory.

Return type:

numpy.ndarray