src/spectral/specdesc.c: add more noise to make sure log doesn't explode when fftnorm...
authorPaul Brossier <piem@piem.org>
Sat, 16 Mar 2013 02:46:34 +0000 (21:46 -0500)
committerPaul Brossier <piem@piem.org>
Sat, 16 Mar 2013 02:46:34 +0000 (21:46 -0500)
src/spectral/specdesc.c

index 38b471b258cf8a11b358b96e69052eab9d79947d..90904d549125a7d9832a2f551e5e30fb02075811 100644 (file)
@@ -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;j<fftgrain->length;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;j<fftgrain->length;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.;