marytts.signalproc.analysis
Class ShortTermLogSpectrumAnalyser

java.lang.Object
  extended by marytts.signalproc.process.FrameProvider
      extended by marytts.signalproc.analysis.FrameBasedAnalyser
          extended by marytts.signalproc.analysis.ShortTermSpectrumAnalyser
              extended by marytts.signalproc.analysis.ShortTermLogSpectrumAnalyser

public class ShortTermLogSpectrumAnalyser
extends ShortTermSpectrumAnalyser

Author:
Marc Schröder Implements a frame based log spectrum analyser

Nested Class Summary
 
Nested classes/interfaces inherited from class marytts.signalproc.analysis.FrameBasedAnalyser
FrameBasedAnalyser.FrameAnalysisResult<T>
 
Field Summary
 
Fields inherited from class marytts.signalproc.analysis.ShortTermSpectrumAnalyser
real
 
Fields inherited from class marytts.signalproc.analysis.FrameBasedAnalyser
analysisResults
 
Fields inherited from class marytts.signalproc.process.FrameProvider
frame, frameLength, frameShift, frameStart, nextFrameStart, processor, samplingRate, signal, totalRead, validSamplesInFrame
 
Constructor Summary
ShortTermLogSpectrumAnalyser(DoubleDataSource signal, int fftSize, Window window, int frameShift, int samplingRate)
          Initialise a FrameBasedAnalyser.
 
Method Summary
 java.lang.Object analyse(double[] frame)
          Apply this FrameBasedAnalyser to the given data.
 
Methods inherited from class marytts.signalproc.analysis.ShortTermSpectrumAnalyser
getFFTWindowLength, getFrequencyResolution
 
Methods inherited from class marytts.signalproc.analysis.FrameBasedAnalyser
analyseAllFrames, analyseAvailableFrames, analyseNextFrame, constructAnalysisResult
 
Methods inherited from class marytts.signalproc.process.FrameProvider
getCurrentFrame, getData, getFrameLengthSamples, getFrameLengthTime, getFrameShiftSamples, getFrameShiftTime, getFrameStartSamples, getFrameStartTime, getNextFrame, getSamplingRate, hasMoreData, main, resetInternalTimer, stopWhenTouchingEnd, validSamplesInFrame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShortTermLogSpectrumAnalyser

public ShortTermLogSpectrumAnalyser(DoubleDataSource signal,
                                    int fftSize,
                                    Window window,
                                    int frameShift,
                                    int samplingRate)
Initialise a FrameBasedAnalyser.

Parameters:
signal - the signal source to read from
fftSize - the size of the FFT to use
window - the window function to apply to each frame
frameShift - the number of samples by which to shift the window from one frame analysis to the next; if this is smaller than window.getLength(), frames will overlap.
samplingRate - the number of samples in one second.
Throws:
java.lang.IllegalArgumentException - if the window is longer than fftSize, or fftSize is not a power of two.
Method Detail

analyse

public java.lang.Object analyse(double[] frame)
Apply this FrameBasedAnalyser to the given data.

Overrides:
analyse in class ShortTermSpectrumAnalyser
Parameters:
frame - the data to analyse, which must be of the length prescribed by this FrameBasedAnalyser, i.e. by @see{#getFrameLengthSamples()}.
Returns:
a double array of half the frame length
Throws:
java.lang.IllegalArgumentException - if frame does not have the prescribed length