Smoothing of arbitrary 1D curves

Smoothing of curves that are not equal spaced sampled and with not monotonic ascending x values
15 Downloads
Updated 28 Oct 2023

View License

Smooth1D_NE_NM
Smoothing of arbitrary 1D curves.
Curves that are not equal spaced sampled and with not monotonic ascending x values.
1 Manual
1.1 Input
The first argument xy is a n x 2 or 2 x n array with the x and y values, n>3.
It must contain numeric values, no NaN
Example: xy = [ 4, 6;
2, 8;
-10, -5;
4, 6 ];
The 2nd argument, called w (width of filter), is optional, see below.
Two modes are possible:
1.) w omitted: Moving triangle auto width filter.
Filter width is automatically determined by the length of the curve
Example: [xes,yes,wout]=smooth1D_NE_NM(xy)
2.) w is set as floating number >0. w is the filter width as length:
0 < w < 0.9 * (length of noisy curve)
Example: [xes,yes,wout]=smooth1DconvNE(xy, 6.7)
1.2 Output
xes: x values of smoothed xy
yes: y values of smoothed xy
wout: filter width used. This may be a little different to the w set by user.
1.3 Error
In case of a bad input, all outputs are set to zero.
2 Method
The steps for smoothing are:
  • Parametrize the noisy curve to x(S) and y(S), S is cumulative curve length
  • Define a filter
  • Extrapolate curve at both ends with a little more than the half filter width
  • Resample the noisy curve including extrapolation
  • Filter xe(Se) and ye(Se) by convolution
For more details read the enclosed pdf.

Cite As

Peter Seibold (2024). Smoothing of arbitrary 1D curves (https://www.mathworks.com/matlabcentral/fileexchange/154246-smoothing-of-arbitrary-1d-curves), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0