Changeset 56ef7e1 for src/mathutils.h


Ignore:
Timestamp:
Oct 18, 2009, 3:08:59 PM (15 years ago)
Author:
Paul Brossier <piem@piem.org>
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:
e5f49af
Parents:
74516f7
Message:

Change peakpicker to match API specs, make quadint per channel

  • src/mathutils.c
    • add per channel mean and median
    • update moving thres and adapt_thres accordingly
    • change quadint unused span argument to a channel argument
  • src/onset/onset.c:
    • make wasonset a vector for multi channel, use new peakpicker
  • src/onset/peakpick.c:
    • update peakpicker do for multi channeling
  • src/pitch/: update use to fvec_quadint
  • src/tempo/beattracking.c: update calls to fvec_quadint
  • src/tempo/tempo.c: update peakpicker usage
  • tests/src/test-peakpick.c: update peakpicker usage
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mathutils.h

    r74516f7 r56ef7e1  
    6060/** compute the mean of a vector
    6161
    62   \param s vector to compute norm from
     62  \param s vector to compute mean from
    6363
    6464  \return the mean of v
     
    6666*/
    6767smpl_t fvec_mean (fvec_t * s);
     68
     69/** compute the mean of a vector channel
     70
     71  \param s vector to compute mean from
     72  \param i channel to compute mean from
     73
     74  \return the mean of v
     75
     76*/
     77smpl_t fvec_mean_channel (fvec_t * s, uint_t i);
    6878
    6979/** find the max of a vector
     
    220230*/
    221231smpl_t fvec_moving_thres (fvec_t * v, fvec_t * tmp, uint_t post, uint_t pre,
    222     uint_t pos);
     232    uint_t pos, uint_t channel);
    223233
    224234/** apply adaptive threshold to a vector
     
    233243
    234244*/
    235 void fvec_adapt_thres (fvec_t * v, fvec_t * tmp, uint_t post, uint_t pre);
     245void fvec_adapt_thres (fvec_t * v, fvec_t * tmp, uint_t post, uint_t pre,
     246    uint_t channel);
    236247
    237248/** returns the median of a vector
     
    246257
    247258  \param v vector to get median from
     259  \param channel channel to get median from
    248260
    249261  \return the median of v
    250262 
    251263*/
    252 smpl_t fvec_median (fvec_t * v);
     264smpl_t fvec_median_channel (fvec_t * v, uint_t channel);
    253265
    254266/** finds exact peak index by quadratic interpolation*/
    255 smpl_t fvec_quadint (fvec_t * x, uint_t pos, uint_t span);
     267smpl_t fvec_quadint (fvec_t * x, uint_t pos, uint_t channel);
    256268
    257269/** Quadratic interpolation using Lagrange polynomial.
Note: See TracChangeset for help on using the changeset viewer.