com.neurosky.thinkgear
Class HeartRateAcceleration

java.lang.Object
  extended by com.neurosky.thinkgear.HeartRateAcceleration

public class HeartRateAcceleration
extends java.lang.Object


Constructor Summary
HeartRateAcceleration()
          Default constructor with buffer length of 10 seconds
HeartRateAcceleration(int bufferLengthInSeconds)
          Custom constructor
 
Method Summary
 int[] getAcceleration(int heartRate, byte poorSignal)
          Calculates the average heart rate over a time window of 10 seconds or defined by constructor
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeartRateAcceleration

public HeartRateAcceleration()
Default constructor with buffer length of 10 seconds


HeartRateAcceleration

public HeartRateAcceleration(int bufferLengthInSeconds)
Custom constructor

Parameters:
bufferLengthInSeconds -
Method Detail

getAcceleration

public int[] getAcceleration(int heartRate,
                             byte poorSignal)
Calculates the average heart rate over a time window of 10 seconds or defined by constructor

Parameters:
heartRate - Heartrate of user
poorSignal - Poor signal value from sensor
Returns:
An array containing the average heart rate in the first field and difference of current average and previous average in the second field. The array will be -1 if not enough data is present.