net.beadsproject.beads.analysis.featureextractors
Class SpectralPeaks
java.lang.Object
net.beadsproject.beads.core.Bead
net.beadsproject.beads.analysis.FeatureExtractor<float[],float[]>
net.beadsproject.beads.analysis.featureextractors.SpectralPeaks
public class SpectralPeaks
- extends FeatureExtractor<float[],float[]>
Peaks finds the strongest N peaks in a signal passed from a PowerSpectrum
, where N is the specified number of features. Peaks must be set as a listener to a PowerSpectrum
object to work properly.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SpectralPeaks
public SpectralPeaks(AudioContext context)
- Instantiates a new Peaks.
- Parameters:
context
- the AudioContext.
SpectralPeaks
public SpectralPeaks(AudioContext context,
int numFeatures)
- Instantiates a new Peaks with the given number of features.
- Parameters:
context
- the AudioContext.numFeatures
- the 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.