From 276dc75833838ea82a5e64393676f40e854f60ab Mon Sep 17 00:00:00 2001 From: towsey Date: Thu, 17 Sep 2020 11:20:43 +1000 Subject: [PATCH] Update ForwardTrackAlgorithm.cs Issue #370 Do not add very short tracks to list of potential events --- src/AudioAnalysisTools/Tracks/ForwardTrackAlgorithm.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/AudioAnalysisTools/Tracks/ForwardTrackAlgorithm.cs b/src/AudioAnalysisTools/Tracks/ForwardTrackAlgorithm.cs index 192a09411..d28280e18 100644 --- a/src/AudioAnalysisTools/Tracks/ForwardTrackAlgorithm.cs +++ b/src/AudioAnalysisTools/Tracks/ForwardTrackAlgorithm.cs @@ -158,7 +158,12 @@ public static List GetForwardTracks(double[,] peaks, double minDuration, // Visit each spectral peak in order. Each may be start of possible track var track = GetForwardTrack(peaks, row, col, threshold, converter); - tracks.Add(track); + + // a forward track should have length >2 + if (track.PointCount > 2) + { + tracks.Add(track); + } } }