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
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
 int getBinForFreq(double freq)
           
 double getFreqForBin(int bin)
           
 void process(TimeStamp startTime, TimeStamp endTime, 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
addListener, forward, getFeatureDescriptions, getFeatures, getName, getNumberOfFeatures, removeListener, 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
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(TimeStamp startTime,
                    TimeStamp endTime,
                    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[]>
powerSpectrum - the data.

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)

getBinForFreq

public int getBinForFreq(double freq)