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, setName
getKillListener, isDeleted, isPaused, kill, message, messageReceived, pause, setKillListener, start, toString
public 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)
FeatureExtractor
process
in class FeatureExtractor<float[],float[]>
powerSpectrum
- the data.public void setNumberOfFeatures(int numFeatures)
FeatureExtractor
setNumberOfFeatures
in class FeatureExtractor<float[],float[]>
numFeatures
- the new number of features.public double getFreqForBin(int bin)
public int getBinForFreq(double freq)