RoboJDETM v2.0

com.ridgesoft.robotics
Class Smoother

java.lang.Object
  extended by com.ridgesoft.robotics.Smoother

public class Smoother
extends Object

Implements a linear smoothing function to filter noise from the intput signal.

The smoothing equation is:

value = factor * previousValue + (1.0 - factor) * sample


Constructor Summary
Smoother(float smoothingFactor, float seed)
          Creates a Smoother.
 
Method Summary
 float smooth(float sample)
          Smooths the next sample.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Constructor Detail

Smoother

public Smoother(float smoothingFactor,
                float seed)
Creates a Smoother.

Parameters:
smoothingFactor - the factor to use when smoothing (0.0 < smoothingFactor < 1.0). The smaller the value, the less smoothing is done.
seed - initial value to prime to smoother
Method Detail

smooth

public float smooth(float sample)
Smooths the next sample.

Parameters:
sample - raw sample value coming from a sensor
Returns:
smoothed value

RoboJDETM v2.0

Copyright (c) 2003-2009 RidgeSoft, LLC. All rights reserved.
www.ridgesoft.com