Skip to content

Commit

Permalink
Fix broken tests after changes to recognizer config file
Browse files Browse the repository at this point in the history
Issue #451
  • Loading branch information
towsey committed Feb 24, 2021
1 parent 049c901 commit cabcefb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ SegmentDuration: 60
# SegmentOverlap: units=seconds;
SegmentOverlap: 0

# Scan spectrogram at these thresholds
DecibelThresholds:
- 12.0
- 18.0
- 24.0
- 30.0
- 36.0

# Each of these profiles will be analyzed
# This profile is required for the species-specific recogniser and must have the current name.
Profiles:
Expand Down Expand Up @@ -62,27 +54,32 @@ PostProcessing:
# 2: Combine possible syllable sequences
SyllableSequence:
CombinePossibleSyllableSequence: true
SyllableStartDifference: 0.7
SyllableStartDifference: 0.8
SyllableHertzGap: 100
FilterSyllableSequence: false
SyllableMaxCount: 6
ExpectedPeriod: 0.92

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

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

# 5: Filter the events for excess activity in their sidebands, i.e. upper and lower buffer zones
SidebandActivity:
LowerHertzBuffer: 0
UpperHertzBuffer: 0
MaxAverageSidebandDecibels: 3.0
BandwidthStandardDeviation: 15

# 5: Filter the events for excess acoustic activity in their sidebands, i.e. upper and lower buffer zones
SidebandAcousticActivity:
LowerSidebandWidth: 0
UpperSidebandWidth: 0
FilterEventsOnSidebandBackground: false
MaxBackgroundDecibels: 6.0
FilterEventsOnSidebandActivity: false
MaxActivityDecibels: 9.0

# Various options to save results files
# 1: Available options for saving spectrograms (case-sensitive): [False/Never | True/Always | WhenEventsDetected]
Expand Down
2 changes: 1 addition & 1 deletion src/AnalysisPrograms/Recognizers/GenericRecognizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public override RecognizerResults Recognize(
var postEvents = new List<EventCommon>();

// count number of events detected at each decibel threshold.
for (int i = 1; i <= 24; i++)
for (int i = 1; i <= 39; i++)
{
var dbEvents = EventFilters.FilterOnDecibelDetectionThreshold(results.NewEvents, (double)i);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,22 @@ public void TestRecognizer()
this.SaveTestOutput(
outputDirectory => GenericRecognizer.SaveDebugSpectrogram(results, null, outputDirectory, Recognizer.SpeciesName));

Assert.AreEqual(5, events.Count);
Assert.AreEqual(6, events.Count);
Assert.IsNull(scoreTrack);
Assert.AreEqual(5, plots.Count);
Assert.AreEqual(2580, sonogram.FrameCount);

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

//Note: due to combining and filtering of events etc, they are not in temporal order
var secondEvent = (CompositeEvent)events[4];
var secondEvent = (CompositeEvent)events[5];

Assert.AreEqual(26.842267573, secondEvent.EventStartSeconds, 1E-06);
Assert.AreEqual(27.945215419, secondEvent.EventEndSeconds, 1E-06);
Assert.AreEqual(27.898775510204082, secondEvent.EventEndSeconds, 1E-06);
Assert.AreEqual(357, secondEvent.LowFrequencyHertz);
Assert.AreEqual(483, secondEvent.HighFrequencyHertz);
Assert.AreEqual(47.93789051, secondEvent.Score, 1E-06);
Assert.AreEqual(0.0797182258673, secondEvent.ScoreNormalized, 1E-06);
Assert.AreEqual(47.93789051261686, secondEvent.Score, 1E-06);
Assert.AreEqual(0.069847040361109447, secondEvent.ScoreNormalized, 1E-06);
}
}
}

This file was deleted.

0 comments on commit cabcefb

Please sign in to comment.