|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.icdif.audio.analysis.PeakDetector
public class PeakDetector
This class receives the Detection Function and calculates the Onsets. In order to do this, first it calculates the threshold values, then it chooses from the Detection Function the values bigger than the threshold and, finally, it selects the peaks from this last array
Constructor Summary | |
---|---|
PeakDetector(java.util.ArrayList<java.lang.Float> detectionFunction)
Instantiates the class by passing the spectral Flux that'll be used to calculate the threshold |
|
PeakDetector(java.util.ArrayList<java.lang.Float> detectionFunction,
int thresholdWindowSize,
float multiplier)
Instantiates this class by passing the spectral Flux and the parameters that'll be used to calculate the threshold and the peaks. |
Method Summary | |
---|---|
void |
calcPeaks()
Fills the array containing the peaks. |
java.util.ArrayList<java.lang.Float> |
getDetectionFunction()
|
java.util.ArrayList<java.lang.Float> |
getFilteredSpectralFlux()
|
java.util.ArrayList<java.lang.Double> |
getOnsets()
Gets the onsets as instants in time |
java.util.ArrayList<java.lang.Float> |
getPeaks()
An array containing the peaks and zeros |
java.util.ArrayList<java.lang.Double> |
getPeaksAsInstantsInTime(int spectralWindowSize,
int sampleRate)
Gets an array containing the time instants (in seconds) of every onset TODO: Cuidado q os parametros a receber aqui podem ser diferentes para outras funções de detecção |
java.util.ArrayList<java.lang.Float> |
getThreshold()
|
void |
printOnsetsToFile(java.lang.String filename)
Prints the time instants onsets to a file |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PeakDetector(java.util.ArrayList<java.lang.Float> detectionFunction)
detectionFunction
- public PeakDetector(java.util.ArrayList<java.lang.Float> detectionFunction, int thresholdWindowSize, float multiplier)
detectionFunction
- thresholdWindowSize
- - by default it is 10 samples in each sidemultiplier
- - by default it is 1.6Method Detail |
---|
public void calcPeaks()
public java.util.ArrayList<java.lang.Double> getPeaksAsInstantsInTime(int spectralWindowSize, int sampleRate)
spectralWindowSize
- the size of the spectral window, i.e., the hopsizesampleRate
- the sample rate of the signal
public void printOnsetsToFile(java.lang.String filename)
filename
- the full path of the file where to writepublic java.util.ArrayList<java.lang.Float> getDetectionFunction()
public java.util.ArrayList<java.lang.Float> getThreshold()
public java.util.ArrayList<java.lang.Float> getFilteredSpectralFlux()
public java.util.ArrayList<java.lang.Float> getPeaks()
public java.util.ArrayList<java.lang.Double> getOnsets()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |