Package adams.data.filter
Class AbstractSavitzkyGolay<T extends DataContainer>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.filter.AbstractFilter<T>
-
- adams.data.filter.AbstractSavitzkyGolay<T>
-
- Type Parameters:
T- the type of data to process
- All Implemented Interfaces:
CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<Filter>,SizeOfHandler,TechnicalInformationHandler,Filter<T>,Serializable,Comparable
- Direct Known Subclasses:
TimeseriesSavitzkyGolay
public abstract class AbstractSavitzkyGolay<T extends DataContainer> extends AbstractFilter<T> implements TechnicalInformationHandler
Abstract ancestor for Savitzky-Golay filters.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.data.filter.AbstractFilter
AbstractFilter.FilterJob<T extends DataContainer>
-
-
Field Summary
Fields Modifier and Type Field Description protected double[]m_Coefficientsthe calculated coefficients.protected intm_DerivativeOrderthe order of the derivative.protected intm_NumPointsLeftthe number of points to the left of a data point.protected intm_NumPointsRightthe number of points to the right of a data point.protected intm_PolynomialOrderthe polynomial order.-
Fields inherited from class adams.data.filter.AbstractFilter
m_DontUpdateID
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractSavitzkyGolay()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.StringderivativeOrderTipText()Returns the tip text for this property.intgetDerivativeOrder()Returns the order of the derivative.intgetNumPointsLeft()Returns the number of points to the left of a data point.intgetNumPointsRight()Returns the number of points to the right of a data point.intgetPolynomialOrder()Returns the polynominal order.TechnicalInformationgetTechnicalInformation()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.protected abstract doublegetValue(DataPoint point)Returns the X-value of the DataPoint.StringglobalInfo()Returns a string describing the object.protected voidinitialize()Initializes the members.protected abstract DataPointnewDataPoint(DataPoint oldPoint, double x)Creates a new DataPoint based on the old one and the new X value.StringnumPointsLeftTipText()Returns the tip text for this property.StringnumPointsRightTipText()Returns the tip text for this property.StringpolynomialOrderTipText()Returns the tip text for this property.protected voidpostProcess(DataPoint oldPoint, DataPoint newPoint)Optional post-processing.protected TprocessData(T data)Performs the actual filtering.voidresetCoefficients()Resets the coefficients.voidsetDerivativeOrder(int value)Sets the order of the derivative.voidsetNumPointsLeft(int value)Sets the number of points to the left of a data point.voidsetNumPointsRight(int value)Sets the number of points to the right of a data point.voidsetPolynomialOrder(int value)Sets the polynomial order.-
Methods inherited from class adams.data.filter.AbstractFilter
checkData, cleanUp, compareTo, destroy, dontUpdateIDTipText, equals, filter, forCommandLine, getDontUpdateID, reset, setDontUpdateID, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
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.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
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:
getTechnicalInformationin interfaceTechnicalInformationHandler- Returns:
- the technical information about this class
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractOptionHandler
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractFilter<T extends DataContainer>
-
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.
-
getValue
protected abstract double getValue(DataPoint point)
Returns the X-value of the DataPoint.- Parameters:
point- the point to get the X-Value from- Returns:
- the X-value
-
newDataPoint
protected abstract DataPoint newDataPoint(DataPoint oldPoint, double x)
Creates a new DataPoint based on the old one and the new X value.- Parameters:
oldPoint- the old DataPointx- the new X value- Returns:
- the new DataPoint
-
postProcess
protected void postProcess(DataPoint oldPoint, DataPoint newPoint)
Optional post-processing.
Default implementation does nothing.- Parameters:
oldPoint- the original DataPointnewPoint- the new DataPoint
-
processData
protected T processData(T data)
Performs the actual filtering.- Specified by:
processDatain classAbstractFilter<T extends DataContainer>- Parameters:
data- the data to filter- Returns:
- the filtered data
-
-