com.icdif.audio.analysis
Class PeakDetector

java.lang.Object
  extended by com.icdif.audio.analysis.PeakDetector

public class PeakDetector
extends java.lang.Object

This class receives the SpectralDifference and calculates the Peaks. In order to do this, first it calculates the threshold values, then it chooses from the SpectralDifference the values bigger than the threshold and, finally, it selects the peaks from this last array

Author:
wanderer

Constructor Summary
PeakDetector(java.util.ArrayList<java.lang.Float> spectralFlux)
          Instantiates the class by passing the spectral Flux that'll be used to calculate the threshold
 
Method Summary
 void calcPeaks()
          Fills the array containing the peaks.
 java.util.ArrayList<java.lang.Float> getFilteredSpectralFlux()
           
 java.util.ArrayList<java.lang.Float> getPeaks()
           
 java.util.ArrayList<java.lang.Float> getSpectralFlux()
           
 java.util.ArrayList<java.lang.Float> getThreshold()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PeakDetector

public PeakDetector(java.util.ArrayList<java.lang.Float> spectralFlux)
Instantiates the class by passing the spectral Flux that'll be used to calculate the threshold

Parameters:
spectralFlux -
Method Detail

calcPeaks

public void calcPeaks()
Fills the array containing the peaks. Any value > 0 in this array is a peak. In order to calculate the peaks, it also needs to calculate the threshold and the filtered Spectral Flux as intermediate steps.


getSpectralFlux

public java.util.ArrayList<java.lang.Float> getSpectralFlux()
Returns:
the spectralFlux

getThreshold

public java.util.ArrayList<java.lang.Float> getThreshold()
Returns:
the threshold

getFilteredSpectralFlux

public java.util.ArrayList<java.lang.Float> getFilteredSpectralFlux()
Returns:
the filteredSpectralFlux

getPeaks

public java.util.ArrayList<java.lang.Float> getPeaks()
Returns:
the peaks