obspy.signal.interpolation.weighted_average_slopes

weighted_average_slopes(data, old_start, old_dt, new_start, new_dt, new_npts, *args, **kwargs)[source]

Implements the weighted average slopes interpolation scheme proposed in [Wiggins1976] for evenly sampled data. The scheme guarantees that there will be no additional extrema after the interpolation in contrast to spline interpolation.

The slope si at each knot is given by a weighted average of the adjacent linear slopes mi and mi+j:

si=(wimi+wi+1mi+1)/(wi+wi+1)

where

Missing \begin{split} or extra \end{split}

The value at each data point and the slope are then plugged into a piecewise continuous cubic polynomial used to evaluate the interpolated sample points.

Parameters
  • data (array_like) – Array to interpolate.

  • old_start (float) – The start of the array as a number.

  • old_dt – The time delta of the current array.

  • new_start (float) – The start of the interpolated array. Must be greater or equal to the current start of the array.

  • new_dt (float) – The desired new time delta.

  • new_npts (int) – The new number of samples.