Package adams.data.spectrumimage
Class Spectrogram
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.spectrumimage.AbstractSpectrumImageGenerator
-
- adams.data.spectrumimage.AbstractSpectrumImageGeneratorWithRange
-
- adams.data.spectrumimage.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 Summary
Fields Modifier and Type Field Description protected SpectrumToBufferedImage
m_Convertor
The conversion that does the actual work.protected int
m_FFTSampleSize
the FFT sample size (power of 2).protected adams.gui.visualization.core.ColorGradientGenerator
m_Generator
the generator to use.protected int
m_OverlapFactor
the overlap factor (1/factor).-
Fields inherited from class adams.data.spectrumimage.AbstractSpectrumImageGeneratorWithRange
m_MaxAmplitude, m_MinAmplitude
-
Fields inherited from class adams.data.spectrumimage.AbstractSpectrumImageGenerator
m_ImageType
-
-
Constructor Summary
Constructors Constructor Description Spectrogram()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
check(Spectrum spectrum)
Hook method for checks before generating the image.void
defineOptions()
Adds options to the internal list of options.protected BufferedImage
doGenerate(Spectrum spectrum)
Converts the spectrum into an image.protected void
ensureConvertor()
Makes sure the convertor is available and configured for use.String
FFTSampleSizeTipText()
Returns the tip text for this property.String
generatorTipText()
Returns the tip text for this property.int
getFFTSampleSize()
Returns the FFT sample size (power of 2).adams.gui.visualization.core.ColorGradientGenerator
getGenerator()
Returns the color generator.int
getOverlapFactor()
Returns the overlap factor (1/factor).String
globalInfo()
Returns a string describing the object.String
overlapFactorTipText()
Returns the tip text for this property.protected void
reset()
Resets the object.void
setFFTSampleSize(int value)
Sets the FFT sample size (power of 2).void
setGenerator(adams.gui.visualization.core.ColorGradientGenerator value)
Sets the color generator.void
setOverlapFactor(int value)
Sets the overlap factor (1/factor).-
Methods inherited from class adams.data.spectrumimage.AbstractSpectrumImageGeneratorWithRange
getDefaultMaxAmplitude, getDefaultMinAmplitude, getLowerMaxAmplitude, getLowerMinAmplitude, getMaxAmplitude, getMinAmplitude, getUpperMaxAmplitude, getUpperMinAmplitude, maxAmplitudeTipText, minAmplitudeTipText, rangeCheck, setMaxAmplitude, setMinAmplitude
-
Methods inherited from class adams.data.spectrumimage.AbstractSpectrumImageGenerator
generate, getImageType, imageTypeTipText, newImage, setImageType, setPixel
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, 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_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.
-
m_Convertor
protected transient SpectrumToBufferedImage m_Convertor
The conversion that does the actual work.
-
-
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 classAbstractSpectrumImageGeneratorWithRange
-
reset
protected void reset()
Resets the object.- Overrides:
reset
in classadams.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.
-
check
protected String check(Spectrum spectrum)
Hook method for checks before generating the image.- Overrides:
check
in classAbstractSpectrumImageGeneratorWithRange
- Parameters:
spectrum
- the spectrum to check- Returns:
- null if successful, otherwise the error message
-
doGenerate
protected BufferedImage doGenerate(Spectrum spectrum)
Converts the spectrum into an image.- Specified by:
doGenerate
in classAbstractSpectrumImageGenerator
- Parameters:
spectrum
- the spectrum to convert- Returns:
- the generated image
-
ensureConvertor
protected void ensureConvertor()
Makes sure the convertor is available and configured for use.
-
-