org.imirsel.m2k.math
Class MedianDynamicThreshold

java.lang.Object
  extended byjava.util.Observable
      extended byncsa.d2k.core.modules.RootModule
          extended byncsa.d2k.core.modules.ConfigurableModule
              extended byncsa.d2k.core.modules.EmbeddedPipeModule
                  extended byncsa.d2k.core.modules.ExecModule
                      extended byncsa.d2k.core.modules.ComputeModule
                          extended byorg.imirsel.m2k.math.MedianDynamicThreshold
All Implemented Interfaces:
java.lang.Cloneable, ncsa.d2k.core.modules.Module, java.io.Serializable, ncsa.d2k.core.modules.SystemModule

public class MedianDynamicThreshold
extends ncsa.d2k.core.modules.ComputeModule

Uses a moving median threshold of the input onset detection function to identify onsets in an audio signal.

Author:
Kris West
See Also:
Serialized Form

Field Summary
 
Fields inherited from class ncsa.d2k.core.modules.ConfigurableModule
addedInputInfo, addedInputNames, addedInputTypes, addedOutputInfo, addedOutputNames, addedOutputTypes, addPortListeners
 
Fields inherited from class ncsa.d2k.core.modules.RootModule
alias, children, DEBUG_LEVEL, EMPTY_INPUT, ERROR_LEVEL, executionManager, FATAL_LEVEL, HAVE_INPUT, INFO_LEVEL, iPipes, iPipesIndex, iTriggers, oPipes, oPipesIndex, oTriggers, parents, pipesFullManager, stats, triggerChildren, triggerParents, WARN_LEVEL
 
Fields inherited from interface ncsa.d2k.core.modules.SystemModule
BLOCKED_STATE, IDLE_STATE, MEDIUM, MEDIUM_RARE, MEDIUM_WELL, RARE, READY_STATE, WELL, WORKING_STATE
 
Constructor Summary
MedianDynamicThreshold()
          Creates a new instance of MedianDynamicThreshold
 
Method Summary
protected  void doit()
          Uses a moving median threshold of the input onset detection function to identify onsets in an audio signal.
 java.lang.String getInputInfo(int i)
          Returns info string for specified input
 java.lang.String getInputName(int i)
          Returns name for specified input
 java.lang.String[] getInputTypes()
          Returns fully qualified names for inputs
 java.lang.String getModuleInfo()
          Returns the module info
 java.lang.String getModuleName()
          Returns the module name
 boolean getOutputAsDoubles()
          Returns the outputAsDoubles flag which controls whether the onsets are output as integers or doubles
 java.lang.String getOutputInfo(int i)
          Returns info string for specified output
 java.lang.String getOutputName(int i)
          Returns the name of the specified output
 java.lang.String[] getOutputTypes()
          Returns fully qualified names for outputs
 int getPeakIsolationWindow()
          Returns the length of the peak isolation window
 ncsa.d2k.core.modules.PropertyDescription[] getPropertiesDescriptions()
          Returns an array of description objects for each property of the Module.
 double getThresholdWeight()
          Returns the thresholdWeight property
 int getWindowLength()
          Returns the length of the peak picking window
 boolean isReady()
          Controls whether the module is able to run based on the input flags
 void setOutputAsDoubles(boolean val)
          Sets the outputAsDoubles flag which controls whether the onsets are output as integers or doubles
 void setPeakIsolationWindow(int val)
          Sets the length of the peak isolation window
 void setThresholdWeight(double val)
          Sets the thresholdWeight property
 void setWindowLength(int val)
          Sets the length of the peak picking window
 
Methods inherited from class ncsa.d2k.core.modules.ExecModule
execute, setExecutionManager
 
Methods inherited from class ncsa.d2k.core.modules.ConfigurableModule
addAddPortListener, addInput, addInputTrigger, addOutput, addOutputTrigger, getAddedInputTypes, getAddedOutputTypes, getAddPortListeners, insertInput, insertOutput, removeAddPortListener, removeInput, removeInputTrigger, removeOutput, removeOutputTrigger, setAddedInputTypes, setInputType, setOutputType
 
