Changeset 4f872d7


Ignore:
Timestamp:
Mar 16, 2013, 3:46:34 AM (11 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
8c43bf7
Parents:
cb243f2
Message:

src/spectral/specdesc.c: add more noise to make sure log doesn't explode when fftnorm is very small and old fftnorm is null

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/spectral/specdesc.c

    rcb243f2 r4f872d7  
    194194    for (j=0;j<fftgrain->length;j++) {
    195195      onset->data[0] += fftgrain->norm[j]
    196         *LOG(1.+fftgrain->norm[j]/(o->oldmag->data[j]+1.e-10));
     196        *LOG(1.+fftgrain->norm[j]/(o->oldmag->data[j]+1.e-1));
    197197      o->oldmag->data[j] = fftgrain->norm[j];
    198198    }
     
    207207    onset->data[0] = 0.;
    208208    for (j=0;j<fftgrain->length;j++) {
    209       onset->data[0] += LOG(1.+fftgrain->norm[j]/(o->oldmag->data[j]+1.e-10));
     209      onset->data[0] += LOG(1.+fftgrain->norm[j]/(o->oldmag->data[j]+1.e-1));
    210210      o->oldmag->data[j] = fftgrain->norm[j];
    211211    }
Note: See TracChangeset for help on using the changeset viewer.