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.BinCalculation
m_BinCalculation
how to calculate the number of bins.protected double
m_BinWidth
the bin width - used for some calculations.protected boolean
m_DisplayRanges
whether to use the ranges as bin description.protected double
m_ManualMax
the manual maximum.protected double
m_ManualMin
the manual minimum.protected boolean
m_Normalize
whether to normalize the data.protected int
m_NumBins
the number of bins in case of manual bin calculation.protected int
m_NumDecimals
the number of decimals to show.protected boolean
m_UseFixedMinMax
whether 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 String
binCalculationTipText()
Returns the tip text for this property.String
binWidthTipText()
Returns the tip text for this property.protected adams.data.statistics.ArrayHistogram
configure()
Configures the histogram algorithm.adams.data.featureconverter.HeaderDefinition
createHeader(WaveContainer cont)
Creates the header from a template container.void
defineOptions()
Adds options to the internal list of options.String
displayRangesTipText()
Returns the tip text for this property.List<Object>[]
generateRows(WaveContainer cont)
Performs the actual feature generation.adams.data.statistics.ArrayHistogram.BinCalculation
getBinCalculation()
Returns how the number of bins is calculated.double
getBinWidth()
Returns the bin width in use (for some calculations).boolean
getDisplayRanges()
Returns whether to use the bin ranges as their description rather than a simple index.double
getManualMax()
Returns the maximum to use when using manual binning with user-supplied max/max enabled.double
getManualMin()
Returns the minimum to use when using manual binning with user-supplied min/max enabled.boolean
getNormalize()
Returns whether to normalize the data before generating the histogram.int
getNumBins()
Returns the number of bins to use in manual calculation.int
getNumDecimals()
Returns the number of decimals to show in the bin description.boolean
getUseFixedMinMax()
Returns whether to use user-supplied min/max for bin calculation rather than obtain min/max from data.String
globalInfo()
Returns a string describing the object.String
manualMaxTipText()
Returns the tip text for this property.String
manualMinTipText()
Returns the tip text for this property.String
normalizeTipText()
Returns the tip text for this property.String
numBinsTipText()
Returns the tip text for this property.String
numDecimalsTipText()
Returns the tip text for this property.void
setBinCalculation(adams.data.statistics.ArrayHistogram.BinCalculation value)
Sets how the number of bins is calculated.void
setBinWidth(double value)
Sets the bin width to use (for some calculations).void
setDisplayRanges(boolean value)
Sets whether to use the bin ranges as their description rather than a simple index.void
setManualMax(double value)
Sets the maximum to use when using manual binning with user-supplied max/max enabled.void
setManualMin(double value)
Sets the minimum to use when using manual binning with user-supplied min/max enabled.void
setNormalize(boolean value)
Sets whether to normalize the data before generating the histogram.void
setNumBins(int value)
Sets the number of bins to use in manual calculation.void
setNumDecimals(int value)
Sets the number of decimals to show in the bin description.void
setUseFixedMinMax(boolean value)
Sets whether to use user-supplied min/max for bin calculation rather than obtain min/max from data.String
useFixedMinMaxTipText()
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:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in 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:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in 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:
createHeader
in 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:
generateRows
in classAbstractAudioFeatureGenerator<WaveContainer>
- Parameters:
cont
- the container to process- Returns:
- the generated features
-
-