Class Spectrogram

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, Serializable

    public class Spectrogram
    extends AbstractSpectrumImageGeneratorWithRange
    Generates a spectrogram image of the spectrum.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -image-type <GRAY|RGB> (property: imageType)
        The type of image to generate; also determines the resolution: gray=8bit,
         rgb=24bit.
        default: RGB
     
    -min-amplitude <float> (property: minAmplitude)
        The minimum amplitude to assume; amplitudes below get set to this value.
        default: 0.0
     
    -max-amplitude <float> (property: maxAmplitude)
        The maximum amplitude to assume; amplitudes below get set to this value.
        default: 1000.0
     
    -fft-sample-size <int> (property: FFTSampleSize)
        The sample size for the fast fourier transformation; must be a power of
        2.
        default: 1024
        minimum: 2
     
    -overlap-factor <int> (property: overlapFactor)
        The overlap factor (1/factor), eg 4 = 1/4 = 25%; 0 = no overlap.
        default: 0
        minimum: 0
     
    -generator <adams.gui.visualization.core.ColorGradientGenerator> (property: generator)
        The generator to use for creating the gradient colors.
        default: adams.gui.visualization.core.BiColorGenerator
     
    Generates a spectrogram image of the spectrum.
    Author:
    Corey Sterling (csterlin at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_FFTSampleSize

        protected int m_FFTSampleSize
        the FFT sample size (power of 2).
      • m_OverlapFactor

        protected int m_OverlapFactor
        the overlap factor (1/factor).
      • m_Generator

        protected adams.gui.visualization.core.ColorGradientGenerator m_Generator
        the generator to use.
    • Constructor Detail

      • Spectrogram

        public Spectrogram()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • reset

        protected void reset()
        Resets the object.
        Overrides:
        reset in class adams.core.option.AbstractOptionHandler
      • setFFTSampleSize

        public void setFFTSampleSize​(int value)
        Sets the FFT sample size (power of 2).
        Parameters:
        value - the sample size
      • getFFTSampleSize

        public int getFFTSampleSize()
        Returns the FFT sample size (power of 2).
        Returns:
        the sample size
      • FFTSampleSizeTipText

        public String FFTSampleSizeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setOverlapFactor

        public void setOverlapFactor​(int value)
        Sets the overlap factor (1/factor).
        Parameters:
        value - the factor
      • getOverlapFactor

        public int getOverlapFactor()
        Returns the overlap factor (1/factor).
        Returns:
        the factor
      • overlapFactorTipText

        public String overlapFactorTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setGenerator

        public void setGenerator​(adams.gui.visualization.core.ColorGradientGenerator value)
        Sets the color generator.
        Parameters:
        value - the generator
      • getGenerator

        public adams.gui.visualization.core.ColorGradientGenerator getGenerator()
        Returns the color generator.
        Returns:
        the generator
      • generatorTipText

        public String generatorTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • ensureConvertor

        protected void ensureConvertor()
        Makes sure the convertor is available and configured for use.