Changeset 8766cb6 for src/onset


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

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

Location:
src/onset
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.