Class SavitzkyGolay

  • All Implemented Interfaces:
    Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, SizeOfHandler, TechnicalInformationHandler, CapabilitiesHandler, BatchFilter, ColumnSubsetFilter, Filter, StreamFilter, Serializable

    public class SavitzkyGolay
    extends AbstractColumnSubsetStreamFilter
    implements TechnicalInformationHandler
    A filter that applies Savitzky-Golay smoothing.

    For more information see:

    A. Savitzky, Marcel J.E. Golay (1964). Smoothing and Differentiation of Data by Simplified Least Squares Procedures. Analytical Chemistry. 36:1627-1639.

    William H. Press, Saul A. Teukolsky, William T. Vetterling, Brian P. Flannery (1992). Savitzky-Golay Smoothing Filters.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -column-subset <RANGE|REGEXP> (property: columnSubset)
        Defines how to determine the columns to use for filtering.
        default: RANGE
     
    -col-range <adams.data.spreadsheet.SpreadSheetColumnRange> (property: colRange)
        The range of columns to use in the filtering process.
        default: first-last
        example: A range is a comma-separated list of single 1-based indices or sub-ranges of indices ('start-end'); 'inv(...)' inverts the range '...'; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
     
    -col-regexp <adams.core.base.BaseRegExp> (property: colRegExp)
        The regular expression to use on the column names to determine whether to
        use a column for filtering.
        default: .*
        more: https://docs.oracle.com/javase/tutorial/essential/regex/
        https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html
     
    -drop-other-columns <boolean> (property: dropOtherColumns)
        If enabled, other columns that aren't used for filtering get removed from
        the output; does not affect any class columns.
        default: false
     
    -polynomial <int> (property: polynomialOrder)
        The polynomial order to use, must be at least 2.
        default: 2
        minimum: 2
     
    -derivative <int> (property: derivativeOrder)
        The order of the derivative to use, >= 0.
        default: 1
        minimum: 0
     
    -left <int> (property: numPointsLeft)
        The number of points left of a data point, >= 0.
        default: 3
        minimum: 0
     
    -right <int> (property: numPointsRight)
        The number of points right of a data point, >= 0.
        default: 3
        minimum: 0
     
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_PolynomialOrder

        protected int m_PolynomialOrder
        the polynomial order.
      • m_DerivativeOrder

        protected int m_DerivativeOrder
        the order of the derivative.
      • m_NumPointsLeft

        protected int m_NumPointsLeft
        the number of points to the left of a data point.
      • m_NumPointsRight

        protected int m_NumPointsRight
        the number of points to the right of a data point.
      • m_Coefficients

        protected double[] m_Coefficients
        the calculated coefficients.
    • Constructor Detail

      • SavitzkyGolay

        public SavitzkyGolay()
    • Method Detail

      • getTechnicalInformation

        public TechnicalInformation getTechnicalInformation()
        Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.
        Specified by:
        getTechnicalInformation in interface TechnicalInformationHandler
        Returns:
        the technical information about this class
      • resetCoefficients

        public void resetCoefficients()
        Resets the coefficients.
      • setPolynomialOrder

        public void setPolynomialOrder​(int value)
        Sets the polynomial order.
        Parameters:
        value - the order
      • getPolynomialOrder

        public int getPolynomialOrder()
        Returns the polynominal order.
        Returns:
        the order
      • polynomialOrderTipText

        public String polynomialOrderTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setDerivativeOrder

        public void setDerivativeOrder​(int value)
        Sets the order of the derivative.
        Parameters:
        value - the order
      • getDerivativeOrder

        public int getDerivativeOrder()
        Returns the order of the derivative.
        Returns:
        the order
      • derivativeOrderTipText

        public String derivativeOrderTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setNumPointsLeft

        public void setNumPointsLeft​(int value)
        Sets the number of points to the left of a data point.
        Parameters:
        value - the number of points
      • getNumPointsLeft

        public int getNumPointsLeft()
        Returns the number of points to the left of a data point.
        Returns:
        the number of points
      • numPointsLeftTipText

        public String numPointsLeftTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setNumPointsRight

        public void setNumPointsRight​(int value)
        Sets the number of points to the right of a data point.
        Parameters:
        value - the number of points
      • getNumPointsRight

        public int getNumPointsRight()
        Returns the number of points to the right of a data point.
        Returns:
        the number of points
      • numPointsRightTipText

        public String numPointsRightTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.