org.openuat.sensors
Class TimeSeriesAlignment

java.lang.Object
  extended by org.openuat.sensors.TimeSeriesBundle
      extended by org.openuat.sensors.TimeSeriesAlignment

public class TimeSeriesAlignment
extends TimeSeriesBundle

http://en.wikipedia.org/wiki/Image:Spherical_Coordinates.png http://en.wikipedia.org/wiki/List_of_canonical_coordinate_transformations x = r sin phi cos theta y = r sin phi sin theta z = r cos phi r^2 = x^2+y^2+z^2 cos theta = x / sqrt(x^2 + y^2), sin theta = y / sqrt(x^2 + y^2), tan theta = y/x cos phi = z/r, tan phi = sqrt(x^2+y^2) / z

Version:
1.0
Author:
Rene Mayrhofer

Nested Class Summary
 class TimeSeriesAlignment.Alignment
           
 
Field Summary
 
Fields inherited from class org.openuat.sensors.TimeSeriesBundle
curActiveSegmentLength, curSample, curSample_Int, curSampleIndex, curSampleReceived, firstStageHandlers, firstStageSeries, firstStageSeries_Int, maxSegmentSize, minSegmentSize, samplesSinks, samplesSinks_Int, segmentsSinks, segmentsSinks_Int, windowSize
 
Constructor Summary
TimeSeriesAlignment(double[][] mySide)
           
TimeSeriesAlignment(int numSeries, int windowSize, int minSegmentSize, int maxSegmentSize)
          Constructs all internal buffers and the time series.
 
Method Summary
 TimeSeriesAlignment.Alignment alignWith(double[][] otherSide)
          This is naive optimisation - our own sample is the reference, the other rotated wrt. it.
 double[][] getCartesian()
          Returns all dimensions of the active segment in cartesian coordinates.
 void reset()
          Resets the time series to the state as created when freshly constructing it.
 double[][] rotate(double[][] series)
           
protected  void sampleAddedLine(int lineIndex, double sample, int numSample)
           
protected  void sampleAddedLine(int lineIndex, int sample, int numSample)
           
protected  void toActiveFirstLine(int numSample)
           
protected  void toQuiescentLastLine(int numSample)
           
 
Methods inherited from class org.openuat.sensors.TimeSeriesBundle
addNextStageSamplesSink, addNextStageSamplesSink, addNextStageSegmentsSink_Int, addNextStageSegmentsSink, forceToQuiescent, getInitialSinks_Int, getInitialSinks, removeNextStageSamplesSink, removeNextStageSamplesSink, removeNextStageSegmentsSink, removeNextStageSegmentsSink, setActiveVarianceThreshold, setActiveVarianceThreshold, setMultiplicator, setMultiplicator, setOffset, setOffset, setParameters, setParameters, setSubtractTotalMean, setSubtractWindowMean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeSeriesAlignment

public TimeSeriesAlignment(int numSeries,
                           int windowSize,
                           int minSegmentSize,
                           int maxSegmentSize)
Constructs all internal buffers and the time series.

Parameters:
numSeries - The number of time series to use, i.e. the dimensionality of the input space.
windowSize - The time window size to use for detecting active/quiescent segments. This is specified as the number of samples in the window.
minSegmentSize - The minimum size of an active segment to be regarded significant enough to be sent to listeners.
maxSegmentSize - If set to something other than -1, specifies the maximum size of an active segments. If an active segment is longer than this number of samples, it will be sent to the listeners as soon as it reaches this length. The remainders of longer segments will be discarded. Set to -1 to disable this functionality, otherwise must be >=minSegmentSize.

TimeSeriesAlignment

public TimeSeriesAlignment(double[][] mySide)
Method Detail

alignWith

public TimeSeriesAlignment.Alignment alignWith(double[][] otherSide)
This is naive optimisation - our own sample is the reference, the other rotated wrt. it.

Parameters:
otherSide - A two-dimensional array, the "outer" array representing samples, the "inner" arrays the dimensions for each sample. It is assumed that all samples have the same number of dimensions. Bad things will happen if they don't...
Returns:

rotate

public double[][] rotate(double[][] series)

toActiveFirstLine

protected void toActiveFirstLine(int numSample)
Specified by:
toActiveFirstLine in class TimeSeriesBundle

toQuiescentLastLine

protected void toQuiescentLastLine(int numSample)
Specified by:
toQuiescentLastLine in class TimeSeriesBundle

sampleAddedLine

protected void sampleAddedLine(int lineIndex,
                               double sample,
                               int numSample)
Specified by:
sampleAddedLine in class TimeSeriesBundle

sampleAddedLine

protected void sampleAddedLine(int lineIndex,
                               int sample,
                               int numSample)
Specified by:
sampleAddedLine in class TimeSeriesBundle

reset

public void reset()
Resets the time series to the state as created when freshly constructing it.

Overrides:
reset in class TimeSeriesBundle

getCartesian

public double[][] getCartesian()
Returns all dimensions of the active segment in cartesian coordinates.

Returns:
The length will be equal to index.


2005-2009, Rene Mayrhofer.