Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mathutils.c

    rca45e58 r5644069  
    5050{
    5151  fvec_t * win = new_fvec (length);
     52  uint_t err;
    5253  if (win == NULL) {
    5354    return NULL;
    5455  }
    55   uint_t err = fvec_set_window (win, window_type);
     56  err = fvec_set_window (win, window_type);
    5657  if (err != 0) {
    5758    del_fvec(win);
     
    417418
    418419smpl_t fvec_quadratic_peak_pos (fvec_t * x, uint_t pos) {
    419   smpl_t s0, s1, s2;
     420  smpl_t s0, s1, s2; uint_t x0, x2;
    420421  if (pos == 0 || pos == x->length - 1) return pos;
    421   uint_t x0 = (pos < 1) ? pos : pos - 1;
    422   uint_t x2 = (pos + 1 < x->length) ? pos + 1 : pos;
     422  x0 = (pos < 1) ? pos : pos - 1;
     423  x2 = (pos + 1 < x->length) ? pos + 1 : pos;
    423424  if (x0 == pos) return (x->data[pos] <= x->data[x2]) ? pos : x2;
    424425  if (x2 == pos) return (x->data[pos] <= x->data[x0]) ? pos : x0;
     
    448449aubio_freqtomidi (smpl_t freq)
    449450{
     451  smpl_t midi;
    450452  if (freq < 2. || freq > 100000.) return 0.; // avoid nans and infs
    451453  /* log(freq/A-2)/log(2) */
    452   smpl_t midi = freq / 6.875;
     454  midi = freq / 6.875;
    453455  midi = LOG (midi) / 0.69314718055995;
    454456  midi *= 12;
     
    460462aubio_miditofreq (smpl_t midi)
    461463{
     464  smpl_t freq;
    462465  if (midi > 140.) return 0.; // avoid infs
    463   smpl_t freq = (midi + 3.) / 12.;
     466  freq = (midi + 3.) / 12.;
    464467  freq = EXP (freq * 0.69314718055995);
    465468  freq *= 6.875;
Note: See TracChangeset for help on using the changeset viewer.