net.beadsproject.beads.analysis.featureextractors
Class MelSpectrum
java.lang.Object
net.beadsproject.beads.core.Bead
net.beadsproject.beads.analysis.FeatureExtractor<float[],float[]>
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
|
Constructor Summary |
MelSpectrum(float sampleRate,
int numCoeffs)
Instantiates a new MelSpectrum. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
LOG10
public static final float LOG10
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).
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)