Class DataProcessing
Inheritance
DataProcessing
Assembly: AudioAnalysisTools.dll
Syntax
public static class DataProcessing
Methods
|
Improve this Doc
View Source
ApplyBandPass(Dictionary<String, Double[]>, Int32, Int32)
Declaration
public static Dictionary<string, double[]> ApplyBandPass(Dictionary<string, double[]> indices, int bottomBin, int topBin)
Parameters
Returns
|
Improve this Doc
View Source
AverageIndicesInDictionary(Dictionary<String, Double[]>)
Declaration
public static Dictionary<string, double> AverageIndicesInDictionary(Dictionary<string, double[]> dictionary)
Parameters
Returns
|
Improve this Doc
View Source
AverageIndicesOverMinutes(Dictionary<String, Double[,]>, Int32, Int32)
Declaration
public static Dictionary<string, double[]> AverageIndicesOverMinutes(Dictionary<string, double[, ]> allIndices, int startRowId, int endRowId)
Parameters
Returns
|
Improve this Doc
View Source
ConvertArrayOfFunctionalTemplatesToDictionary(FunctionalTemplate[])
Converts an array of templates to dictionary.
Declaration
public static Dictionary<string, FunctionalTemplate> ConvertArrayOfFunctionalTemplatesToDictionary(FunctionalTemplate[] array)
Parameters
Returns
|
Improve this Doc
View Source
ConvertArraysToPlots(Dictionary<String, Double[]>, Double)
Declaration
public static Dictionary<string, Plot> ConvertArraysToPlots(Dictionary<string, double[]> dictOfArrays, double threshold)
Parameters
Returns
|
Improve this Doc
View Source
ConvertDictionaryOfIndicesToMatrix(Dictionary<String, Double[]>)
THis method can be used for debugging purposes.
Declaration
public static double[, ] ConvertDictionaryOfIndicesToMatrix(Dictionary<string, double[]> dictionary)
Parameters
Returns
|
Improve this Doc
View Source
ConvertDictionaryToVector(Dictionary<String, Double[]>)
Declaration
public static double[] ConvertDictionaryToVector(Dictionary<string, double[]> dictionary)
Parameters
Returns
|
Improve this Doc
View Source
ConvertDictionaryToVector(Dictionary<String, Double>)
Declaration
public static double[] ConvertDictionaryToVector(Dictionary<string, double> dictionary)
Parameters
Returns
|
Improve this Doc
View Source
ConvertPlotDictionaryToPlotList(Dictionary<String, Plot>)
Declaration
public static List<Plot> ConvertPlotDictionaryToPlotList(Dictionary<string, Plot> dict)
Parameters
Returns
|
Improve this Doc
View Source
ConvertResultsToDictionaryOfArrays(List<DescriptionResult>)
Declaration
public static Dictionary<string, double[]> ConvertResultsToDictionaryOfArrays(List<DescriptionResult> results)
Parameters
Returns
|
Improve this Doc
View Source
ConvertResultsToDictionaryOfArrays(List<DescriptionResult>, Int32, Int32)
Converts individual results to a dictionary of plots.
Declaration
public static Dictionary<string, double[]> ConvertResultsToDictionaryOfArrays(List<DescriptionResult> results, int arrayLength, int arrayStart)
Parameters
Type |
Name |
Description |
List<DescriptionResult> |
results |
a list of results for each content type in every minute.
|
Int32 |
arrayLength |
The plot length will the total number of minutes scanned, typically 1440 for one day.
|
Int32 |
arrayStart |
time start.
|
Returns
|
Improve this Doc
View Source
ConvertResultsToPlots(List<DescriptionResult>, Int32, Int32)
Converts individual results to a dictionary of plots.
Declaration
public static Dictionary<string, Plot> ConvertResultsToPlots(List<DescriptionResult> results, int plotLength, int plotStart)
Parameters
Type |
Name |
Description |
List<DescriptionResult> |
results |
a list of results for each content type in every minute.
|
Int32 |
plotLength |
The plot length will the total number of minutes scanned, typically 1440 or one day.
|
Int32 |
plotStart |
time start.
|
Returns
|
Improve this Doc
View Source
Declaration
public static Dictionary<string, Dictionary<string, double[]>> ExtractDictionaryOfTemplateDictionaries(FunctionalTemplate[] templates)
Parameters
Returns
|
Improve this Doc
View Source
GetFreqBinBounds(Int32, Int32)
Returns the bin bounds assuming that the full spectrum consists of the default value = 256.
Declaration
public static int[] GetFreqBinBounds(int bottomFrequency, int topFrequency)
Parameters
Type |
Name |
Description |
Int32 |
bottomFrequency |
Units = Hertz.
|
Int32 |
topFrequency |
Hertz.
|
Returns
|
Improve this Doc
View Source
GetFreqBinBounds(Int32, Int32, Int32)
Declaration
public static int[] GetFreqBinBounds(int bottomFrequency, int topFrequency, int binCount)
Parameters
Type |
Name |
Description |
Int32 |
bottomFrequency |
|
Int32 |
topFrequency |
|
Int32 |
binCount |
|
Returns
|
Improve this Doc
View Source
GetFreqBinVector(Dictionary<String, Double[]>, Int32)
Declaration
public static double[] GetFreqBinVector(Dictionary<string, double[]> dictionary, int id)
Parameters
Returns
|
Improve this Doc
View Source
GetIndicesForOneMinute(Dictionary<String, Double[,]>, Int32)
Declaration
public static Dictionary<string, double[]> GetIndicesForOneMinute(Dictionary<string, double[, ]> allIndices, int rowId)
Parameters
Returns
|
Improve this Doc
View Source
GetRandomNumberArray(Int32)
used for experimental purposes.
Declaration
public static Plot GetRandomNumberArray(int length)
Parameters
Type |
Name |
Description |
Int32 |
length |
|
Returns
|
Improve this Doc
View Source
GetRequiredIndices(Dictionary<String, Double[]>, String[])
Not all templates will use the same indices.
This method returns a dictionary of the required indices only.
Declaration
public static Dictionary<string, double[]> GetRequiredIndices(Dictionary<string, double[]> oneMinuteOfIndices, string[] keys)
Parameters
Returns
|
Improve this Doc
View Source
PercentileThresholding(List<Plot>, Int32)
Subtract the percentile value from the scores and normalize the remaining values in 0,1.
Declaration
public static List<Plot> PercentileThresholding(List<Plot> plots, int percentile)
Parameters
Returns
|
Improve this Doc
View Source
ReadIndexMatrices(String)
Reads in all the index matrices whose keys are in the above array of IndexNames.
Returns normalised values.
Declaration
public static Dictionary<string, double[, ]> ReadIndexMatrices(string filePath)
Parameters
Type |
Name |
Description |
String |
filePath |
Partial path to the index files.
|
Returns
|
Improve this Doc
View Source
ReadSpectralIndicesFromIndexMatrices(DirectoryInfo, String)
This method assumes that the start and end minute for reading from index matrices is first and last row respectively of matrices - assuming one minute per row.
Declaration
public static double[, ] ReadSpectralIndicesFromIndexMatrices(DirectoryInfo dir, string baseName)
Parameters
Type |
Name |
Description |
DirectoryInfo |
dir |
the directory containing the matrices.
|
String |
baseName |
base name of the files.
|
Returns
Type |
Description |
Double[,] |
a matrix of indices from required start time to required end time.
|
|
Improve this Doc
View Source
ReadSpectralIndicesFromIndexMatrices(DirectoryInfo, String, TimeSpan, TimeSpan)
Read five sets of acoustic indices into a matrix each row of which is a combined feature vector.
Declaration
public static double[, ] ReadSpectralIndicesFromIndexMatrices(DirectoryInfo dir, string baseName, TimeSpan startTime, TimeSpan duration)
Parameters
Returns
|
Improve this Doc
View Source
ReduceIndicesByFactor(Dictionary<String, Double[]>, Int32)
Reduces a dictionary of vectors by a factor. It is assumed that the input vectors are a power of 2 in length i.e. FFT spectra.
It is assumed that the factor of reduction will also be a power of 2, typically 8 or 16.
Declaration
public static Dictionary<string, double[]> ReduceIndicesByFactor(Dictionary<string, double[]> indices, int factor)
Parameters
Returns
|
Improve this Doc
View Source
ScanSpectrumWithTemplate(Dictionary<String, Double[]>, Dictionary<String, Double[]>)
THis method assumes that the passed template contains only one value for each key.
Declaration
public static double[] ScanSpectrumWithTemplate(Dictionary<string, double[]> templateDict, Dictionary<string, double[]> oneMinuteIndices)
Parameters
Returns
Type |
Description |
Double[] |
A spectrum of similarity-distance scores.
|
|
Improve this Doc
View Source
SubtractMeanPlusSd(List<Plot>)
A score normalization option.
Declaration
public static List<Plot> SubtractMeanPlusSd(List<Plot> plots)
Parameters
Returns
|
Improve this Doc
View Source
SubtractModeAndSd(List<Plot>)
This method normalizes a score array by subtracting the mode rather than the average of the array.
This is because the noise is often not normally distributed but rather skewed.
However, did not work well.
Declaration
public static List<Plot> SubtractModeAndSd(List<Plot> plots)
Parameters
Returns