diff --git a/src/AnalysisConfigFiles/RecognizerConfigFiles/Towsey.PhascolarctosCinereusMark3.yml b/src/AnalysisConfigFiles/RecognizerConfigFiles/Towsey.PhascolarctosCinereusMark3.yml index 696e37c5e..d50a2b083 100644 --- a/src/AnalysisConfigFiles/RecognizerConfigFiles/Towsey.PhascolarctosCinereusMark3.yml +++ b/src/AnalysisConfigFiles/RecognizerConfigFiles/Towsey.PhascolarctosCinereusMark3.yml @@ -2,7 +2,6 @@ # Male Koala: Phascolarctos cinereus version 3. # Resample rate must be 2 X the desired Nyquist -#ResampleRate: 20480 ResampleRate: 22050 # SegmentDuration: units=seconds; SegmentDuration: 60 @@ -26,9 +25,9 @@ Profiles: #Algorithm: MultiBin ComponentName: Oscillation FrameSize: 256 - FrameStep: 100 + FrameStep: 110 # min and max of the freq band to search - MinHertz: 200 + MinHertz: 170 MaxHertz: 800 # Min and max durations for the length of a true event (seconds). MinDuration: 0.2 @@ -62,17 +61,19 @@ PostProcessing: CombineOverlappingEvents: false # 2: Combine possible syllable sequences -# SyllableSequence: -# SyllableStartDifference: 1.2 -# SyllableHertzGap: 2400 - # FilterSyllableSequence: true + SyllableSequence: + SyllableStartDifference: 3.5 + SyllableHertzGap: 200 + #FilterSyllableSequence: false # SyllableMaxCount: 3 # ExpectedPeriod: 0.1 -# # # 3: Remove events whose duration lies outside 3 SDs of an expected value. -# Duration: -# ExpectedDuration: 2.5 -# DurationStandardDeviation: 0.6 + # 3: Remove events whose duration lies outside 3 SDs of an expected value. + # Koala calls can last for 90 seconds or more. + # The following has the effect of removing events shorter than 3 seconds & longer than 93 sec. + Duration: + ExpectedDuration: 48.0 + DurationStandardDeviation: 15.0 # # 4: Remove events whose bandwidth lies outside 3 SDs of an expected value. # # Bandwidth: @@ -80,6 +81,7 @@ PostProcessing: # BandwidthStandardDeviation: 40 # # 5: Filter the events for excess activity in their sidebands, i.e. upper and lower buffer zones +# THis will not work for koala calls. # SidebandActivity: # LowerHertzBuffer: 150 # UpperHertzBuffer: 400 diff --git a/tests/Acoustics.Test/AnalysisPrograms/Recognizers/KoalaMark3Tests.cs b/tests/Acoustics.Test/AnalysisPrograms/Recognizers/KoalaMark3Tests.cs index 81bf67969..209936707 100644 --- a/tests/Acoustics.Test/AnalysisPrograms/Recognizers/KoalaMark3Tests.cs +++ b/tests/Acoustics.Test/AnalysisPrograms/Recognizers/KoalaMark3Tests.cs @@ -27,8 +27,7 @@ public class KoalaMark3Tests : OutputDirectoryTest /// /// The canonical recording used for this recognizer is #############################. /// - //private static readonly FileInfo TestAsset = PathHelper.ResolveAsset("Recordings", "koala.wav"); - private static readonly FileInfo TestAsset = new FileInfo("C:\\Ecoacoustics\\WavFiles\\KoalaMale\\Jackaroo_20080715-103940.wav"); + private static readonly FileInfo TestAsset = PathHelper.ResolveAsset("Recordings", "HoneymoonBay_StBees_20080905-001000.wav"); private static readonly FileInfo ConfigFile = PathHelper.ResolveConfigFile("RecognizerConfigFiles", "Towsey.PhascolarctosCinereusMark3.yml"); private static readonly PhascolarctosCinereusMark3 Recognizer = new PhascolarctosCinereusMark3(); @@ -63,22 +62,30 @@ public void TestKoala3Recognizer() this.SaveTestOutput( outputDirectory => GenericRecognizer.SaveDebugSpectrogram(results, null, outputDirectory, Recognizer.SpeciesName)); - Assert.AreEqual(8, events.Count); + Assert.AreEqual(3, events.Count); Assert.IsNull(scoreTrack); Assert.AreEqual(3, plots.Count); - Assert.AreEqual(5888, sonogram.FrameCount); + //Assert.AreEqual(5888, sonogram.FrameCount); + Assert.AreEqual(12025, sonogram.FrameCount); - Assert.IsInstanceOfType(events[0], typeof(OscillationEvent)); + Assert.IsInstanceOfType(events[0], typeof(CompositeEvent)); - var ev = (OscillationEvent)events[3]; - - Assert.AreEqual(10.7, ev.EventStartSeconds, 0.05); - Assert.AreEqual(11.5, ev.EventEndSeconds, 0.05); - Assert.AreEqual(200, ev.LowFrequencyHertz); + var ev = (CompositeEvent)events[1]; + Assert.AreEqual(73.9, ev.EventStartSeconds, 0.05); + Assert.AreEqual(98.1, ev.EventEndSeconds, 0.05); + Assert.AreEqual(170, ev.LowFrequencyHertz); Assert.AreEqual(800, ev.HighFrequencyHertz); - Assert.AreEqual(0.62, ev.Score, 0.05); - Assert.AreEqual(0.03, ev.Periodicity, 0.005); - Assert.AreEqual(31.7, ev.OscillationRate, 0.1); + + Assert.AreEqual(14, ev.ComponentEvents.Count); + var componentEv = ev.ComponentEvents[6]; + Assert.IsInstanceOfType(componentEv, typeof(OscillationEvent)); + + Assert.AreEqual(0.71, componentEv.Score, 0.05); + + var oscEv = (OscillationEvent)componentEv; + Assert.AreEqual(1.3, oscEv.EventDurationSeconds, 0.05); + Assert.AreEqual(0.0248, oscEv.Periodicity, 0.005); + Assert.AreEqual(40.24, oscEv.OscillationRate, 0.1); } } } \ No newline at end of file diff --git a/tests/Fixtures/Recordings/HoneymoonBay_StBees_20080905-001000.wav b/tests/Fixtures/Recordings/HoneymoonBay_StBees_20080905-001000.wav new file mode 100644 index 000000000..d2ca301c5 --- /dev/null +++ b/tests/Fixtures/Recordings/HoneymoonBay_StBees_20080905-001000.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bda5ff2482c528b97786fedf8b003c56bbd1dfa60a8a3b78cfef6154573011d8 +size 5292046