resample

Function resample 

Source
pub fn resample<S, F>(
    x: &ArrayBase<S, Ix1>,
    num: usize,
    axis: usize,
    window: Option<&Array1<F>>,
) -> Result<Array1<F>>
where S: Data<Elem = F>, F: Float + NumCast + FromPrimitive + Debug + Display,
Expand description

Resample a time series to a new number of samples using Fourier method

§Arguments

  • x - Input time series
  • num - Number of samples in the resampled signal
  • axis - Axis along which to resample (default: 0)
  • window - Optional window applied in the Fourier domain

§Returns

Resampled time series

§Example

use scirs2_core::ndarray::array;
use scirs2_series::utils::resample;

let x = array![1.0, 2.0, 3.0, 4.0, 5.0];
let resampled = resample(&x.view(), 10, 0, None).unwrap();
assert_eq!(resampled.len(), 10);