pyFDN.downsample_minmax#

pyFDN.downsample_minmax(x, y, *, max_points=10000)[source]#

Downsample a line while preserving local minima and maxima.

This is intended for dense time-domain traces such as impulse responses, where naive stride decimation can miss narrow peaks. The returned samples are sorted by their original order, include the first and last sample, and use at most max_points points for long inputs.

Parameters:
  • x (array-like or None) – X-values. If None, uses sample indices 0 .. len(y)-1.

  • y (array-like) – Real-valued y-values.

  • max_points (int, optional) – Maximum number of samples to return. Must be at least 4.

Returns:

x_ds, y_ds – Downsampled x- and y-values.

Return type:

ndarray