net.beadsproject.beads.analysis.featureextractors
Class PeakDetector
java.lang.Object
net.beadsproject.beads.core.Bead
net.beadsproject.beads.analysis.FeatureExtractor<float[],float[]>
net.beadsproject.beads.analysis.featureextractors.PeakDetector
public class PeakDetector
- extends FeatureExtractor<float[],float[]>
Detects Peaks/Onsets in input.
It updates listeners when peaks in energy are detected
Assumes input is a 1 element array (i.e., a single value)
- Author:
- ben
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
PeakDetector
public PeakDetector()
useMeanFilterOfSize
public void useMeanFilterOfSize(int m)
- Tell the Peak Detector to use a moving average filter of a certain size.
- Parameters:
m
- Size of the filter. Larger = Smoother. M must be greater than 3.
setThreshold
public void setThreshold(float thresh)
setFilter
public void setFilter(Buffer b)
- Sets the window for the FIR filter.
- Parameters:
b
-
process
public void process(float[] input)
- process: assumes input is a 1 element array
- Specified by:
process
in class FeatureExtractor<float[],float[]>
- Parameters:
input
- the data.
addListener
public void addListener(FeatureExtractor<?,float[]> fe)
- Adds a FeatureExtractor as a listener.
- Parameters:
the
- FeatureExtractor.