net.beadsproject.beads.analysis.featureextractors
Class OnsetDetectorOld

java.lang.Object
  extended by net.beadsproject.beads.core.Bead
      extended by net.beadsproject.beads.analysis.FeatureExtractor<float[],float[]>
          extended by net.beadsproject.beads.analysis.featureextractors.OnsetDetectorOld

public class OnsetDetectorOld
extends FeatureExtractor<float[],float[]>

Detects Onsets in input. It updates listeners when onsets in energy are detected Assumes input is a 1 element array

Author:
ben

Field Summary
protected  java.util.ArrayList<FeatureExtractor<?,float[]>> thresholdListeners
          thresholdListeners receive the filtered threshold value TODO: DISABLE AFTER DEBUG, BP170309
 
Fields inherited from class net.beadsproject.beads.analysis.FeatureExtractor
featureDescriptions, features, name, numFeatures
 
Constructor Summary
OnsetDetectorOld()
           
 
Method Summary
 void addMessageListener(Bead b)
           
 void addThresholdListener(FeatureExtractor<?,float[]> fe)
           
 float getLastOnsetValue()
           
 void process(float[] input)
          process: assumes input is a 1 element array
 void removeMessageListener(Bead b)
           
 void setFilter(Buffer b)
          Sets the window for the FIR filter.
 void setThreshold(float thresh)
           
 void useMeanFilterOfSize(int m)
          Tell the Peak Detector to use a moving average filter of a certain size.
 
Methods inherited from class net.beadsproject.beads.analysis.FeatureExtractor
getFeatureDescriptions, getFeatures, getName, getNumberOfFeatures, setName, setNumberOfFeatures
 
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
 

Field Detail

thresholdListeners

protected java.util.ArrayList<FeatureExtractor<?,float[]>> thresholdListeners
thresholdListeners receive the filtered threshold value TODO: DISABLE AFTER DEBUG, BP170309

Constructor Detail

OnsetDetectorOld

public OnsetDetectorOld()
Method Detail

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)

getLastOnsetValue

public float getLastOnsetValue()
Returns:
the value at the last onset

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.

addMessageListener

public void addMessageListener(Bead b)

removeMessageListener

public void removeMessageListener(Bead b)

addThresholdListener

public void addThresholdListener(FeatureExtractor<?,float[]> fe)