net.beadsproject.beads.analysis.featureextractors
Class SpectralDifference
java.lang.Object
net.beadsproject.beads.core.Bead
net.beadsproject.beads.analysis.FeatureExtractor<java.lang.Float,float[]>
net.beadsproject.beads.analysis.featureextractors.SpectralDifference
public class SpectralDifference
- extends FeatureExtractor<java.lang.Float,float[]>
SpectralDifference calculates the spectral difference between one frame and the next.
Constructor Summary |
SpectralDifference(float samplerate)
Create a spectral difference feature extractor of the entire spectrum. |
SpectralDifference(float samplerate,
float minf,
float maxf)
Create a spectral difference feature extractor with a specific frequency
window. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SpectralDifference
public SpectralDifference(float samplerate)
- Create a spectral difference feature extractor of the entire spectrum.
- Parameters:
samplerate
- The sample rate of the AudioContext
SpectralDifference
public SpectralDifference(float samplerate,
float minf,
float maxf)
- Create a spectral difference feature extractor with a specific frequency
window.
- Parameters:
samplerate
- The sample rate of the AudioContextminf
- The lower frequency of the windowmaxf
- The upper frequency of the window
setFreqWindow
public void setFreqWindow(float minf,
float maxf)
- Specify a window of the spectrum to analyse. By default the entire
spectrum is analysed.
- Parameters:
minf
- The lower frequencymaxf
- The upper frequency
setDifferenceType
public void setDifferenceType(SpectralDifference.DifferenceType dt)
process
public void process(TimeStamp startTime,
TimeStamp endTime,
float[] spectrum)
- 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<java.lang.Float,float[]>
spectrum
- the data.