From 46b2c4dad53431e4a007d9660242bdcf4a4b152e Mon Sep 17 00:00:00 2001 From: David Protzman Date: Sat, 30 Apr 2022 11:59:32 -0400 Subject: [PATCH] Warning the user if correlation threshold > 1.0 Now that the xcorr is truly normalized, there's no good reason to go above 1.0 --- matlab/updated_scripts/extract_bursts_from_file.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/matlab/updated_scripts/extract_bursts_from_file.m b/matlab/updated_scripts/extract_bursts_from_file.m index 05dac7d..69a3008 100644 --- a/matlab/updated_scripts/extract_bursts_from_file.m +++ b/matlab/updated_scripts/extract_bursts_from_file.m @@ -36,6 +36,10 @@ function [bursts] = extract_bursts_from_file(input_path, sample_rate, frequency_ assert(isnumeric(padding), "Padding must be numeric"); assert(padding >= 0, "Padding must be >= 0"); assert(mod(length(varargin), 2) == 0, "Varargs length must be a multiple of 2"); + + if (correlation_threshold > 1.0) + warning("Correlation threshold is greater than 1.0. This is likely going to cause the correlation to fail!"); + end % Default the type of each I and Q value to 32-bit floating point sample_type = 'single';