Changeset 8766cb6


Ignore:
Timestamp:
Oct 7, 2009, 8:31:43 PM (14 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:
a808d05
Parents:
cfa0f12
Message:

src/onset/peakpick.c: rename aubio_pickpeak_t to aubio_peakpicker_t

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • examples/utils.c

    rcfa0f12 r8766cb6  
    6969fvec_t *onset2;
    7070smpl_t isonset = 0;
    71 aubio_pickpeak_t *parms;
     71aubio_peakpicker_t *parms;
    7272
    7373
  • examples/utils.h

    rcfa0f12 r8766cb6  
    102102extern fvec_t *onset2;
    103103extern smpl_t isonset;
    104 extern aubio_pickpeak_t *parms;
     104extern aubio_peakpicker_t *parms;
    105105
    106106
  • src/onset/onset.c

    rcfa0f12 r8766cb6  
    3131  aubio_pvoc_t * pv;            /**< phase vocoder */
    3232  aubio_onsetdetection_t * od;  /**< onset detection */
    33   aubio_pickpeak_t * pp;        /**< peak picker */
     33  aubio_peakpicker_t * pp;      /**< peak picker */
    3434  cvec_t * fftgrain;            /**< phase vocoder output */
    3535  fvec_t * of;                  /**< onset detection function */
  • src/onset/peakpick.c

    rcfa0f12 r8766cb6  
    3030 *      time->           ^now
    3131 */
    32 struct _aubio_pickpeak_t {
     32struct _aubio_peakpicker_t {
    3333        /** thresh: offset threshold [0.033 or 0.01] */
    3434        smpl_t threshold;       
     
    6868 * is slightly more permissive than the offline one, and yelds to an increase
    6969 * of false positives. best  */
    70 smpl_t aubio_peakpicker_do(aubio_pickpeak_t * p, fvec_t * onset) {
     70smpl_t aubio_peakpicker_do(aubio_peakpicker_t * p, fvec_t * onset) {
    7171        fvec_t * onset_keep = (fvec_t *)p->onset_keep;
    7272        fvec_t * onset_proc = (fvec_t *)p->onset_proc;
     
    121121 * after smoothing
    122122 */
    123 smpl_t aubio_peakpicker_get_thresholded_input(aubio_pickpeak_t * p)
     123smpl_t aubio_peakpicker_get_thresholded_input(aubio_peakpicker_t * p)
    124124{
    125125        return p->onset_peek->data[0][1];
     
    127127
    128128/** function added by Miguel Ramirez to return the onset detection amplitude in peakval */
    129 void aubio_peakpicker_set_threshold(aubio_pickpeak_t * p, smpl_t threshold) {
     129void aubio_peakpicker_set_threshold(aubio_peakpicker_t * p, smpl_t threshold) {
    130130        p->threshold = threshold;
    131131        return;
    132132}
    133133
    134 smpl_t aubio_peakpicker_get_threshold(aubio_pickpeak_t * p) {
     134smpl_t aubio_peakpicker_get_threshold(aubio_peakpicker_t * p) {
    135135        return p->threshold;
    136136}
    137137
    138 void aubio_peakpicker_set_thresholdfn(aubio_pickpeak_t * p, aubio_thresholdfn_t thresholdfn) {
     138void aubio_peakpicker_set_thresholdfn(aubio_peakpicker_t * p, aubio_thresholdfn_t thresholdfn) {
    139139        p->thresholdfn = thresholdfn;
    140140        return;
    141141}
    142142
    143 aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_pickpeak_t * p) {
     143aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_peakpicker_t * p) {
    144144        return (aubio_thresholdfn_t) (p->thresholdfn);
    145145}
    146146
    147 aubio_pickpeak_t * new_aubio_peakpicker(smpl_t threshold) {
    148         aubio_pickpeak_t * t = AUBIO_NEW(aubio_pickpeak_t);
     147aubio_peakpicker_t * new_aubio_peakpicker(smpl_t threshold) {
     148        aubio_peakpicker_t * t = AUBIO_NEW(aubio_peakpicker_t);
    149149        t->threshold = 0.1; /* 0.0668; 0.33; 0.082; 0.033; */
    150150        if (threshold > 0. && threshold < 10.)
     
    167167}
    168168
    169 void del_aubio_peakpicker(aubio_pickpeak_t * p) {
     169void del_aubio_peakpicker(aubio_peakpicker_t * p) {
    170170        del_aubio_biquad(p->biquad);
    171171        del_fvec(p->onset_keep);
  • src/onset/peakpick.h

    rcfa0f12 r8766cb6  
    3636typedef uint_t (*aubio_pickerfn_t)(fvec_t *input, uint_t pos);
    3737/** peak-picker structure */
    38 typedef struct _aubio_pickpeak_t aubio_pickpeak_t;
     38typedef struct _aubio_peakpicker_t aubio_peakpicker_t;
    3939
    4040/** peak-picker creation function */
    41 aubio_pickpeak_t * new_aubio_peakpicker(smpl_t threshold);
     41aubio_peakpicker_t * new_aubio_peakpicker(smpl_t threshold);
    4242/** real time peak picking function */
    43 smpl_t aubio_peakpicker_do(aubio_pickpeak_t * p, fvec_t * DF);
     43smpl_t aubio_peakpicker_do(aubio_peakpicker_t * p, fvec_t * DF);
    4444/** get current peak value */
    45 smpl_t aubio_peakpicker_get_thresholded_input(aubio_pickpeak_t * p);
     45smpl_t aubio_peakpicker_get_thresholded_input(aubio_peakpicker_t * p);
    4646/** destroy peak picker structure */
    47 void del_aubio_peakpicker(aubio_pickpeak_t * p);
     47void del_aubio_peakpicker(aubio_peakpicker_t * p);
    4848
    4949/** set peak picking threshold */
    50 void aubio_peakpicker_set_threshold(aubio_pickpeak_t * p, smpl_t threshold);
     50void aubio_peakpicker_set_threshold(aubio_peakpicker_t * p, smpl_t threshold);
    5151/** get peak picking threshold */
    52 smpl_t aubio_peakpicker_get_threshold(aubio_pickpeak_t * p);
     52smpl_t aubio_peakpicker_get_threshold(aubio_peakpicker_t * p);
    5353/** set peak picker thresholding function */
    54 void aubio_peakpicker_set_thresholdfn(aubio_pickpeak_t * p, aubio_thresholdfn_t thresholdfn);
     54void aubio_peakpicker_set_thresholdfn(aubio_peakpicker_t * p, aubio_thresholdfn_t thresholdfn);
    5555/** get peak picker thresholding function */
    56 aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_pickpeak_t * p);
     56aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_peakpicker_t * p);
    5757
    5858#ifdef __cplusplus
  • src/tempo/tempo.c

    rcfa0f12 r8766cb6  
    3232  aubio_onsetdetection_t * od;   /** onset detection */
    3333  aubio_pvoc_t * pv;             /** phase vocoder */
    34   aubio_pickpeak_t * pp;         /** peak picker */
     34  aubio_peakpicker_t * pp;       /** peak picker */
    3535  aubio_beattracking_t * bt;     /** beat tracking */
    3636  cvec_t * fftgrain;             /** spectral frame */
  • swig/aubio.i

    rcfa0f12 r8766cb6  
    163163/* filterbank */
    164164aubio_filterbank_t * new_aubio_filterbank(uint_t win_s, uint_t channels);
    165 void aubio_filterbank_set_mel_coeffs(aubio_filterbank_t *fb, uint_t samplerate, fvec_t *freqs);
     165void aubio_filterbank_set_triangle_bands (aubio_filterbank_t *fb, uint_t samplerate, fvec_t *freqs);
    166166void aubio_filterbank_set_mel_coeffs_slaney(aubio_filterbank_t *fb, uint_t samplerate);
    167167void del_aubio_filterbank(aubio_filterbank_t * fb);
     
    270270
    271271/* peakpicker */
    272 aubio_pickpeak_t * new_aubio_peakpicker(smpl_t threshold);
    273 smpl_t aubio_peakpicker_do(aubio_pickpeak_t * p, fvec_t * df);
    274 smpl_t aubio_peakpicker_get_thresholded_input(aubio_pickpeak_t* p);
    275 void del_aubio_peakpicker(aubio_pickpeak_t * p);
    276 void aubio_peakpicker_set_threshold(aubio_pickpeak_t * p, smpl_t threshold);
    277 smpl_t aubio_peakpicker_get_threshold(aubio_pickpeak_t * p);
     272aubio_peakpicker_t * new_aubio_peakpicker(smpl_t threshold);
     273smpl_t aubio_peakpicker_do(aubio_peakpicker_t * p, fvec_t * df);
     274smpl_t aubio_peakpicker_get_thresholded_input(aubio_peakpicker_t* p);
     275void del_aubio_peakpicker(aubio_peakpicker_t * p);
     276void aubio_peakpicker_set_threshold(aubio_peakpicker_t * p, smpl_t threshold);
     277smpl_t aubio_peakpicker_get_threshold(aubio_peakpicker_t * p);
    278278
    279279/* transient/steady state separation */
  • tests/src/test-peakpick.c

    rcfa0f12 r8766cb6  
    66        uint_t channels   = 1;                          /* number of channel */
    77        fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
    8         aubio_pickpeak_t * o = new_aubio_peakpicker(0.3);
     8        aubio_peakpicker_t * o = new_aubio_peakpicker(0.3);
    99
    1010        aubio_peakpicker_do(o, in);
Note: See TracChangeset for help on using the changeset viewer.