net.beadsproject.beads.analysis.featureextractors
Class MelSpectrum

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

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

MelSpectrum receives spectral data from a PowerSpectrum object and converts it to the mel frequency spectrum. To use MelSpectrum, make sure it is set as a listener to a PowerSpectrum object, not directly from an audio stream.


Field Summary
protected  java.util.ArrayList<FeatureExtractor<?,float[]>> listeners
           
static float LOG10
           
 
Fields inherited from class net.beadsproject.beads.analysis.FeatureExtractor
featureDescriptions, features, name, numFeatures
 
Constructor Summary
MelSpectrum(float sampleRate, int numCoeffs)
          Instantiates a new MelSpectrum.
 
Method Summary
 void addListener(FeatureExtractor<?,float[]> fe)
          Adds a listener to this MFCC.
 double getFreqForBin(int bin)
           
 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 net.beadsproject.beads.core.Bead
getKillListener, isDeleted, isPaused, kill, message, messageReceived, pause, setKillListener, start, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG10

public static final float LOG10

listeners

protected java.util.ArrayList<FeatureExtractor<?,float[]>> listeners
Constructor Detail

MelSpectrum

public MelSpectrum(float sampleRate,
                   int numCoeffs)
Instantiates a new MelSpectrum.

Parameters:
sampleRate - the sample rate in samples per second.
numCoeffs - the number of filters to use (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.

addListener

public void addListener(FeatureExtractor<?,float[]> fe)
Adds a listener to this MFCC.

Parameters:
fe - the listener.

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.

getFreqForBin

public double getFreqForBin(int bin)