ESP OpenBCI - An EEG Signal Processing Library for OpenBCI Hardware

com.github.mrstampy.esp.dsp
Class RawSignalAggregator

java.lang.Object
  extended by com.github.mrstampy.esp.dsp.RawSignalAggregator
Direct Known Subclasses:
OpenBCISignalAggregator

public abstract class RawSignalAggregator
extends java.lang.Object

Abstract superclass for aggregating raw signal arrays (ultimately for FFT'ing).

Author:
burton

Field Summary
protected  java.util.concurrent.ArrayBlockingQueue<double[]> queue
          The queue.
 
Constructor Summary
protected RawSignalAggregator(int sampleRate)
          Instantiates a new raw signal aggregator.
 
Method Summary
 void addSample(double... sample)
          Adds the sample.
 void clear()
          Clear.
 double[][] getCurrentSecondOfSampledData()
          Returns a snapshot of ~ sampleRate samples, each of length fftSize representing the current seconds' raw signal sampled.
 double[][] getCurrentSecondOfSampledData(int numSamples)
          Returns the requested number of samples from the current one seconds' worth of samples (~ sampleRate), evenly spaced over the size of the samples.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queue

protected java.util.concurrent.ArrayBlockingQueue<double[]> queue
The queue.

Constructor Detail

RawSignalAggregator

protected RawSignalAggregator(int sampleRate)
Instantiates a new raw signal aggregator.

Parameters:
sampleRate - the sample rate
Method Detail

addSample

public void addSample(double... sample)
Adds the sample.

Parameters:
sample - the sample

clear

public void clear()
Clear.


getCurrentSecondOfSampledData

public double[][] getCurrentSecondOfSampledData()
Returns a snapshot of ~ sampleRate samples, each of length fftSize representing the current seconds' raw signal sampled.

Returns:
the current second of sampled data
See Also:
EspSignalUtilities

getCurrentSecondOfSampledData

public double[][] getCurrentSecondOfSampledData(int numSamples)
Returns the requested number of samples from the current one seconds' worth of samples (~ sampleRate), evenly spaced over the size of the samples.

Parameters:
numSamples - a fraction of the sampleRate current seconds' samples, > 0 && < sampleRate ie. 50, 25, 10
Returns:
the current second of sampled data
See Also:
EspSignalUtilities

brought to you by Mr. Stampy