|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.icdif.audio.analysis.SpectralDifference
public class SpectralDifference
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.
Constructor Summary | |
---|---|
SpectralDifference(AudioDecoder decoder,
int sampleWindowSize,
int hopSize,
boolean isHamming,
int sampleRate)
Initiates this class, by supplying the the parameters needed |
Method Summary | |
---|---|
FFT |
getFft()
Gets the instance of the FFT used for calculus |
java.util.ArrayList<java.lang.Float> |
getSpectralDifference()
Gets the Spectral Difference (a function that measures how quickly the power spectrum of a signal is changing) |
java.util.ArrayList<java.lang.Float> |
getTotalSamples()
Gets the total samples used to calculate the Spectral Difference |
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 |
---|
public SpectralDifference(AudioDecoder decoder, int sampleWindowSize, int hopSize, boolean isHamming, int sampleRate)
decoder
- The AudioDecoder that will supply the samplessampleWindowSize
- The size of the windowhopSize
- 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 FunctionsampleRate
- The sample rate of the audioMethod Detail |
---|
public float[] nextSpectrum()
public FFT getFft()
public java.util.ArrayList<java.lang.Float> getSpectralDifference()
public java.util.ArrayList<java.lang.Float> getTotalSamples()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |