seg1d.algorithm.resample¶
-
seg1d.algorithm.
resample
(x, s)[source]¶ Interpolation
Apply a cubic interpolation on an n x m dataset that is resampled to the number of samples
Parameters: - xn x m array
n-number of datasets with length m
- sint
number of samples to interpolate x
Returns: - n x s array
interpolated dataset
Examples
>>> import numpy as np >>> import seg1d.algorithm as alg
>>> x = np.sin( np.linspace(-3, 3, 10) ) >>> alg.resample(x,6) array([[-0.14112001, -0.97319156, -0.56423116, 0.56423116, 0.97319156, 0.14112001]]) >>> x = np.array([x,x**2]) >>> alg.resample(x,6) array([[-0.14112001, -0.97319156, -0.56423116, 0.56423116, 0.97319156, 0.14112001], [ 0.01991486, 0.94687756, 0.31972116, 0.31972116, 0.94687756, 0.01991486]])