Skip to content

Commit

Permalink
Fix Boobook Owl test
Browse files Browse the repository at this point in the history
Issue #370 Incorporate recent changes into this recognizer
  • Loading branch information
towsey authored and atruskie committed Oct 14, 2020
1 parent 28c2eda commit 282d5a3
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,47 +22,63 @@ Profiles:
MaxHertz: 1100
MinDuration: 0.17
MaxDuration: 1.2
DecibelThreshold: 9.0
DecibelThresholds:
- 6.0
- 9.0
- 12.0

#################### POST-PROCESSING of EVENTS ###################

# The first two post-processing steps are to combine overlapping/proximal/sequential events
# 1: Combine overlapping events
CombineOverlappingEvents: true
PostProcessing:
# The following generic post-processing steps are determined by config settings.
# Step 1: Combine overlapping events - events derived from all profiles.
# Step 2: Combine possible syllable sequences and filter on excess syllable count.
# Step 3: Remove events whose bandwidth is too small or large.
# Step 4: Remove events that have excessive noise in their side-bands.

# 2: Combine possible syllable sequences
# Can also use this to "mop up" events in neighbourhood - these can be removed later.
SyllableSequence:
CombinePossibleSyllableSequence: true
SyllableStartDifference: 0.6
SyllableHertzGap: 350
FilterSyllableSequence: true
SyllableMaxCount: 2
ExpectedPeriod: 0.4
# 1: Combine overlapping events
CombineOverlappingEvents: true

# 3: Remove events whose bandwidth lies outside 3 SDs of an expected value.
ExpectedBandwidth: 280
BandwidthStandardDeviation: 40
# 2: Combine possible syllable sequences
SyllableSequence:
CombinePossibleSyllableSequence: true
SyllableStartDifference: 0.6
SyllableHertzGap: 350
FilterSyllableSequence: true
SyllableMaxCount: 2
ExpectedPeriod: 0.4

# 4: Filter the events for excess activity in their upper and lower buffer zones
NeighbourhoodLowerHertzBuffer: 150
NeighbourhoodUpperHertzBuffer: 400
NeighbourhoodDecibelBuffer: 3.0
# 3: Remove events whose duration lies outside 3 SDs of an expected value.
#Duration:
ExpectedDuration: 0.14
DurationStandardDeviation: 0.01

# C: Options to save results files
# 4: Available options for saving spectrograms (case-sensitive): [False/Never | True/Always | WhenEventsDetected]
# 4: Remove events whose bandwidth lies outside 3 SDs of an expected value.
# Bandwidth:
ExpectedBandwidth: 280
BandwidthStandardDeviation: 40

# 5: Filter the events for excess activity in their sidebands, i.e. upper and lower buffer zones
SidebandActivity:
LowerHertzBuffer: 150
UpperHertzBuffer: 400
DecibelBuffer: 0.0

# Options to save results files
# 1: Available options for saving spectrograms (case-sensitive): [False/Never | True/Always | WhenEventsDetected]
# "True" is useful when debugging but "WhenEventsDetected" is required for operational use.
#SaveSonogramImages: True
SaveSonogramImages: WhenEventsDetected

# 5: Available options for saving data files (case-sensitive): [False/Never | True/Always | WhenEventsDetected]
# 2: Available options for saving data files (case-sensitive): [False/Never | True/Always | WhenEventsDetected]
SaveIntermediateWavFiles: Never
SaveIntermediateCsvFiles: false

# 6: DisplayCsvImage is obsolete - ensure it remains set to: false
# 3: DisplayCsvImage is obsolete - ensure it remains set to: false
DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"

...
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,17 @@ PostProcessing:
SyllableMaxCount: 6
ExpectedPeriod: 0.92

# 3: Remove events whose bandwidth lies outside 3 SDs of an expected value.
# 3: Remove events whose duration lies outside 3 SDs of an expected value.
#Duration:
ExpectedDuration: 0.14
DurationStandardDeviation: 0.01

# 4: Remove events whose bandwidth lies outside 3 SDs of an expected value.
Bandwidth:
ExpectedBandwidth: 120
BandwidthStandardDeviation: 30

# 4: Filter the events for excess activity in their sidebands, i.e. upper and lower buffer zones
# 5: Filter the events for excess activity in their sidebands, i.e. upper and lower buffer zones
SidebandActivity:
LowerHertzBuffer: 0
UpperHertzBuffer: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ public void TestRecognizer()

Assert.AreEqual(8, events.Count);
Assert.IsNull(scoreTrack);
Assert.AreEqual(1, plots.Count);
Assert.AreEqual(3, plots.Count);
Assert.AreEqual(2667, sonogram.FrameCount);

Assert.IsInstanceOfType(events[1], typeof(CompositeEvent));

var secondEvent = (CompositeEvent)events[1];

Assert.AreEqual(5.375419501133787, secondEvent.EventStartSeconds);
Assert.AreEqual(6.0720181405895692, secondEvent.EventEndSeconds);
Assert.AreEqual(483, secondEvent.LowFrequencyHertz);
Assert.AreEqual(6.1648979591836737, secondEvent.EventEndSeconds);
Assert.AreEqual(441, secondEvent.LowFrequencyHertz);
Assert.AreEqual(735, secondEvent.HighFrequencyHertz);
Assert.AreEqual(20.901882476071698, secondEvent.Score, TestHelper.AllowedDelta);
Assert.AreEqual(0.20786700431266195, secondEvent.ScoreNormalized, TestHelper.AllowedDelta);
Assert.AreEqual(22.388932023970227, secondEvent.Score, TestHelper.AllowedDelta);
Assert.AreEqual(0.0092984503451215648, secondEvent.ScoreNormalized, TestHelper.AllowedDelta);
}
}
}

0 comments on commit 282d5a3

Please sign in to comment.