Class ContentSignatures
This class contains methods which use functional templates to scan one or multiple files to obtain a content description.
For consistency between recordings many parameters such as sample rate, frame size etc, must be declared as constants.
In addition, the absolute values in the template description dictionary must be normalised using the fixed set of normalization bounds in IndexValueBounds.
Note that each functional template uses one of a small number of algorithms to calculate a similarity value.
Inheritance
ContentSignatures
Assembly: AudioAnalysisTools.dll
Syntax
public class ContentSignatures
Fields
|
Improve this Doc
View Source
AnalysisString
Declaration
public const string AnalysisString = "__Towsey.Acoustic."
Field Value
|
Improve this Doc
View Source
FrameSize
Declaration
public const int FrameSize = 512
Field Value
|
Improve this Doc
View Source
FreqBinCount
Declaration
public const int FreqBinCount = 256
Field Value
|
Improve this Doc
View Source
IndexCalculationDurationInSeconds
Declaration
public const int IndexCalculationDurationInSeconds = 60
Field Value
|
Improve this Doc
View Source
IndexValueBounds
The following min and max bounds are same as those defined in the IndexPropertiesConfig.yml file as of August 2019.
Declaration
public static Dictionary<string, double[]> IndexValueBounds
Field Value
|
Improve this Doc
View Source
Nyquist
Declaration
public const int Nyquist = 11025
Field Value
|
Improve this Doc
View Source
SampleRate
Declaration
public const int SampleRate = 22050
Field Value
Properties
|
Improve this Doc
View Source
IndexNames
Gets an array of six spectral indices that are calculated.
Declaration
public static string[] IndexNames { get; }
Property Value
|
Improve this Doc
View Source
UnusedIndexNames
Gets an array containing names of spectral indices that are not wanted. They are used to remove unwanted selectors.
This is a temporary arrangement to utilize existing code.
TODO Eventually separate out template results so do not have to use the AnalysisResult2 class.
ToDO: this should now be deleteable.
Declaration
public static string[] UnusedIndexNames { get; }
Property Value
Methods
|
Improve this Doc
View Source
AnalyzeMinutes(FunctionalTemplate[], Dictionary<String, Dictionary<String, Double[]>>, Dictionary<String, Double[,]>, Int32)
Declaration
public static List<DescriptionResult> AnalyzeMinutes(FunctionalTemplate[] templates, Dictionary<string, Dictionary<string, double[]>> templatesAsDictionary, Dictionary<string, double[, ]> dictionaryOfRecordingIndices, int elapsedMinutesAtStart)
Parameters
Returns
|
Improve this Doc
View Source
AnalyzeOneMinute(FunctionalTemplate[], Dictionary<String, Dictionary<String, Double[]>>, Dictionary<String, Double[]>, Int32)
IMPORTANT: The indices passed in the dictionary "oneMinuteOfIndices" must be normalised.
Declaration
public static DescriptionResult AnalyzeOneMinute(FunctionalTemplate[] templates, Dictionary<string, Dictionary<string, double[]>> templatesAsDictionary, Dictionary<string, double[]> oneMinuteOfIndices, int minuteId)
Parameters
Returns
|
Improve this Doc
View Source
ContentDescriptionOfMultipleRecordingFiles(FileInfo, FileInfo)
Cycles through a set of acoustic indices in the order listed and calculates one acoustic signature for each minute of recording.
WARNING!!!! It is assumed that the indices are listed in temporal order of the original recordings and that the original recordings were continuous.
When these conditions satisfied, the returned plots contain scores over consecutive minutes.
Alternatively could read recording minute from its file name.
Declaration
public static Dictionary<string, double[]> ContentDescriptionOfMultipleRecordingFiles(FileInfo listOfIndexFiles, FileInfo templatesFile)
Parameters
Type |
Name |
Description |
FileInfo |
listOfIndexFiles |
A text file, each line being the path to the acoustic indices derived from one recording.
|
FileInfo |
templatesFile |
A json file containing an array of acoustic templates.
|
Returns
Type |
Description |
Dictionary<String, Double[]> |
A list of plots - each plot is the minute by minute scores for a single template.
|
|
Improve this Doc
View Source
GetPlots(Dictionary<String, Double[]>)
Declaration
public static List<Plot> GetPlots(Dictionary<string, double[]> contentDictionary)
Parameters
Returns
Extension Methods