net.beadsproject.beads.analysis.featureextractors
Class SpectralCentroid

java.lang.Object
  extended by net.beadsproject.beads.analysis.FeatureExtractor<float[],float[]>
      extended by net.beadsproject.beads.analysis.featureextractors.SpectralCentroid

public class SpectralCentroid
extends FeatureExtractor<float[],float[]>

SpectralCentroid calculates the spectral centroid of a signal. It should be set up to listen to a PowerSpectrum object.


Field Summary
 
Fields inherited from class net.beadsproject.beads.analysis.FeatureExtractor
featureDescriptions, features, name, numFeatures
 
Constructor Summary
SpectralCentroid(float sampleRate)
          Instantiates a new SpectralCentroid.
 
Method Summary
 void process(float[] powerSpectrum)
          Process some data of type P (specified by the class def).
 void setNumFeatures(int numFeatures)
           
 
Methods inherited from class net.beadsproject.beads.analysis.FeatureExtractor
getFeatureDescriptions, getFeatures, getName, getNumberOfFeatures, setName, setNumberOfFeatures
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpectralCentroid

public SpectralCentroid(float sampleRate)
Instantiates a new SpectralCentroid.

Parameters:
sampleRate - the sample rate in samples per second.
Method Detail

process

public void process(float[] powerSpectrum)
Description copied from class: FeatureExtractor
Process some data of type P (specified by the class def). This method must be overidden by implementing classes.

Specified by:
process in class FeatureExtractor<float[],float[]>
Parameters:
powerSpectrum - the data.

setNumFeatures

public void setNumFeatures(int numFeatures)