Changeset c965b33 for src/mathutils.c


Ignore:
Timestamp:
Mar 6, 2013, 9:30:55 PM (7 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
043c48c
Parents:
037319a
Message:

src/mathutils.c: freqtobin and bintofreq to not produce negative values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mathutils.c

    r037319a rc965b33  
    422422{
    423423  smpl_t freq = samplerate / fftsize;
    424   return freq * bin;
     424  return freq * MAX(bin, 0);
    425425}
    426426
     
    436436{
    437437  smpl_t bin = fftsize / samplerate;
    438   return freq * bin;
     438  return MAX(freq, 0) * bin;
    439439}
    440440
Note: See TracChangeset for help on using the changeset viewer.