From: Paul Brossier Date: Sat, 16 Mar 2013 02:46:34 +0000 (-0500) Subject: src/spectral/specdesc.c: add more noise to make sure log doesn't explode when fftnorm... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4f872d75e8e2e81d50724bb0d7e75ce297d0443b;p=aubio.git src/spectral/specdesc.c: add more noise to make sure log doesn't explode when fftnorm is very small and old fftnorm is null --- 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.;