com.icdif.audio.analysis
Class SpectralDifference

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

public class SpectralDifference
extends DetectionFunction

This class is meant to do the calculations needed to obtain a spectral difference (or spectral flux) function. The Spectral flux is a measure of how quickly the power spectrum of a signal is changing, calculated by comparing the power spectrum for one window against the power spectrum from the previous window.

Author:
wanderer

Constructor Summary
SpectralDifference(AudioDecoder decoder, int sampleWindowSize, int hopSize, boolean isHamming)
          Initiates this class, by supplying the parameters needed
 
Method Summary
 java.util.ArrayList<java.lang.Float> getDetectionFunction()
          Abstract class that returns the values of the detection function
 java.util.ArrayList<java.lang.Float> getSpectralDifference()
          Deprecated, use getDetectionFunctio() 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

SpectralDifference

public SpectralDifference(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

getSpectralDifference

public java.util.ArrayList<java.lang.Float> getSpectralDifference()
Deprecated, use getDetectionFunctio() instead

Returns:
the spectralDifference

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