From dee47b7a8b4526080bbc35ae78e14bb35fd42350 Mon Sep 17 00:00:00 2001 From: towsey Date: Tue, 29 Sep 2020 17:13:15 +1000 Subject: [PATCH] Revise unit tests for the Bittern Issue #370 Unit tests need to be revised because of accumulating more acoustic events as a result of having multiple decibel thresholds. --- .../Towsey.BotaurusPoiciloptilus.yml | 3 ++- .../AnalysisPrograms/Recognizers/AustBitternTests.cs | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/AnalysisConfigFiles/RecognizerConfigFiles/Towsey.BotaurusPoiciloptilus.yml b/src/AnalysisConfigFiles/RecognizerConfigFiles/Towsey.BotaurusPoiciloptilus.yml index d89186ffc..01bd87e55 100644 --- a/src/AnalysisConfigFiles/RecognizerConfigFiles/Towsey.BotaurusPoiciloptilus.yml +++ b/src/AnalysisConfigFiles/RecognizerConfigFiles/Towsey.BotaurusPoiciloptilus.yml @@ -28,6 +28,7 @@ Profiles: MinDuration: 0.3 MaxDuration: 0.8 DecibelThresholds: + - 3.0 - 6.0 - 12.0 @@ -47,7 +48,7 @@ PostProcessing: SyllableSequence: CombinePossibleSyllableSequence: true SyllableStartDifference: 3.0 - SyllableHertzGap: 35 + SyllableHertzGap: 40 FilterSyllableSequence: true SyllableMaxCount: 6 ExpectedPeriod: 2.5 diff --git a/tests/Acoustics.Test/AnalysisPrograms/Recognizers/AustBitternTests.cs b/tests/Acoustics.Test/AnalysisPrograms/Recognizers/AustBitternTests.cs index 5e4afa042..464980196 100644 --- a/tests/Acoustics.Test/AnalysisPrograms/Recognizers/AustBitternTests.cs +++ b/tests/Acoustics.Test/AnalysisPrograms/Recognizers/AustBitternTests.cs @@ -59,20 +59,21 @@ public void TestRecognizer() Assert.AreEqual(1, events.Count); Assert.IsNull(scoreTrack); - Assert.AreEqual(1, plots.Count); + Assert.AreEqual(3, plots.Count); Assert.AreEqual(938, sonogram.FrameCount); Assert.IsInstanceOfType(events[0], typeof(CompositeEvent)); var onlyEvent = (CompositeEvent)events[0]; - Assert.AreEqual(5, onlyEvent.ComponentCount); + //note this event contains only three syllables but 7 events because have used two decibel thresholds. + Assert.AreEqual(12, onlyEvent.ComponentCount); Assert.AreEqual(5.12, onlyEvent.EventStartSeconds); Assert.AreEqual(12.256, onlyEvent.EventEndSeconds); Assert.AreEqual(105, onlyEvent.LowFrequencyHertz); Assert.AreEqual(180, onlyEvent.HighFrequencyHertz); - Assert.AreEqual(21.716400254, onlyEvent.Score, TestHelper.AllowedDelta); - Assert.AreEqual(0.9470146022, onlyEvent.ScoreNormalized, TestHelper.AllowedDelta); + Assert.AreEqual(28.078038296020, onlyEvent.Score, TestHelper.AllowedDelta); + Assert.AreEqual(0.024466803702, onlyEvent.ScoreNormalized, TestHelper.AllowedDelta); } } }