|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.beadsproject.beads.core.Bead
net.beadsproject.beads.analysis.FeatureExtractor<float[][],float[]>
net.beadsproject.beads.analysis.featureextractors.SpectralPeaks
public class SpectralPeaks
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.
Its output is an array of [frequency, power] tuples.
Field Summary |
---|
Fields inherited from class net.beadsproject.beads.analysis.FeatureExtractor |
---|
featureDescriptions, features, name, numFeatures |
Constructor Summary | |
---|---|
SpectralPeaks(AudioContext context)
Instantiates a new Peaks. |
|
SpectralPeaks(AudioContext context,
int numFeatures)
Instantiates a new Peaks with the given number of features. |
Method Summary | |
---|---|
float[][] |
getFeatures()
Gets the current features of type R, specified in the class def. |
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, 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 |
Constructor Detail |
---|
public SpectralPeaks(AudioContext context)
context
- the AudioContext.public SpectralPeaks(AudioContext context, int numFeatures)
context
- the AudioContext.numFeatures
- the number of features.Method Detail |
---|
public void process(TimeStamp startTime, TimeStamp endTime, float[] powerSpectrum)
FeatureExtractor
process
in class FeatureExtractor<float[][],float[]>
powerSpectrum
- the data.public float[][] getFeatures()
FeatureExtractor
getFeatures
in class FeatureExtractor<float[][],float[]>
public void setNumberOfFeatures(int numFeatures)
FeatureExtractor
setNumberOfFeatures
in class FeatureExtractor<float[][],float[]>
numFeatures
- the new number of features.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |