Class Histogram

  • All Implemented Interfaces:
    adams.core.CleanUpHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.ShallowCopySupporter<AbstractAudioFeatureGenerator>, adams.core.SizeOfHandler, Serializable, Comparable

    public class Histogram
    extends AbstractWaveFeatureGenerator
    Generates a histogram from the audio data.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_BinCalculation

        protected adams.data.statistics.ArrayHistogram.BinCalculation m_BinCalculation
        how to calculate the number of bins.
      • m_NumBins

        protected int m_NumBins
        the number of bins in case of manual bin calculation.
      • m_BinWidth

        protected double m_BinWidth
        the bin width - used for some calculations.
      • m_Normalize

        protected boolean m_Normalize
        whether to normalize the data.
      • m_UseFixedMinMax

        protected boolean m_UseFixedMinMax
        whether to use fixed min/max for manual bin calculation.
      • m_ManualMin

        protected double m_ManualMin
        the manual minimum.
      • m_ManualMax

        protected double m_ManualMax
        the manual maximum.
      • m_DisplayRanges

        protected boolean m_DisplayRanges
        whether to use the ranges as bin description.
      • m_NumDecimals

        protected int m_NumDecimals
        the number of decimals to show.
    • Constructor Detail

      • Histogram

        public Histogram()
    • 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
      • setBinCalculation

        public void setBinCalculation​(adams.data.statistics.ArrayHistogram.BinCalculation value)
        Sets how the number of bins is calculated.
        Parameters:
        value - the bin calculation
      • getBinCalculation

        public adams.data.statistics.ArrayHistogram.BinCalculation getBinCalculation()
        Returns how the number of bins is calculated.
        Returns:
        the bin calculation
      • binCalculationTipText

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

        public void setNumBins​(int value)
        Sets the number of bins to use in manual calculation.
        Parameters:
        value - the number of bins
      • getNumBins

        public int getNumBins()
        Returns the number of bins to use in manual calculation.
        Returns:
        the number of bins
      • numBinsTipText

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

        public void setBinWidth​(double value)
        Sets the bin width to use (for some calculations).
        Parameters:
        value - the bin width
      • getBinWidth

        public double getBinWidth()
        Returns the bin width in use (for some calculations).
        Returns:
        the bin width
      • binWidthTipText

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

        public void setNormalize​(boolean value)
        Sets whether to normalize the data before generating the histogram.
        Parameters:
        value - if true the data gets normalized first
      • getNormalize

        public boolean getNormalize()
        Returns whether to normalize the data before generating the histogram.
        Returns:
        true if the data gets normalized first
      • normalizeTipText

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

        public void setUseFixedMinMax​(boolean value)
        Sets whether to use user-supplied min/max for bin calculation rather than obtain min/max from data.
        Parameters:
        value - true if to use user-supplied min/max
      • getUseFixedMinMax

        public boolean getUseFixedMinMax()
        Returns whether to use user-supplied min/max for bin calculation rather than obtain min/max from data.
        Returns:
        true if to use user-supplied min/max
      • useFixedMinMaxTipText

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

        public void setManualMin​(double value)
        Sets the minimum to use when using manual binning with user-supplied min/max enabled.
        Parameters:
        value - the minimum
      • getManualMin

        public double getManualMin()
        Returns the minimum to use when using manual binning with user-supplied min/max enabled.
        Returns:
        the minimum
      • manualMinTipText

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

        public void setManualMax​(double value)
        Sets the maximum to use when using manual binning with user-supplied max/max enabled.
        Parameters:
        value - the maximum
      • getManualMax

        public double getManualMax()
        Returns the maximum to use when using manual binning with user-supplied max/max enabled.
        Returns:
        the maximum
      • manualMaxTipText

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

        public void setDisplayRanges​(boolean value)
        Sets whether to use the bin ranges as their description rather than a simple index.
        Parameters:
        value - true if to display the ranges
      • getDisplayRanges

        public boolean getDisplayRanges()
        Returns whether to use the bin ranges as their description rather than a simple index.
        Returns:
        true if to display the ranges
      • displayRangesTipText

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

        public void setNumDecimals​(int value)
        Sets the number of decimals to show in the bin description.
        Parameters:
        value - the number of decimals
      • getNumDecimals

        public int getNumDecimals()
        Returns the number of decimals to show in the bin description.
        Returns:
        the number of decimals
      • numDecimalsTipText

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

        protected adams.data.statistics.ArrayHistogram configure()
        Configures the histogram algorithm.
        Returns:
        the algorithm