shithub: aubio

Download patch

ref: dccfad214fef00c5c974f6fe1560c0fd3f928fa9
parent: 93579e5338852e2101dbd63fbf1349ab5e1d0022
author: Paul Brossier <piem@piem.org>
date: Mon Mar 27 07:02:07 EDT 2017

src/onset/onset.c: improve specflux parameters

Experiments using Sebastian Böck database of 27770 onsets (1h42m) [1],
showed that adding compression and adaptive-whitening always
out-performs the raw spectral flux function.

Using shorter windows affects overall results, but decreases the delay.

With the following parameters:

  threshold=0.05 win_s=2048 hop_s=1024 novelty=specflux delay_ms=26.6

Strict accuracy / onset:  F  75.184 | P  82.478 | R  69.075 | F3  70.216
mir_eval accuracy / file: F  73.749 | P  81.078 | R  71.662 | F3  72.504
Deviation (ms)            δ  -0.314 | σ  15.396 | δ.  10.89 | σ.   10.88
Total onsets in database: #   27770 | OK  19182 | FP   4075 |

  threshold=0.18 win_s=512  hop_s=256  novelty=specflux delay_ms=13.3

Strict accuracy / onset:  F  73.200 | P  74.419 | R  72.020 | F3  72.253
mir_eval accuracy / file: F  71.674 | P  76.937 | R  73.973 | F3  74.259
Deviation (ms)            δ  -0.576 | σ  17.521 | δ.  13.44 | σ.   11.25
Total onsets in database: #   27770 | OK  20000 | FP   6875 |

Note that, unlike in [1], onsets are not combined before evaluation.

[1] Evaluating the online capabilities of onset detection methods,
Sebastian Böck, Florian Krebs and Markus Schedl (ISMIR 2012)
http://www.cp.jku.at/research/papers/Boeck_etal_ISMIR_2012.pdf

--- a/src/onset/onset.c
+++ b/src/onset/onset.c
@@ -316,9 +316,11 @@
     aubio_onset_set_awhitening(o, 1);
     aubio_onset_set_compression (o, 0.02);
   } else if (strcmp (onset_mode, "specflux") == 0) {
-    aubio_onset_set_threshold (o, 0.25);
+    aubio_onset_set_threshold (o, 0.18);
     aubio_onset_set_awhitening(o, 1);
-    aubio_onset_set_compression (o, 20.);
+    aubio_spectral_whitening_set_relax_time(o->spectral_whitening, 100);
+    aubio_spectral_whitening_set_floor(o->spectral_whitening, 1.);
+    aubio_onset_set_compression (o, 10.);
   } else if (strcmp (onset_mode, "specdiff") == 0) {
   } else {
     AUBIO_WRN("onset: unknown spectral descriptor type %s, "