Class Histogram
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.audiofeaturegenerator.AbstractAudioFeatureGenerator<WaveContainer>
-
- adams.data.audiofeaturegenerator.wave.AbstractWaveFeatureGenerator
-
- adams.data.audiofeaturegenerator.wave.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 Summary
Fields Modifier and Type Field Description protected adams.data.statistics.ArrayHistogram.BinCalculationm_BinCalculationhow to calculate the number of bins.protected doublem_BinWidththe bin width - used for some calculations.protected booleanm_DisplayRangeswhether to use the ranges as bin description.protected doublem_ManualMaxthe manual maximum.protected doublem_ManualMinthe manual minimum.protected booleanm_Normalizewhether to normalize the data.protected intm_NumBinsthe number of bins in case of manual bin calculation.protected intm_NumDecimalsthe number of decimals to show.protected booleanm_UseFixedMinMaxwhether to use fixed min/max for manual bin calculation.-
Fields inherited from class adams.data.audiofeaturegenerator.AbstractAudioFeatureGenerator
m_Converter, m_Fields, m_Notes, m_Prefix
-
-
Constructor Summary
Constructors Constructor Description Histogram()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringbinCalculationTipText()Returns the tip text for this property.StringbinWidthTipText()Returns the tip text for this property.protected adams.data.statistics.ArrayHistogramconfigure()Configures the histogram algorithm.adams.data.featureconverter.HeaderDefinitioncreateHeader(WaveContainer cont)Creates the header from a template container.voiddefineOptions()Adds options to the internal list of options.StringdisplayRangesTipText()Returns the tip text for this property.List<Object>[]generateRows(WaveContainer cont)Performs the actual feature generation.adams.data.statistics.ArrayHistogram.BinCalculationgetBinCalculation()Returns how the number of bins is calculated.doublegetBinWidth()Returns the bin width in use (for some calculations).booleangetDisplayRanges()Returns whether to use the bin ranges as their description rather than a simple index.doublegetManualMax()Returns the maximum to use when using manual binning with user-supplied max/max enabled.doublegetManualMin()Returns the minimum to use when using manual binning with user-supplied min/max enabled.booleangetNormalize()Returns whether to normalize the data before generating the histogram.intgetNumBins()Returns the number of bins to use in manual calculation.intgetNumDecimals()Returns the number of decimals to show in the bin description.booleangetUseFixedMinMax()Returns whether to use user-supplied min/max for bin calculation rather than obtain min/max from data.StringglobalInfo()Returns a string describing the object.StringmanualMaxTipText()Returns the tip text for this property.StringmanualMinTipText()Returns the tip text for this property.StringnormalizeTipText()Returns the tip text for this property.StringnumBinsTipText()Returns the tip text for this property.StringnumDecimalsTipText()Returns the tip text for this property.voidsetBinCalculation(adams.data.statistics.ArrayHistogram.BinCalculation value)Sets how the number of bins is calculated.voidsetBinWidth(double value)Sets the bin width to use (for some calculations).voidsetDisplayRanges(boolean value)Sets whether to use the bin ranges as their description rather than a simple index.voidsetManualMax(double value)Sets the maximum to use when using manual binning with user-supplied max/max enabled.voidsetManualMin(double value)Sets the minimum to use when using manual binning with user-supplied min/max enabled.voidsetNormalize(boolean value)Sets whether to normalize the data before generating the histogram.voidsetNumBins(int value)Sets the number of bins to use in manual calculation.voidsetNumDecimals(int value)Sets the number of decimals to show in the bin description.voidsetUseFixedMinMax(boolean value)Sets whether to use user-supplied min/max for bin calculation rather than obtain min/max from data.StringuseFixedMinMaxTipText()Returns the tip text for this property.-
Methods inherited from class adams.data.audiofeaturegenerator.AbstractAudioFeatureGenerator
checkData, cleanUp, compareTo, converterTipText, destroy, equals, fieldsTipText, generate, getConverter, getDatasetFormat, getFields, getNotes, getPrefix, getRowFormat, notesTipText, postProcessHeader, postProcessRow, postProcessRows, prefixTipText, reset, setConverter, setFields, setNotes, setPrefix, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
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.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.core.option.AbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classAbstractAudioFeatureGenerator<WaveContainer>
-
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
-
createHeader
public adams.data.featureconverter.HeaderDefinition createHeader(WaveContainer cont)
Creates the header from a template container.- Specified by:
createHeaderin classAbstractAudioFeatureGenerator<WaveContainer>- Parameters:
cont- the container to act as a template- Returns:
- the generated header
-
generateRows
public List<Object>[] generateRows(WaveContainer cont)
Performs the actual feature generation.- Specified by:
generateRowsin classAbstractAudioFeatureGenerator<WaveContainer>- Parameters:
cont- the container to process- Returns:
- the generated features
-
-