From 62fd7eda901e8ed47b19af4ba88ca140cf5536b4 Mon Sep 17 00:00:00 2001 From: Frank Werner-Krippendorf Date: Mon, 25 Apr 2022 08:44:47 +0200 Subject: [PATCH] abandon burst at invalid left_idx (0) --- matlab/updated_scripts/find_zc_indices_by_file.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matlab/updated_scripts/find_zc_indices_by_file.m b/matlab/updated_scripts/find_zc_indices_by_file.m index 415096e..4ddbb24 100644 --- a/matlab/updated_scripts/find_zc_indices_by_file.m +++ b/matlab/updated_scripts/find_zc_indices_by_file.m @@ -78,7 +78,7 @@ function [zc_indices] = find_zc_indices_by_file(file_path, sample_rate, frequenc left_idx = passing_scores(idx) - (search_window / 2); right_idx = left_idx + search_window - 1; - if (left_idx < 0 || right_idx > length(abs_scores)) + if (left_idx < 1 || right_idx > length(abs_scores)) warning("Had to abandon searching for burst '%d' as it was too close to the end/beginning of the window", idx); continue end