From 4f872d75e8e2e81d50724bb0d7e75ce297d0443b Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 15 Mar 2013 21:46:34 -0500 Subject: [PATCH] src/spectral/specdesc.c: add more noise to make sure log doesn't explode when fftnorm is very small and old fftnorm is null --- src/spectral/specdesc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spectral/specdesc.c b/src/spectral/specdesc.c index 38b471b2..90904d54 100644 --- a/src/spectral/specdesc.c +++ b/src/spectral/specdesc.c @@ -193,7 +193,7 @@ void aubio_specdesc_kl(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset){ onset->data[0] = 0.; for (j=0;jlength;j++) { onset->data[0] += fftgrain->norm[j] - *LOG(1.+fftgrain->norm[j]/(o->oldmag->data[j]+1.e-10)); + *LOG(1.+fftgrain->norm[j]/(o->oldmag->data[j]+1.e-1)); o->oldmag->data[j] = fftgrain->norm[j]; } if (isnan(onset->data[0])) onset->data[0] = 0.; @@ -206,7 +206,7 @@ void aubio_specdesc_mkl(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset){ uint_t j; onset->data[0] = 0.; for (j=0;jlength;j++) { - onset->data[0] += LOG(1.+fftgrain->norm[j]/(o->oldmag->data[j]+1.e-10)); + onset->data[0] += LOG(1.+fftgrain->norm[j]/(o->oldmag->data[j]+1.e-1)); o->oldmag->data[j] = fftgrain->norm[j]; } if (isnan(onset->data[0])) onset->data[0] = 0.; -- 2.26.2