Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mathutils.c

    r5644069 rca45e58  
    5050{
    5151  fvec_t * win = new_fvec (length);
    52   uint_t err;
    5352  if (win == NULL) {
    5453    return NULL;
    5554  }
    56   err = fvec_set_window (win, window_type);
     55  uint_t err = fvec_set_window (win, window_type);
    5756  if (err != 0) {
    5857    del_fvec(win);
     
    418417
    419418smpl_t fvec_quadratic_peak_pos (fvec_t * x, uint_t pos) {
    420   smpl_t s0, s1, s2; uint_t x0, x2;
     419  smpl_t s0, s1, s2;
    421420  if (pos == 0 || pos == x->length - 1) return pos;
    422   x0 = (pos < 1) ? pos : pos - 1;
    423   x2 = (pos + 1 < x->length) ? pos + 1 : pos;
     421  uint_t x0 = (pos < 1) ? pos : pos - 1;
     422  uint_t x2 = (pos + 1 < x->length) ? pos + 1 : pos;
    424423  if (x0 == pos) return (x->data[pos] <= x->data[x2]) ? pos : x2;
    425424  if (x2 == pos) return (x->data[pos] <= x->data[x0]) ? pos : x0;
     
    449448aubio_freqtomidi (smpl_t freq)
    450449{
    451   smpl_t midi;
    452450  if (freq < 2. || freq > 100000.) return 0.; // avoid nans and infs
    453451  /* log(freq/A-2)/log(2) */
    454   midi = freq / 6.875;
     452  smpl_t midi = freq / 6.875;
    455453  midi = LOG (midi) / 0.69314718055995;
    456454  midi *= 12;
     
    462460aubio_miditofreq (smpl_t midi)
    463461{
    464   smpl_t freq;
    465462  if (midi > 140.) return 0.; // avoid infs
    466   freq = (midi + 3.) / 12.;
     463  smpl_t freq = (midi + 3.) / 12.;
    467464  freq = EXP (freq * 0.69314718055995);
    468465  freq *= 6.875;
Note: See TracChangeset for help on using the changeset viewer.