Changeset f3f28b1


Ignore:
Timestamp:
Jul 21, 2006, 3:52:53 PM (15 years ago)
Author:
Paul Brossier <piem@altern.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
e21208e
Parents:
283d93f
Message:

avoid another out of boundaries write in yinfft
avoid another out of boundaries write in yinfft

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/pitchyinfft.c

    r283d93f rf3f28b1  
    118118  for (tau=1; tau < yin->length; tau++) {
    119119          yin->data[0][tau] = sum -
    120                   res->norm[0][tau+1]*COS(res->phas[0][tau+1]);
     120                  res->norm[0][tau]*COS(res->phas[0][tau]);
    121121          tmp += yin->data[0][tau];
    122122          yin->data[0][tau] *= tau/tmp;
     
    130130          /* additional check for (unlikely) octave doubling in higher frequencies */
    131131          if (tau>35) {
    132                   return vec_quadint_min(yin,tau,1)+1;
     132                  return vec_quadint_min(yin,tau,1);
    133133          } else {
    134134                  /* should compare the minimum value of each interpolated peaks */
    135135                  halfperiod = FLOOR(tau/2+.5);
    136136                  if (yin->data[0][halfperiod] < tol)
    137                           return vec_quadint_min(yin,halfperiod,1)+1;
     137                          return vec_quadint_min(yin,halfperiod,1);
    138138                  else
    139                           return vec_quadint_min(yin,tau,1)+1;
     139                          return vec_quadint_min(yin,tau,1);
    140140          }
    141141  } else
Note: See TracChangeset for help on using the changeset viewer.