Smoothing 1D not equidistant curve by convolution

Version 1.1 (1,73 Mo) par Peter Seibold
The filtering is done with a triangle filter by convolution of the resampled non equidistant curve. Also with automatic filter generation.
23 téléchargements
Mise à jour 11 juil. 2024

Afficher la licence

Smoothing 1D not equidistant curve by convolution
The filtering is done with a triangle filter by convolution of the resampled non equidistant curve. Also with automatic generation of suitable filter width.
In order to get a full curve filtering, the curve is linear extrapolated on both sides and not zero padded.
1 Manual
Invoke the function with: [ys,wout*,xse*,yse*]=smooth1DconvNE(xy,w*)
*) optional arguments
Valid is also e.g.: ys =smooth1DconvNE(xy)
1.1 Input:
The first argument xy is the curve to be smoothed.
The first column contains the x-values and the second column contains the corresponding y-values. The input xy may be also crated as two rows. The minimum are 3 sample pairs.
The 2nd argument, called w (width of filter), is optional.
w is a scalar floating number in x-units. 0 w < 0.9 * length of curve.
For w=0 no filtering, but a resampled curve xse, yse is returned.
Two modes are possible:
1.) w omitted: Filter width is determined by FFT.
2.) w is set as a floating number in x-units and used as filter.
1.2 Output:
ys: smoothed y as vertical vector. The x-values remain unchanged. Vertical vector.
wout: filter width used
xse: resampled equidistant x-values of the smoothed curve. Vertical vector.
yse: resampled equidistant y-values of the smoothed curve. Vertical vector.
In case of a bad input, all outputs are set to zero.
1.3 Remark:
The border values of the smoothed output ys are approximations. In order to calculate those values, the input y is extended by extrapolation of the smoothed input. The approximated border output is one half of the filter width.

Citation pour cette source

Peter Seibold (2024). Smoothing 1D not equidistant curve by convolution (https://www.mathworks.com/matlabcentral/fileexchange/132528-smoothing-1d-not-equidistant-curve-by-convolution), MATLAB Central File Exchange. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2016a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version
1.1

Identical x values are removed during process and added later on in the result.

1.0.0