net.beadsproject.beads.analysis.featureextractors
Class SpectralDifference
java.lang.Object
net.beadsproject.beads.core.Bead
net.beadsproject.beads.analysis.FeatureExtractor<float[],float[]>
net.beadsproject.beads.analysis.featureextractors.SpectralDifference
public class SpectralDifference
- extends FeatureExtractor<float[],float[]>
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 |
listeners
protected java.util.ArrayList<FeatureExtractor<?,float[]>> listeners
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(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<float[],float[]>
- Parameters:
spectrum
- the data.
addListener
public void addListener(FeatureExtractor<?,float[]> fe)
- Adds a FeatureExtractor as a listener.
- Parameters:
the
- FeatureExtractor.