gen_savitzky_golay_filterT_gen_savitzky_golay_filterGenSavitzkyGolayFilterGenSavitzkyGolayFiltergen_savitzky_golay_filter (Operator)

Name

gen_savitzky_golay_filterT_gen_savitzky_golay_filterGenSavitzkyGolayFilterGenSavitzkyGolayFiltergen_savitzky_golay_filter — Compute the filter coefficients of a Savitzky-Golay filter.

Signature

gen_savitzky_golay_filter( : : FilterSize, PolynomialDegree, Derivative : Filter)

Herror T_gen_savitzky_golay_filter(const Htuple FilterSize, const Htuple PolynomialDegree, const Htuple Derivative, Htuple* Filter)

void GenSavitzkyGolayFilter(const HTuple& FilterSize, const HTuple& PolynomialDegree, const HTuple& Derivative, HTuple* Filter)

static HTuple HImage::GenSavitzkyGolayFilter(Hlong FilterSize, Hlong PolynomialDegree, Hlong Derivative)

static void HOperatorSet.GenSavitzkyGolayFilter(HTuple filterSize, HTuple polynomialDegree, HTuple derivative, out HTuple filter)

static HTuple HImage.GenSavitzkyGolayFilter(int filterSize, int polynomialDegree, int derivative)

def gen_savitzky_golay_filter(filter_size: int, polynomial_degree: int, derivative: int) -> Sequence[float]

Description

gen_savitzky_golay_filtergen_savitzky_golay_filterGenSavitzkyGolayFilterGenSavitzkyGolayFiltergen_savitzky_golay_filter generates the coefficients of a Savitzky–Golay filter of size FilterSizeFilterSizeFilterSizefilterSizefilter_size with a polynomial of order PolynomialDegreePolynomialDegreePolynomialDegreepolynomialDegreepolynomial_degree. The coefficients are calculated for the derivative DerivativeDerivativeDerivativederivativederivative of the fitted polynomial. A value of 0 for DerivativeDerivativeDerivativederivativederivative specifies that the filter performs smoothing of the original function.

The Savitzky–Golay filter is a linear filter. It operates by fitting a polynomial to neighboring function values sampled at equally spaced support points, and evaluating the polynomial at the central support point. This process can be used for data smoothing. If required, the polynomial may be differentiated before evaluation, enabling, for example, the removal of linear trends from the data.

These filter parameters can be applied, for instance, to smooth hyperspectral images along the channel axis using the convol_channelsconvol_channelsConvolChannelsConvolChannelsconvol_channels operator.

For numerical stability, PolynomialDegreePolynomialDegreePolynomialDegreepolynomialDegreepolynomial_degree must not exceed 9.

Execution Information

Parameters

FilterSizeFilterSizeFilterSizefilterSizefilter_size (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Size of the filter.

Default: 11

Suggested values: 5, 7, 9, 11, 13, 15, 17

PolynomialDegreePolynomialDegreePolynomialDegreepolynomialDegreepolynomial_degree (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Degree of the approximating polynomial.

Default: 3

Suggested values: 3, 5

DerivativeDerivativeDerivativederivativederivative (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Derivative of the polynomial.

Default: 0

Suggested values: 0, 1, 2

FilterFilterFilterfilterfilter (output_control)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Filter coefficients.

Possible Successors

convol_channelsconvol_channelsConvolChannelsConvolChannelsconvol_channels

See also

convol_channelsconvol_channelsConvolChannelsConvolChannelsconvol_channels

Module

Foundation