From d51910287bd907e959b4defbf7f97134590e86d2 Mon Sep 17 00:00:00 2001 From: Pawel Langowski Date: Mon, 9 Mar 2026 10:39:35 +0000 Subject: [PATCH] tools: analyze-wav.py: Increase coverage threshold Increase the coverage threshold for detecting audio glitches. The threshold defines how many frequencies need to be "active" to mark a point as a glitch. The increase of the parameter decreases a chance for a false positive where the spectrogram is "blurry", but doesn't contain glitches. Signed-off-by: Pawel Langowski --- tools/analyze-wav.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/analyze-wav.py b/tools/analyze-wav.py index daf5a153..bbac5f96 100644 --- a/tools/analyze-wav.py +++ b/tools/analyze-wav.py @@ -85,7 +85,7 @@ def detect_vertical_lines(wav_file): # If the normalised frequency is greater than the threshold, mark it as active. active_freqs = Sxx_norm > freq_threshold coverage = np.sum(active_freqs, axis=0) / active_freqs.shape[0] - coverage_threshold = 0.8 + coverage_threshold = 0.95 # If coverage exceeds threshold, mark as vertical line. vertical_lines = np.where(coverage > coverage_threshold)[0] print(f"Detected possible glitches at time indices: {vertical_lines + trim_samples + non_silent[0]}")