Changeset 258195f


Ignore:
Timestamp:
Sep 28, 2009, 8:58:03 PM (15 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:
916f8983
Parents:
17b7d66
Message:

src/aubio_priv.h: define VERY_SMALL_NUMBER here, add KILL_DENORMAL and CEIL_DENORMAL macros, SAFE_LOG10 and SAFE_LOG

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/aubio_priv.h

    r17b7d66 r258195f  
    190190#define ELEM_SWAP(a,b) { register smpl_t t=(a);(a)=(b);(b)=t; }
    191191
    192 #define ISDENORMAL(f) f < 1.e-37
     192#define VERY_SMALL_NUMBER 2.e-42 //1.e-37
     193
     194#define IS_DENORMAL(f) f < VERY_SMALL_NUMBER
     195
     196#define KILL_DENORMAL(f)  IS_DENORMAL(f) ? 0. : f
     197#define CEIL_DENORMAL(f)  IS_DENORMAL(f) ? VERY_SMALL_NUMBER : f
     198
     199#define SAFE_LOG10(f) LOG10(CEIL_DENORMAL(f))
     200#define SAFE_LOG(f)   LOG(CEIL_DENORMAL(f))
    193201
    194202#define UNUSED __attribute__((unused))
  • src/temporal/filter.c

    r17b7d66 r258195f  
    4545    for (j = 0; j < in->length; j++) {
    4646      /* new input */
    47       if (ISDENORMAL(in->data[i][j])) {
     47      if (IS_DENORMAL(in->data[i][j])) {
    4848        x[0] = y[0] = 0.;
    4949      } else {
Note: See TracChangeset for help on using the changeset viewer.