Click or drag to resize

WeightedSavitzkyGolaySmoother Class

A C# implementation of Savitzky-Golay smoothing with optional weighting. Weights provide improved stopband suppression compared to traditional Savitzky-Golay (SG). Traditional SG smoothing can be obtained by using NONE.
Inheritance Hierarchy
SystemObject
  Altaxo.Calc.RegressionWeightedSavitzkyGolaySmoother

Namespace: Altaxo.Calc.Regression
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3448.0 (4.8.3448.0)
Syntax
C#
public class WeightedSavitzkyGolaySmoother

The WeightedSavitzkyGolaySmoother type exposes the following members.

Constructors
 NameDescription
Public methodWeightedSavitzkyGolaySmoother Creates a WeightedSavitzkyGolaySmoother with the given weight function, polynomial degree, and kernel half-width. This constructor is useful for repeated smoothing operations with the same parameters. Otherwise, the static Smooth(Double, Double, WeightedSavitzkyGolaySmootherWeightType, Int32, Int32) method is more convenient.
Top
Methods
 NameDescription
Public methodStatic memberBandwidthToHalfwidth Calculates the kernel half-width m for a given bandwidth (the frequency where the response decreases to -3 dB, corresponding to 1/sqrt(2)) for an SGW filter with HANNSQR weights.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodStatic memberSavitzkyGolayBandwidth Calculates the bandwidth of a traditional Savitzky-Golay (SG) filter.
Public methodSmooth(Double, Double) Smooths the data with the parameters passed to the constructor. This method is implemented only for data arrays that have at least 2*m + 1 elements, where m is the kernel half-width.
Public methodStatic memberSmooth(Double, Double, WeightedSavitzkyGolaySmootherWeightType, Int32, Int32) Smooths the data with the specified weight function, polynomial degree, and kernel half-width m. This method is implemented only for data arrays that have at least 2*m + 1 elements.
Public methodStatic memberSmoothLikeSG Smooths the data in a way comparable to a traditional Savitzky-Golay filter with parameters degree and m, but using Hann-squared weights, resulting in substantially better noise rejection. This method is implemented only for arrays that have at least as many elements as the SGW kernel. This is more than 2*m + 1, but never more than 4*m + 1.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Remarks
Reference: Michael Schmid, David Rath, and Ulrike Diebold, "Why and how Savitzky-Golay filters should be replaced", ACS Measurement Science Au 2022 2 (2), 185–196. DOI: 10.1021/acsmeasuresciau.1c00054.
See Also