com.icdif.audio.analysis
Class DetectionFunction

java.lang.Object
  extended by com.icdif.audio.analysis.DetectionFunction
Direct Known Subclasses:
PhaseDeviation, SpectralDifference

public abstract class DetectionFunction
extends java.lang.Object

Author:
wanderer

Constructor Summary
DetectionFunction(AudioDecoder decoder, int sampleWindowSize, int hopSize, boolean isHamming)
          Initiates this class, by supplying the parameters needed
 
Method Summary
abstract  java.util.ArrayList<java.lang.Float> getDetectionFunction()
          Abstract class that returns the values of the detection function
 FFT getFft()
          Gets the instance of the FFT used for calculus
 DetectionFunction.FFTComponents nextPhase()
          Calculates the Fourier Transform of the samples, by using the hoping margin defined in the constructor and returning the real and imaginary parts of the transform or null, when there is no more data to read.
 float[] nextSpectrum()
          Calculates the spectrum of the samples, by using the Fourier Transform and an hoping margin defined in the constructor, returning the spectrum or null, when there is no more data to read.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DetectionFunction

public DetectionFunction(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
Method Detail

nextSpectrum

public float[] nextSpectrum()
Calculates the spectrum of the samples, by using the Fourier Transform and an hoping margin defined in the constructor, returning the spectrum or null, when there is no more data to read.

Returns:
The next Spectrum or null

nextPhase

public DetectionFunction.FFTComponents nextPhase()
Calculates the Fourier Transform of the samples, by using the hoping margin defined in the constructor and returning the real and imaginary parts of the transform or null, when there is no more data to read.

Returns:
The Real and Imaginary part of the FFT or null

getFft

public FFT getFft()
Gets the instance of the FFT used for calculus

Returns:
the FFT instance used for calculus

getDetectionFunction

public abstract java.util.ArrayList<java.lang.Float> getDetectionFunction()
Abstract class that returns the values of the detection function

Returns:
the values of the detection function