com.icdif.audio.analysis
Class PhaseDeviation

java.lang.Object
  extended by com.icdif.audio.analysis.DetectionFunction
      extended by com.icdif.audio.analysis.PhaseDeviation

public class PhaseDeviation
extends DetectionFunction

A class that detects the onset using the PhaseDeviation (PD) method originally proposed by Bello et al and later refined by Simon Dixon by using weighting (WPD)

Author:
wanderer

Constructor Summary
PhaseDeviation(AudioDecoder decoder, int sampleWindowSize, int hopSize, boolean isHamming)
          Initiates this class, by supplying the parameters needed
PhaseDeviation(AudioDecoder decoder, int sampleWindowSize, int hopSize, boolean isHamming, boolean useWeighting)
          Initiates this class, by supplying the parameters needed and giving the chance to behave like a Weighted Phase Deviation method
PhaseDeviation(AudioDecoder decoder, int sampleWindowSize, int hopSize, boolean isHamming, boolean useWeighting, boolean useNormalization)
          Initiates this class, by supplying the parameters needed and giving the chance to behave like a Normalised Weighted Phase Deviation method
 
Method Summary
 void calcPhaseDeviation()
          Calculate and sets the phase deviation
 java.util.ArrayList<java.lang.Float> getDetectionFunction()
          Abstract class that returns the values of the detection function
 java.util.ArrayList<java.lang.Float> getPD()
          deprecated, use getDetectionFunction() instead
 
Methods inherited from class com.icdif.audio.analysis.DetectionFunction
getFft, nextPhase, nextSpectrum
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhaseDeviation

public PhaseDeviation(AudioDecoder decoder,
                      int sampleWindowSize,
                      int hopSize,
                      boolean isHamming)
Initiates this class, by supplying the parameters needed

Parameters:
decoder - The AudioDecoder that will decode the samples
sampleWindowSize - The size of the window
hopSize - The size of the overlap (it has to be minor than the sampleWindow)
isHamming - If the samples are to be smoothed in the FFT by the use of the Hamming Function

PhaseDeviation

public PhaseDeviation(AudioDecoder decoder,
                      int sampleWindowSize,
                      int hopSize,
                      boolean isHamming,
                      boolean useWeighting)
Initiates this class, by supplying the parameters needed and giving the chance to behave like a Weighted Phase Deviation method

Parameters:
decoder - The AudioDecoder that will decode the samples
sampleWindowSize - The size of the window
hopSizeThe - size of the overlap (it has to be minor than the sampleWindow)
isHamming - If the samples are to be smoothed in the FFT by the use of the Hamming Function
useWeighting - Whether weighting of the phase deviation is used. If true, the method is called Weighted Phase Deviation (WPD)

PhaseDeviation

public PhaseDeviation(AudioDecoder decoder,
                      int sampleWindowSize,
                      int hopSize,
                      boolean isHamming,
                      boolean useWeighting,
                      boolean useNormalization)
Initiates this class, by supplying the parameters needed and giving the chance to behave like a Normalised Weighted Phase Deviation method

Parameters:
decoder - The AudioDecoder that will decode the samples
sampleWindowSize - The size of the window
hopSizeThe - size of the overlap (it has to be minor than the sampleWindow)
isHamming - If the samples are to be smoothed in the FFT by the use of the Hamming Function
useWeighting - Whether weighting of the phase deviation is used. If true, the method is called Weighted Phase Deviation (WPD)
useNormalization - Whether normalization of the weighted phase deviation if used. If true, it's called Normalised Weighted Phase Deviation (NWPD)
Method Detail

calcPhaseDeviation

public void calcPhaseDeviation()
Calculate and sets the phase deviation


getPD

public java.util.ArrayList<java.lang.Float> getPD()
deprecated, use getDetectionFunction() instead

Returns:

getDetectionFunction

public java.util.ArrayList<java.lang.Float> getDetectionFunction()
Description copied from class: DetectionFunction
Abstract class that returns the values of the detection function

Specified by:
getDetectionFunction in class DetectionFunction
Returns:
the values of the detection function