Skip to content

Commit

Permalink
Update CompositeEvent.cs
Browse files Browse the repository at this point in the history
Issue #390 Fix bug that occured in this method and for which new unit test was written.
  • Loading branch information
towsey authored and atruskie committed Nov 1, 2020
1 parent 120f8cb commit 8630b97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AudioAnalysisTools/Events/Types/CompositeEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -386,14 +386,14 @@ public static (SpectralEvent EvAi, SpectralEvent EvBj) EnclosedEvents(SpectralEv
{
bool eventAEnclosedInTime = a.EventStartSeconds >= b.EventStartSeconds && a.EventEndSeconds <= b.EventEndSeconds;
bool eventAEnclosedInFreq = a.LowFrequencyHertz >= b.LowFrequencyHertz && a.HighFrequencyHertz <= b.HighFrequencyHertz;
if (eventAEnclosedInTime && eventAEnclosedInTime)
if (eventAEnclosedInTime && eventAEnclosedInFreq)
{
return (null, b);
}

bool eventBEnclosedInTime = a.EventStartSeconds <= b.EventStartSeconds && a.EventEndSeconds >= b.EventEndSeconds;
bool eventBEnclosedInFreq = a.LowFrequencyHertz <= b.LowFrequencyHertz && a.HighFrequencyHertz >= b.HighFrequencyHertz;
if (eventAEnclosedInTime && eventAEnclosedInTime)
if (eventBEnclosedInTime && eventBEnclosedInFreq)
{
return (a, null);
}
Expand Down

0 comments on commit 8630b97

Please sign in to comment.