Changeset 04ebe31


Ignore:
Timestamp:
Mar 11, 2017, 12:20:39 AM (3 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, sampler
Children:
90e25cc
Parents:
6352034
Message:

src/spectral/awhitening.c: use 1.e-4 for floor, make sure we peak values stay above it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/spectral/awhitening.c

    r6352034 r04ebe31  
    2525#include "spectral/awhitening.h"
    2626
    27 #define aubio_spectral_whitening_default_relax_time   30    // in seconds
     27#define aubio_spectral_whitening_default_relax_time   250   // in seconds, between 22 and 446
    2828#define aubio_spectral_whitening_default_decay        0.001 // -60dB attenuation
     29#define aubio_spectral_whitening_default_floor        1.e-4 // from 1.e-6 to .2
    2930
    3031/** structure to store object state */
     
    4445  uint_t i = 0;
    4546  for (i = 0; i < o->peak_values->length; i++) {
    46     o->peak_values->data[i] =
    47       MAX(fftgrain->norm[i], o->r_decay * o->peak_values->data[i]);
     47    smpl_t tmp = MAX(o->r_decay * o->peak_values->data[i], o->floor);
     48    o->peak_values->data[i] = MAX(fftgrain->norm[i], tmp);
    4849    fftgrain->norm[i] /= o->peak_values->data[i];
    4950  }
     
    6869  o->hop_size = hop_size;
    6970  o->samplerate = samplerate;
    70   o->floor = 1.e-6; // from 1.e-6 to 0.2
     71  o->floor = aubio_spectral_whitening_default_floor;
    7172  aubio_spectral_whitening_set_relax_time (o, aubio_spectral_whitening_default_relax_time);
    7273  aubio_spectral_whitening_reset (o);
Note: See TracChangeset for help on using the changeset viewer.