Class Spectrogram
- 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.Spectrogram
-
- 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.QuickInfoSupporter
,adams.core.ShallowCopySupporter<AbstractAudioFeatureGenerator>
,adams.core.SizeOfHandler
,Serializable
,Comparable
public class Spectrogram extends AbstractWaveFeatureGenerator implements adams.core.QuickInfoSupporter
Generates a spectrogram 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 int
m_FFTSampleSize
the FFT sample size (power of 2).protected boolean
m_Normalized
whether to return the normalized spectrogram.protected int
m_OverlapFactor
the overlap factor (1/factor).-
Fields inherited from class adams.data.audiofeaturegenerator.AbstractAudioFeatureGenerator
m_Converter, m_Fields, m_Notes, m_Prefix
-
-
Constructor Summary
Constructors Constructor Description Spectrogram()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
FFTSampleSizeTipText()
Returns the tip text for this property.List<Object>[]
generateRows(WaveContainer cont)
Performs the actual feature generation.int
getFFTSampleSize()
Returns the FFT samepl size (power of 2).boolean
getNormalized()
Returns whether to use normalized or absolute spectrogram.int
getOverlapFactor()
Returns the overlap factor (1/factor).String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.String
globalInfo()
Returns a string describing the object.String
normalizedTipText()
Returns the tip text for this property.String
overlapFactorTipText()
Returns the tip text for this property.void
setFFTSampleSize(int value)
Sets the FFT sample size (power of 2).void
setNormalized(boolean value)
Sets whether to use normalized or absolute spectrogram.void
setOverlapFactor(int value)
Sets the overlap factor (1/factor).-
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
-
-
-
-
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>
-
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 samepl 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.
-
setNormalized
public void setNormalized(boolean value)
Sets whether to use normalized or absolute spectrogram.- Parameters:
value
- true if to use normalized spectrogram
-
getNormalized
public boolean getNormalized()
Returns whether to use normalized or absolute spectrogram.- Returns:
- true if to use normalized spectrogram
-
normalizedTipText
public String normalizedTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceadams.core.QuickInfoSupporter
- Returns:
- null if no info available, otherwise short string
-
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
-
-