gaitmap.utils.array_handling.multi_array_interpolation#

gaitmap.utils.array_handling.multi_array_interpolation(arrays: list[numpy.ndarray], n_samples, kind: str = 'linear') ndarray[source]#

Interpolate multiple 2D-arrays to the same length along axis 0.

Parameters:
arrays

List of 2D arrays. Note that arr.shape[1] must be identical for all arrays.

n_samples

Number of samples the arrays should be resampled to.

kind

The type of interpolation to use. Refer to interp1d for possible options.

Note

In case of linear interpolation a custom numba accelerated method is used that is significantly faster than the scipy implementation.

Returns:
interpolated_data

result as a single 3-D array of shape (len(arrays), arrays[0].shape[1], n_samples).