Class SpectrogramGenerator
This analyzer simply generates short (i.e. one minute) spectrograms and outputs them to CSV files.
It does not accumulate data or other indices over a long recording.
Inheritance
SpectrogramGenerator
Assembly: AnalysisPrograms.dll
Syntax
public class SpectrogramGenerator : IAnalyser2, ICiteable, IHasStatus
Constructors
|
Improve this Doc
View Source
SpectrogramGenerator()
Declaration
public SpectrogramGenerator()
Properties
|
Improve this Doc
View Source
DefaultSettings
Declaration
public AnalysisSettings DefaultSettings { get; }
Property Value
|
Improve this Doc
View Source
Description
Declaration
public string Description { get; }
Property Value
|
Improve this Doc
View Source
DisplayName
Declaration
public string DisplayName { get; }
Property Value
|
Improve this Doc
View Source
Identifier
Declaration
public string Identifier { get; }
Property Value
|
Improve this Doc
View Source
Status
Declaration
public Status Status { get; }
Property Value
Methods
|
Improve this Doc
View Source
Analyze<T>(AnalysisSettings, SegmentSettings<T>)
Declaration
public AnalysisResult2 Analyze<T>(AnalysisSettings analysisSettings, SegmentSettings<T> segmentSettings)
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
BeforeAnalyze(AnalysisSettings)
Declaration
public void BeforeAnalyze(AnalysisSettings analysisSettings)
Parameters
|
Improve this Doc
View Source
ConvertEventsToSummaryIndices(IEnumerable<EventBase>, TimeSpan, TimeSpan, Double)
Declaration
public SummaryIndexBase[] ConvertEventsToSummaryIndices(IEnumerable<EventBase> events, TimeSpan unitTime, TimeSpan duration, double scoreThreshold)
Parameters
Returns
|
Improve this Doc
View Source
GenerateSpectrogramImages(FileInfo, SpectrogramGeneratorConfig, String)
Calculates the following spectrograms as per settings in the Images array in the config file: Towsey.SpectrogramGenerator.yml:
Waveform.
DecibelSpectrogram.
DecibelSpectrogramNoiseReduced.
MelScaleSpectrogram
Cepstrogram.
OctaveScaleSpectrogram
RibbonSpectrogram.
DifferenceSpectrogram.
AmplitudeSpectrogramLocalContrastNormalization.
Experimental.
Comment the config.yml file with a hash, those spectrograms that are not required.
Declaration
public static AudioToSonogramResult GenerateSpectrogramImages(FileInfo sourceRecording, SpectrogramGeneratorConfig config, string sourceRecordingName)
Parameters
Type |
Name |
Description |
FileInfo |
sourceRecording |
The name of the original recording.
|
SpectrogramGeneratorConfig |
config |
Contains parameter info to make spectrograms.
|
String |
sourceRecordingName |
.Name of source recording. Required only spectrogram labels.
|
Returns
|
Improve this Doc
View Source
Returns a cepstrogram image.
Declaration
public static Image<Rgb24> GetCepstrogram(SonogramConfig config, AudioRecording recording, string sourceRecordingName)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
AN EXPERIMENTAL SPECTROGRAM - A FALSE-COLOR VERSION OF A standard scale SPECTROGRAM.
Declaration
public static Image<Rgb24> GetDecibelSpectrogram_Ridges(double[, ] dbSpectrogramData, SpectrogramStandard nrSpectrogram, string sourceRecordingName)
Parameters
Type |
Name |
Description |
Double[,] |
dbSpectrogramData |
The original data for decibel spectrogram.
|
SpectrogramStandard |
nrSpectrogram |
The noise-reduced spectrogram.
|
String |
sourceRecordingName |
Name of the source file. Required only to add label to spectrogram.
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
Image of spectrogram.
|
|
Improve this Doc
View Source
GetDifferenceSpectrogram(Double[,], Double)
Declaration
public static Image<Rgb24> GetDifferenceSpectrogram(double[, ] spectrogramData, double threshold)
Parameters
Type |
Name |
Description |
Double[,] |
spectrogramData |
|
Double |
threshold |
|
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Declaration
public static Image<Rgb24> GetLcnSpectrogram(SonogramConfig sonoConfig, AudioRecording recordingSegment, string sourceRecordingName, double neighbourhoodSeconds, double lcnContrastLevel)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Declaration
public static SpectrogramStandard GetLinearReducedSpectrogram(SonogramConfig sgConfig, AudioRecording recording)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static Image<Rgb24> GetMelScaleSpectrogram(SonogramConfig sonoConfig, AudioRecording recording, string sourceRecordingName)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Declaration
public static SpectrogramOctaveScale GetOctaveReducedSpectrogram(SonogramConfig sgConfig, AudioRecording recording)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static Image<Rgb24> GetOctaveScaleSpectrogram(SonogramConfig sgConfig, FrequencyScale freqScale, AudioRecording recording, string sourceRecordingName)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Declaration
public static Image<Rgb24> GetRibbonSpectrograms(SonogramConfig sgConfig, AudioRecording recording, string sourceRecordingName)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
Declaration
public static Image<Rgb24> GetWaveformImage(double[] minValues, double[] maxValues, int imageHeight)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> |
|
|
Improve this Doc
View Source
ParseConfig(FileInfo)
Declaration
public AnalyzerConfig ParseConfig(FileInfo file)
Parameters
Returns
|
Improve this Doc
View Source
SummariseResults(AnalysisSettings, FileSegment, EventBase[], SummaryIndexBase[], SpectralIndexBase[], AnalysisResult2[])
Declaration
public void SummariseResults(AnalysisSettings settings, FileSegment inputFileSegment, EventBase[] events, SummaryIndexBase[] indices, SpectralIndexBase[] spectralIndices, AnalysisResult2[] results)
Parameters
|
Improve this Doc
View Source
WriteEventsFile(FileInfo, IEnumerable<EventBase>)
Declaration
public void WriteEventsFile(FileInfo destination, IEnumerable<EventBase> results)
Parameters
|
Improve this Doc
View Source
WriteSpectrumIndicesFiles(DirectoryInfo, String, IEnumerable<SpectralIndexBase>)
Declaration
public List<FileInfo> WriteSpectrumIndicesFiles(DirectoryInfo destination, string fileNameBase, IEnumerable<SpectralIndexBase> results)
Parameters
Returns
|
Improve this Doc
View Source
WriteSummaryIndicesFile(FileInfo, IEnumerable<SummaryIndexBase>)
Declaration
public void WriteSummaryIndicesFile(FileInfo destination, IEnumerable<SummaryIndexBase> results)
Parameters
Implements
Extension Methods