Package clipgenerator

Class ClipSpectrogram

java.lang.Object
clipgenerator.ClipSpectrogram
Direct Known Subclasses:
ClickSpectrogram

public class ClipSpectrogram extends Object
Creates and stores a spectrogram image for a wave file snippet. Usually used with small snippets of wave data rather than continious raw data.
Author:
Jamie Macaulay
  • Field Details

    • fastFFT

      public FastFFT fastFFT
      A fast fourier transform class.
  • Constructor Details

    • ClipSpectrogram

      public ClipSpectrogram(PamDataUnit clickDetection)
  • Method Details

    • getSpectrogram

      public ArrayList<double[][]> getSpectrogram()
      Get the spectrogram
      Returns:
      the spectrogram for each channel
    • getSpectrogram

      public double[][] getSpectrogram(int ichan)
      Get the spectrogram for a given channel
      Parameters:
      iChan - - the relative channel number.
      Returns:
      the spectrogram for each channel
    • getFFTHop

      public int getFFTHop()
      Get the FFT hope in samples.
      Returns:
      the FFT hop.
    • getFFTSize

      public int getFFTSize()
      Get the FFT size in samples.
      Returns:
      the FFT size
    • calcSpectrogram

      public void calcSpectrogram(double[][] waveData, int fftLength, int fftHop, int windowType)
      Calculate the click spectrum for all channels.
      Parameters:
      waveData - - the raw data for each channel
    • specTransform

      public ComplexArray specTransform(double[] waveChunk)
      Apply a transforms to the raw data to convert from time to frequency/phase domain.
      Parameters:
      wavChunk - - the raw windowed chunk of data (i.e. after hanning window has been applied)
      len - - the len of the transform e.g. FFT length
      Returns:
      the ComplexArray with transformed data.
    • getWindowType

      public int getWindowType()
      Get the last used window type.
      Returns:
      the window type @see WindowFunction.getWindowFunc(windowType, fftLength);