diff --git a/tests/Acoustics.Test/AnalysisPrograms/Recognizers/AustBitternTests.cs b/tests/Acoustics.Test/AnalysisPrograms/Recognizers/AustBitternTests.cs index fea87ea9c..60289607b 100644 --- a/tests/Acoustics.Test/AnalysisPrograms/Recognizers/AustBitternTests.cs +++ b/tests/Acoustics.Test/AnalysisPrograms/Recognizers/AustBitternTests.cs @@ -23,7 +23,6 @@ public class AustBitternTests : OutputDirectoryTest /// The canonical recording used for this recognizer is a 30 second recording made by Liz Znidersic at Medeas Cove, St Helens, 2016-12-17. /// private static readonly FileInfo TestAsset = PathHelper.ResolveAsset("Recordings", "medeas_cove_2-2_1831_471228_20161217_232352_30_0.wav"); - //private static readonly FileInfo TestAsset = new FileInfo(@"C:\Ecoacoustics\WavFiles\TestNoiseRecordings\West_Knoll_St_Bees_WindRain_20080917-133000.wav"); private static readonly FileInfo ConfigFile = PathHelper.ResolveConfigFile("RecognizerConfigFiles", "Towsey.BotaurusPoiciloptilus.yml"); private static readonly BotaurusPoiciloptilus Recognizer = new BotaurusPoiciloptilus(); diff --git a/tests/Acoustics.Test/AnalysisPrograms/Recognizers/AustralPipitTests.cs b/tests/Acoustics.Test/AnalysisPrograms/Recognizers/AustralPipitTests.cs index d7427911a..69dcafa4d 100644 --- a/tests/Acoustics.Test/AnalysisPrograms/Recognizers/AustralPipitTests.cs +++ b/tests/Acoustics.Test/AnalysisPrograms/Recognizers/AustralPipitTests.cs @@ -70,9 +70,8 @@ public void TestRecognizer() Assert.AreEqual(22.3680000000000, ev.EventEndSeconds, TestHelper.AllowedDelta); Assert.AreEqual(4743, ev.BandWidthHertz); - // This event should contain 13 component events var componentEvents = ev.ComponentEvents; - Assert.AreEqual(13, componentEvents.Count); + Assert.AreEqual(3, componentEvents.Count); // This tests that the component tracks are correctly combined. //This can also be tested somewhere else, starting with just the comosite event in json file. diff --git a/tests/Acoustics.Test/AnalysisPrograms/Recognizers/BoobookOwlTests.cs b/tests/Acoustics.Test/AnalysisPrograms/Recognizers/BoobookOwlTests.cs index e875e99bd..7cd9850b6 100644 --- a/tests/Acoustics.Test/AnalysisPrograms/Recognizers/BoobookOwlTests.cs +++ b/tests/Acoustics.Test/AnalysisPrograms/Recognizers/BoobookOwlTests.cs @@ -65,8 +65,8 @@ public void TestRecognizer() Assert.AreEqual(6.1648979591836737, secondEvent.EventEndSeconds); Assert.AreEqual(441, secondEvent.LowFrequencyHertz); Assert.AreEqual(735, secondEvent.HighFrequencyHertz); - Assert.AreEqual(22.388932023970227, secondEvent.Score, TestHelper.AllowedDelta); - Assert.AreEqual(0.0092984503451215648, secondEvent.ScoreNormalized, TestHelper.AllowedDelta); + Assert.AreEqual(18.753868577301958, secondEvent.Score, TestHelper.AllowedDelta); + Assert.AreEqual(0.34061938340960607, secondEvent.ScoreNormalized, TestHelper.AllowedDelta); } } } \ No newline at end of file diff --git a/tests/Acoustics.Test/AnalysisPrograms/Recognizers/CisticolaTests.cs b/tests/Acoustics.Test/AnalysisPrograms/Recognizers/CisticolaTests.cs index 70bca36b0..29ca811a6 100644 --- a/tests/Acoustics.Test/AnalysisPrograms/Recognizers/CisticolaTests.cs +++ b/tests/Acoustics.Test/AnalysisPrograms/Recognizers/CisticolaTests.cs @@ -65,7 +65,7 @@ public void TestRecognizer() Assert.AreEqual(2542, ev.LowFrequencyHertz); Assert.AreEqual(3100, ev.HighFrequencyHertz); Assert.AreEqual(17.916490813192297, ev.Score, TestHelper.AllowedDelta); - Assert.AreEqual(0.077654864863397136, ev.ScoreNormalized, TestHelper.AllowedDelta); + Assert.AreEqual(0.0776548648633971, ev.ScoreNormalized, TestHelper.AllowedDelta); } } } \ No newline at end of file diff --git a/tests/Acoustics.Test/AnalysisPrograms/Recognizers/GenericRecognizerTests.cs b/tests/Acoustics.Test/AnalysisPrograms/Recognizers/GenericRecognizerTests.cs index 46f37f7b0..19aae3565 100644 --- a/tests/Acoustics.Test/AnalysisPrograms/Recognizers/GenericRecognizerTests.cs +++ b/tests/Acoustics.Test/AnalysisPrograms/Recognizers/GenericRecognizerTests.cs @@ -125,7 +125,7 @@ public void TestBlobAlgorithm() { UpperHertzBuffer = 0, LowerHertzBuffer = 0, - DecibelBuffer = 0, + MaxAverageSidebandDecibels = 0, }, }, }; @@ -190,7 +190,7 @@ public void TestOscillationAlgorithm() { UpperHertzBuffer = 0, LowerHertzBuffer = 0, - DecibelBuffer = 0, + MaxAverageSidebandDecibels = 0, }, }, }; @@ -253,7 +253,7 @@ public void TestWhistleAlgorithm() { UpperHertzBuffer = 0, LowerHertzBuffer = 0, - DecibelBuffer = 0, + MaxAverageSidebandDecibels = 0, }, }, }; @@ -1000,7 +1000,7 @@ public void TestAedAlgorithm() { UpperHertzBuffer = 0, LowerHertzBuffer = 0, - DecibelBuffer = 0, + MaxAverageSidebandDecibels = 0, }, }, }; @@ -1088,7 +1088,7 @@ public void TestMultipleAlgorithms() { UpperHertzBuffer = 0, LowerHertzBuffer = 0, - DecibelBuffer = 0, + MaxAverageSidebandDecibels = 0, }, }, }; diff --git a/tests/Acoustics.Test/AnalysisPrograms/Recognizers/PowerfulOwlTests.cs b/tests/Acoustics.Test/AnalysisPrograms/Recognizers/PowerfulOwlTests.cs index 695d84304..b505049c2 100644 --- a/tests/Acoustics.Test/AnalysisPrograms/Recognizers/PowerfulOwlTests.cs +++ b/tests/Acoustics.Test/AnalysisPrograms/Recognizers/PowerfulOwlTests.cs @@ -7,8 +7,8 @@ namespace Acoustics.Test.AnalysisPrograms.Recognizers using System; using System.IO; using Acoustics.Test.TestHelpers; - using Acoustics.Tools.Wav; using global::AnalysisPrograms.Recognizers; + using global::AudioAnalysisTools; using global::AudioAnalysisTools.Events.Types; using global::AudioAnalysisTools.WavTools; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -21,9 +21,8 @@ public class PowerfulOwlTests : OutputDirectoryTest { /// /// The canonical recording used for this recognizer contains three calls, each with two syllables. - /// However the calls are loud and each is followed by an echo which is picked up as another syllable. - /// In addition, there is a false-positive hit near start of recording. - /// The config file could easily be adjusted to remove the extra hits, + /// However the calls are loud and two of them are followed by an echo which is picked up as another syllable. + /// The config file could be adjusted to remove the extra hits, /// but the config has been optimised on ten recordings, provided by Kristen Thompson, that contain a variety of loud and soft calls. /// private static readonly FileInfo TestAsset = PathHelper.ResolveAsset("Recordings", "Powerful3AndBoobook0_ksh3_1773_510819_20171109_174311_30_0.wav"); @@ -52,21 +51,22 @@ public void TestRecognizer() this.SaveTestOutput( outputDirectory => GenericRecognizer.SaveDebugSpectrogram(results, null, outputDirectory, Recognizer.SpeciesName)); - Assert.AreEqual(7, events.Count); + Assert.AreEqual(5, events.Count); Assert.IsNull(scoreTrack); Assert.AreEqual(5, plots.Count); Assert.AreEqual(2580, sonogram.FrameCount); - Assert.IsInstanceOfType(events[1], typeof(CompositeEvent)); + Assert.IsInstanceOfType(events[1], typeof(ChirpEvent)); - var secondEvent = (CompositeEvent)events[3]; + //Note: due to combining and filtering of events etc, they are not in temporal order + var secondEvent = (CompositeEvent)events[4]; - Assert.AreEqual(28.28190476, secondEvent.EventStartSeconds, 1E-06); - Assert.AreEqual(29.18748299, secondEvent.EventEndSeconds, 1E-06); - Assert.AreEqual(399, secondEvent.LowFrequencyHertz); + Assert.AreEqual(26.842267573, secondEvent.EventStartSeconds, 1E-06); + Assert.AreEqual(27.945215419, secondEvent.EventEndSeconds, 1E-06); + Assert.AreEqual(357, secondEvent.LowFrequencyHertz); Assert.AreEqual(483, secondEvent.HighFrequencyHertz); - Assert.AreEqual(20.55114869, secondEvent.Score, 1E-06); - Assert.AreEqual(0.137214817, secondEvent.ScoreNormalized, 1E-06); + Assert.AreEqual(47.93789051, secondEvent.Score, 1E-06); + Assert.AreEqual(0.0797182258673, secondEvent.ScoreNormalized, 1E-06); } } } \ No newline at end of file