The Physiologist's Friend Simulation API

ch.unizh.ini.friend.simulation.filter
Class LowPassFilter

java.lang.Object
  extended by ch.unizh.ini.friend.simulation.filter.LowPassFilter
All Implemented Interfaces:
Filter

public class LowPassFilter
extends Object
implements Filter

A low-pass filter.

Version:
$Revision: 1.5 $
Author:
Christof Marti

Field Summary
protected  float output
          The last output.
protected  float tau
          The time constant.
 
Constructor Summary
LowPassFilter(float tau, float output)
          Creates a new instance of LowPassFilter with the given time constant and the given last output.
 
Method Summary
 float filter(float input, float dt)
          Returns the output of the filter based on the given input and the passed time.
 float getTau()
          Getter for property tau.
 void setTau(float tau)
          Setter for property tau.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

output

protected float output
The last output.


tau

protected float tau
The time constant.

Constructor Detail

LowPassFilter

public LowPassFilter(float tau,
                     float output)
Creates a new instance of LowPassFilter with the given time constant and the given last output.

Parameters:
tau - The time constant.
output - The last output.
Method Detail

filter

public float filter(float input,
                    float dt)
Returns the output of the filter based on the given input and the passed time.

Specified by:
filter in interface Filter
Parameters:
input - The input value.
dt - The time step.
Returns:
The output of the filter.

getTau

public float getTau()
Getter for property tau.

Returns:
Value of property tau.

setTau

public void setTau(float tau)
Setter for property tau.

Parameters:
tau - New value of property tau.

http://www.ini.unizh.ch/~tobi/friend