Changeset 7380327 for src/mathutils.c
- Timestamp:
- Mar 8, 2014, 9:30:49 PM (10 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 5fe5591
- Parents:
- 1e18df6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mathutils.c
r1e18df6 r7380327 1 1 /* 2 Copyright (C) 2003-201 3Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2014 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 430 430 } 431 431 432 smpl_t fvec_quadratic_peak_mag (fvec_t *x, smpl_t pos) { 433 smpl_t x0, x1, x2; 434 uint_t index = (uint_t)(pos - .5) + 1; 435 if (pos >= x->length || pos < 0.) return 0.; 436 if ((smpl_t)index == pos) return x->data[index]; 437 x0 = x->data[index - 1]; 438 x1 = x->data[index]; 439 x2 = x->data[index + 1]; 440 return x1 - .25 * (x0 - x2) * (pos - index); 441 } 442 432 443 uint_t fvec_peakpick(fvec_t * onset, uint_t pos) { 433 444 uint_t tmp=0;
Note: See TracChangeset
for help on using the changeset viewer.