Skip to content

Commit

Permalink
integrating Content Descirption into IAnalyzer2.
Browse files Browse the repository at this point in the history
Issue #252 Continue integrating COntent Descirption into IAnalyzer2.
Change name of one of the ContentDescription.cs classes to remove confusion.
Some resharper stuff.
  • Loading branch information
towsey committed Oct 21, 2019
1 parent a52c9b0 commit 516abf0
Show file tree
Hide file tree
Showing 13 changed files with 764 additions and 271 deletions.
4 changes: 2 additions & 2 deletions src/Acoustics.Shared/ConfigFile/Config.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="Config.cs" company="QutEcoacoustics">
// <copyright file="Config.cs" company="QutEcoacoustics">
// All code in this file and all associated files are the copyright and property of the QUT Ecoacoustics Research Group (formerly MQUTeR, and formerly QUT Bioacoustics Research Group).
// </copyright>

Expand All @@ -8,7 +8,7 @@ namespace Acoustics.Shared.ConfigFile
using System.Collections.Generic;
using System.Globalization;
using System.Reflection;
using Contracts;
using Acoustics.Shared.Contracts;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

Expand Down
19 changes: 10 additions & 9 deletions src/AnalysisBase/AnalyzerConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class AnalyzerConfig
public double? SegmentOverlap { get; set; }

/// <summary>
/// Gets or sets the default sample rate to reencode all input audio as.
/// Gets or sets the default sample rate to re-encode all input audio as.
/// </summary>
/// <remarks>
/// ResampleRate must be 2 X the desired Nyquist.
Expand All @@ -49,14 +49,15 @@ public class AnalyzerConfig
/// Gets or sets a value indicating whether a file must have a date in the file name.
/// </summary>
/// <remarks>
/// if true, an unambiguous date time must be provided in the source file's name.
/// if true, an exception will be thrown if no such date is found
/// if false, and a valid date is still found in file name, it will still be parsed
/// supports formats like:
/// prefix_20140101T235959+1000.mp3
/// prefix_20140101T235959+Z.mp3
/// prefix_20140101-235959+1000.mp3
/// prefix_20140101-235959+Z.mp3.
/// If true, an unambiguous date-time must be provided in the source file's name.
/// If true, an exception will be thrown if no such date is found.
/// If false, and a valid date is still found in file name, it will still be parsed.
/// Supports formats like:
/// prefix_20140101T235959+1000.wav, where +1000 is in this case the time-zone offset for Brisbane.
/// prefix_20140101T235959+Z.wav, where +Z is the zero time-zone offset.
/// prefix_20140101-235959+1000.wav
/// prefix_20140101-235959+Z.wav
/// For more info on dates, see "dates.md" at https://github.com/QutEcoacoustics/audio-analysis/tree/master/docs.
/// </remarks>
public bool RequireDateInFilename { get; set; } = false;
}
Expand Down
89 changes: 16 additions & 73 deletions src/AnalysisConfigFiles/Towsey.ContentDescription.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,24 @@
# An acoustic signature is a vector, ecah element of which is derived from a ContentDescription template.
#
AnalysisName: ContentDescription
#SegmentDuration: units=seconds;
# Long duration recordings are cut into short segments for more efficient processing. Default segment length = 60 seconds.
# WARNING: You should not change this property!!
SegmentDuration: 60

#SegmentOverlap: units=seconds;
# WARNING: You should not change this property!!
SegmentOverlap: 0

# IndexCalculationDuration: units=seconds (default=60 seconds)
# The Timespan (in seconds) over which summary and spectral indices are calculated
# This value MUST not exceed value of SegmentDuration.
# This Default value should not be changed.
IndexCalculationDuration: 60.0

# BgNoiseNeighborhood: units=seconds
# By default, when IndexCalculationDuration = 60 seconds, background (stationary) noise is calculated from the full 60 second recording.
BgNoiseNeighborhood: 5
# The following parameters have been commented because they must not be changed for Content Description.
#All units=seconds;
#SegmentDuration: 60
#SegmentOverlap: 0
#IndexCalculationDuration: 60.0
#BgNoiseNeighborhood: 5

# By default, all recordings are down-sampled or up-sampled to 22050 Hz.
# If you have a recording sampled at a higher rate, AND you wish to retain it, then set the correct value here.
# Resample rate must be 2 X the desired Nyquist
ResampleRate: 22050

