net.beadsproject.beads.analysis.featureextractors
Class Peaks

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

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

Peaks finds the strongest N peaks in a signal passed from a PowerSpectrum, where N is the specified number of features. Peaks must be set as a listener to a PowerSpectrum object to work properly.


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

Constructor Detail

Peaks

public Peaks(AudioContext context)
Instantiates a new Peaks.

Parameters:
context - the AudioContext.

Peaks

public Peaks(AudioContext context,
             int numFeatures)
Instantiates a new Peaks with the given number of features.

Parameters:
context - the AudioContext.
numFeatures - the number of features.
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.

printFeatures

public void printFeatures()
Prints the features.


setNumberOfFeatures

public void setNumberOfFeatures(int numFeatures)
Description copied from class: FeatureExtractor
Sets the number of features.

Overrides:
setNumberOfFeatures in class FeatureExtractor<float[],float[]>
Parameters:
numFeatures - the new number of features.