Methods inherited from class ncsa.d2k.core.modules.RootModule
activateTriggers, begin, beginExecution, canRun, clone, debug, debug, disconnectInputPipe, disconnectInputTriggers, disconnectOutputPipe, disconnectOutputTriggers, end, endExecution, error, error, fatal, fatal, fetchInputs, getAlias, getChildIndex, getChildMux, getChildren, getExecutionManager, getFile, getFlags, getFullPipeManager, getGuiComponent, getImage, getInputPipes, getInputPipeSize, getInputTriggers, getModuleStatistics, getNumInputs, getNumOutputs, getOutputCounts, getOutputPipes, getOutputPipeSize, getOutputTriggers, getParentIndex, getParentMux, getParents, getPipesFull, getPriority, getPropertyEditor, getResource, getRootName, getState, info, info, initModule, isAborting, isHead, isInputPipeConnected, isOutputPipeConnected, pullInput, pushOutput, resetInputs, setAlias, setBlocked, setD2KModulesLoggingLevel, setFlags, setFullPipeManager, setIdle, setInputPipe, setLogLevel, setModuleStatistics, setModuleStatisticsByMachine, setOutputCounts, setOutputPipe, setPipesFull, setReady, setResource, setState, setThePriority, setWorking, trigger, triggersActivated, warn, warn
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MedianDynamicThreshold

public MedianDynamicThreshold()
Creates a new instance of MedianDynamicThreshold

Method Detail

setThresholdWeight

public void setThresholdWeight(double val)
Sets the thresholdWeight property

Parameters:
val - the new thresholdWeight

getThresholdWeight

public double getThresholdWeight()
Returns the thresholdWeight property

Returns:
the current thresholdWeight

setWindowLength

public void setWindowLength(int val)
Sets the length of the peak picking window

Parameters:
val - the new peak picking window

getWindowLength

public int getWindowLength()
Returns the length of the peak picking window

Returns:
the peak picking window

setPeakIsolationWindow

public void setPeakIsolationWindow(int val)
Sets the length of the peak isolation window

Parameters:
val - the new peak isolation window

getPeakIsolationWindow

public int getPeakIsolationWindow()
Returns the length of the peak isolation window

Returns:
the peak isolation window

setOutputAsDoubles

public void setOutputAsDoubles(boolean val)
Sets the outputAsDoubles flag which controls whether the onsets are output as integers or doubles

Parameters:
val - the outputAsDoubles flag

getOutputAsDoubles

public boolean getOutputAsDoubles()
Returns the outputAsDoubles flag which controls whether the onsets are output as integers or doubles

Returns:
the outputAsDoubles flag

getPropertiesDescriptions

public ncsa.d2k.core.modules.PropertyDescription[] getPropertiesDescriptions()
Returns an array of description objects for each property of the Module.

Returns:
an array of description objects for each property of the Module.

isReady

public boolean isReady()
Controls whether the module is able to run based on the input flags

Returns:
boolean flag indicating whether module is ready to run

doit

protected void doit()
             throws java.lang.Exception
Uses a moving median threshold of the input onset detection function to identify onsets in an audio signal.

Throws:
java.lang.Exception - if an error occurs

getModuleName

public java.lang.String getModuleName()
Returns the module name

Returns:
the module name

getModuleInfo

public java.lang.String getModuleInfo()
Returns the module info

Returns:
the module info

getInputName

public java.lang.String getInputName(int i)
Returns name for specified input

Parameters:
i - Input number
Returns:
returned name

getInputInfo

public java.lang.String getInputInfo(int i)
Returns info string for specified input

Parameters:
i - input number
Returns:
info string

getInputTypes

public java.lang.String[] getInputTypes()
Returns fully qualified names for inputs

Returns:
fully qualified names for inputs

getOutputName

public java.lang.String getOutputName(int i)
Returns the name of the specified output

Parameters:
i - output number
Returns:
The name of the specified output

getOutputInfo

public java.lang.String getOutputInfo(int i)
Returns info string for specified output

Parameters:
i - output number
Returns:
info string

getOutputTypes

public java.lang.String[] getOutputTypes()
Returns fully qualified names for outputs

Returns:
fully qualified names for outputs