Home > Objects > @iData > smooth.m

# iFit/smooth

## PURPOSE Z = smooth(Y) : smooth iData objects

## SYNOPSIS function b = smooth(a, varargin)

## DESCRIPTION ``` Z = smooth(Y) : smooth iData objects

@iData/smooth function to smooth iData objects
The smooth method uses a Robust spline smoothing or Savitzky-Golay algorithm
The spline smoothing relies on a frequency spline smoothing (discrete cosine
transform), whereas the Savitzky-Golay uses a generalized moving average
with filter coefficients determined by an unweighted linear least-squares
regression and a polynomial model of specified degree (default is 2).
The spline method is shape preserving, whereas the Savitzky-Golay may lead
to important distribution modifications.

Z = SMOOTH(Y) automatically smoothes the uniformly-sampled array Y. Y
can be any N-D noisy array (time series, images, 3D data,...). Non
finite data (NaN or Inf) are treated as missing values.

Z = SMOOTH(Y,S) smoothes the data Y using the smoothing parameter S.
S must be a real positive scalar. The larger S is, the smoother the
output will be. If the smoothing parameter S is omitted (see previous
option) or empty (i.e. S = []), it is automatically determined using
the generalized cross-validation (GCV) method.

Z = SMOOTH(Y,W) or Z = SMOOTH(Y,W,S) specifies a weighting array W of
real positive values, that must have the same size as Y. Note that a
nil weight corresponds to a missing value.

Z = SMOOTH(Y,'sgolay') uses the Savitzky-Golay method (2nd order)
Z = SMOOTH(Y,'sgolay',degree) uses the Savitzky-Golay method with polynomial
degree specified by degree.
Z = SMOOTH(Y,span,'sgolay',degree) uses the number of data points specified
by span in the Savitzky-Golay calculation. span must be odd and degree must
be less than span.
Z = SMOOTH(Y,span,'sgolay',degree,dimensions) specifies the dimensions along
which the Savitzky-Golay filter should be applied (integer or vector up to ndims).

Z = SMOOTH(Y, 'gauss', [ widths ]) uses a nD gaussian convolution

Robust smoothing
----------------
Z = SMOOTHN(...,'robust') carries out a robust smoothing that minimizes
the influence of outlying data.

Reference
---------
Garcia D, Robust smoothing of gridded data in one and higher dimensions
with missing values. Computational Statistics & Data Analysis, 2010.
http://www.biomecardio.com/matlab/smoothn.html

Numerical recipes in C. p 650

input:  a: object or array (iData/array of)
output: s: smoothed data set (iData)
ex:     c=smooth(a);

Version: Nov. 26, 2018

## CROSS-REFERENCE INFORMATION This function calls:
• ceil b = ceil(s) : upper integer round of iData object
• convn c = convn(a,b) : computes the convolution of an iData object with a response function
• copyobj b = copyobj(s) : makes a copy of iData object
• end b = end(s,index,n) : end value for iData objects
• iData
• isempty isempty(s) : true for empty iData object
• min [m,id] = min(a,b, dim) : computes the maximum value of iData object(s)
• ndims d = ndims(s) : get the dimensionality of iData object
• permute c = permute(a, order) : Permute object dimensions from iData objects/arrays
• reshape c = reshape(a) : reshape the object Signal
• set [s,...] = set(s, 'PropertyName', Propertyvalue, ...) : set iData properties
• size size(s) : get iData object size (number of elements)
• subsref b = subsref(a,s) : iData indexed references
• zeros s = zeros(s,N,M,P,...) : initialize an iData array
This function is called by:

Generated on Mon 26-Nov-2018 15:08:42 by m2html © 2005. iFit (c) E.Farhi/ILL EUPL 1.1