# FRAME LENGTH. units=samples
# Typical value=512 where resample rate = 22050.
# Frame Overlap is NEVER used when calculating acoustic indices.
# This value should not be changed in order to retain consistency over multiple recordings.
FrameLength: 512
#ResampleRate: 22050
#FrameLength: 512
#FrameStep: 512
#FrequencyScale: Linear

# Defining three frequency bands.
# It is often useful to define three frequency bands, low, middle and high.
# Six of the summary indices are calculated for the mid-band only.
# This is useful to avoid low frequency anthropogenic noise and to target bird species which mostly sing in the 1-8 khz band.
# The lower and upper bound of the mid-frequency band are set by LowFreqBound and HighFreqBound respectively.
# Default values in code are LowFreqBound=1000Hz & MidFreqBound=8000
LowFreqBound: 1000
MidFreqBound: 8000
HighFreqBound: 11000

# The only FrequencyScale option currently available is only Linear
FrequencyScale: Linear
#LowFreqBound: 1000
#MidFreqBound: 8000
#HighFreqBound: 11000

# SAVE INTERMEDIARY FILES
# Available options (case-sensitive): [false/Never | true/Always | WhenEventsDetected]
Expand All @@ -58,16 +34,6 @@ SaveIntermediateCsvFiles: false
# Available options (case-sensitive): [False/Never | True/Always | WhenEventsDetected]
SaveSonogramImages: Never

# SAVE SONOGRAM DATA FILES FOR SUBSEQUENT ZOOMING SPECTROGRAMS
# Next two parameters are used only when creating images for zooming spectrograms.
# Warning: IndexCalculationDuration must be set = 0.2 when SaveSonogramData = true
SaveSonogramData: false

# TileImageOutput
# if true an additional set of images will be produced that are tiles
# if true, RequireDateInFilename must be set
TileOutput: false

# RequireDateInFilename:
# If true, an unambiguous date-time must be provided in the source file's name.
# If true, an exception will be thrown if no such date is found
Expand All @@ -80,39 +46,16 @@ TileOutput: false
# For more info on dates, see <dates.md> at https://github.com/QutEcoacoustics/audio-analysis/tree/master/docs
RequireDateInFilename: false

# Do NOT change following path. It is required for drawing false-colour spectrograms
IndexPropertiesConfig: './IndexPropertiesConfig.yml'

# EventThreshold: min value=0.0; max value=1.0.
# This value can sometimes be used to manage the FP/FN trade-off performance of a call recogniser.
# Not always used however.
EventThreshold: 0.2
#IndexPropertiesConfig: './IndexPropertiesConfig.yml'
TemplatesList: 'Towsey.TemplateDefinitions.json'

# #############################################################################################################
# The below parameters are used to configure drawing of the false-colour spectrograms
# IMPORTANT NOTE: FC spectrograms are produced only IF the above IndexCalculationDuration := 60.0
# Explanation of the FC configuration parameters is included below.
LdSpectrogramConfig:
ColorMap1: "ACI-ENT-EVN"
ColorMap2: "BGN-PMN-EVN"

#EXPLANATION OF LDFC CONFIG PARAMETERS
# The ColourFilter parameter determines how much the low index values are emphasized or de-emphasized.
# The purpose is to make low intensity features stand out (emphasis) or become even less obvious (de-emphasis).
# This parameter applies a function that lies between y=x^-2 and y=x^2, i.e. between the square-root and the square.
# For an acoustic index value of X, newX = [(1/c - 1) * X^2 + X] * c, where c = the supplied filterCoeff.
# When filterCoeff = 1.0, small values are maximally emphasized, i.e. y=sqrt(x).
# When filterCoeff = 0.0, the matrix remains unchanged, that is, y=x.
# When filterCoeff =-1.0, small values are maximally de-emphasized, i.e. y=x^2.
# Generally usage suggests that a value of -0.25 is suitable. i.e. a slight de-emphasis.
ColorMap2: "BGN-PMN-OSC"
ColourFilter: -0.25

# minutes x-axis scale
XAxisTicIntervalSeconds: 3600

# Hertz y-axis scale
# Only three option work now: "Linear", "Mel"' "Linear125Octaves7Tones28Nyquist32000" work at present
# Future options will be: Linear62Octaves31Nyquist11025, Linear125Octaves30Nyquist11025, Octaves24Nyquist32000
FreqScale: "Linear"
YAxisTicInterval: 1000
...
Expand Down
Loading

0 comments on commit 516abf0

Please sign in to comment.