dLife Home Page

dlife.nn
Class ShiftAndScaleFilter

java.lang.Object
  extended by dlife.nn.ShiftAndScaleFilter
All Implemented Interfaces:
NNDataFilter, Serializable

public class ShiftAndScaleFilter
extends Object
implements NNDataFilter

A NNDataFilter that shifts and then scales a data value. If the data values is X, the shift amount is SH and the scale amount is SC then the resulting filtered value will be X' = (X + SH) * SC

Version:
Jan 9, 2007
Author:
Grant Braught, Dickinson College
See Also:
Serialized Form

Constructor Summary
ShiftAndScaleFilter(double shiftBy, double scaleBy)
          Construct a new ShiftAndScaleFilter that will shift and then scale data by the specified amounts.
 
Method Summary
 double filterValue(double value)
          Shift and scale the provided value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShiftAndScaleFilter

public ShiftAndScaleFilter(double shiftBy,
                           double scaleBy)
Construct a new ShiftAndScaleFilter that will shift and then scale data by the specified amounts. The filterValue method will compute a new value as: (value + shift) * scale.

Parameters:
shiftBy - the amount by which to shift the data.
scaleBy - the amount by which to scale the data.
Method Detail

filterValue

public double filterValue(double value)
Shift and scale the provided value. The returned value is computed as: (value + shift) * scale.

Specified by:
filterValue in interface NNDataFilter
Parameters:
value - the value to be filtered.
Returns:
the shifted and scaled value.

dLife Home Page