public class MelSpectrum extends FeatureExtractor<float[],float[]>
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.| Modifier and Type | Field and Description |
|---|---|
static float |
LOG10 |
featureDescriptions, features, name, numFeatures| Constructor and Description |
|---|
MelSpectrum(float sampleRate,
int numCoeffs)
Instantiates a new MelSpectrum.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
addListener, forward, getFeatureDescriptions, getFeatures, getName, getNumberOfFeatures, removeListener, setNamegetKillListener, isDeleted, isPaused, kill, message, messageReceived, pause, setKillListener, start, toStringpublic MelSpectrum(float sampleRate,
int numCoeffs)
sampleRate - the sample rate in samples per second.numCoeffs - the number of filters to use (number of features).public void process(TimeStamp startTime, TimeStamp endTime, float[] powerSpectrum)
FeatureExtractorprocess in class FeatureExtractor<float[],float[]>powerSpectrum - the data.public void setNumberOfFeatures(int numFeatures)
FeatureExtractorsetNumberOfFeatures in class FeatureExtractor<float[],float[]>numFeatures - the new number of features.public double getFreqForBin(int bin)
public int getBinForFreq(double freq)