src/onset/peakpick.c: rename aubio_pickpeak_t to aubio_peakpicker_t
authorPaul Brossier <piem@piem.org>
Wed, 7 Oct 2009 18:31:43 +0000 (20:31 +0200)
committerPaul Brossier <piem@piem.org>
Wed, 7 Oct 2009 18:31:43 +0000 (20:31 +0200)
examples/utils.c
examples/utils.h
src/onset/onset.c
src/onset/peakpick.c
src/onset/peakpick.h
src/tempo/tempo.c
swig/aubio.i
tests/src/test-peakpick.c

index fe86ef8c15dc2989cb855b7c05e7d6e464b41fe3..a50aef2759351a2edd11f3de7d308c0987d1ffe7 100644 (file)
@@ -68,7 +68,7 @@ aubio_onsetdetection_t *o2;
 fvec_t *onset;
 fvec_t *onset2;
 smpl_t isonset = 0;
-aubio_pickpeak_t *parms;
+aubio_peakpicker_t *parms;
 
 
 /* pitch objects */
index b3acf328b3d81550b00ff717b70ad874292b590d..b01defcb1bdc8f16b0223218b5cd5de4f1b32cb6 100644 (file)
@@ -101,7 +101,7 @@ extern aubio_onsetdetection_t *o2;
 extern fvec_t *onset;
 extern fvec_t *onset2;
 extern smpl_t isonset;
-extern aubio_pickpeak_t *parms;
+extern aubio_peakpicker_t *parms;
 
 
 /* pitch objects */
index ae739656134e21ac74abda94c286c255998f6b7d..c5cff85577c7966bb6b878381b62be9ea1ffe87d 100644 (file)
@@ -30,7 +30,7 @@
 struct _aubio_onset_t {
   aubio_pvoc_t * pv;            /**< phase vocoder */
   aubio_onsetdetection_t * od;  /**< onset detection */ 
-  aubio_pickpeak_t * pp;        /**< peak picker */
+  aubio_peakpicker_t * pp;      /**< peak picker */
   cvec_t * fftgrain;            /**< phase vocoder output */
   fvec_t * of;                  /**< onset detection function */
   smpl_t threshold;             /**< onset peak picking threshold */
index ee2bfe58bf5e150d64dc17f9280f6f87302316a7..b93918df66524c72b2f08200cb4306f7a92f9d38 100644 (file)
@@ -29,7 +29,7 @@
  *     .................|.............
  *     time->           ^now
  */
-struct _aubio_pickpeak_t {
+struct _aubio_peakpicker_t {
        /** thresh: offset threshold [0.033 or 0.01] */
        smpl_t threshold;       
        /** win_post: median filter window length (causal part) [8] */
@@ -67,7 +67,7 @@ struct _aubio_pickpeak_t {
 /** modified version for real time, moving mean adaptive threshold this method
  * is slightly more permissive than the offline one, and yelds to an increase
  * of false positives. best  */
-smpl_t aubio_peakpicker_do(aubio_pickpeak_t * p, fvec_t * onset) {
+smpl_t aubio_peakpicker_do(aubio_peakpicker_t * p, fvec_t * onset) {
        fvec_t * onset_keep = (fvec_t *)p->onset_keep;
        fvec_t * onset_proc = (fvec_t *)p->onset_proc;
        fvec_t * onset_peek = (fvec_t *)p->onset_peek;
@@ -120,32 +120,32 @@ smpl_t aubio_peakpicker_do(aubio_pickpeak_t * p, fvec_t * onset) {
 /** this method returns the current value in the pick peaking buffer
  * after smoothing
  */
-smpl_t aubio_peakpicker_get_thresholded_input(aubio_pickpeak_t * p) 
+smpl_t aubio_peakpicker_get_thresholded_input(aubio_peakpicker_t * p) 
 {
        return p->onset_peek->data[0][1];
 }
 
 /** function added by Miguel Ramirez to return the onset detection amplitude in peakval */
-void aubio_peakpicker_set_threshold(aubio_pickpeak_t * p, smpl_t threshold) {
+void aubio_peakpicker_set_threshold(aubio_peakpicker_t * p, smpl_t threshold) {
        p->threshold = threshold;
        return;
 }
 
-smpl_t aubio_peakpicker_get_threshold(aubio_pickpeak_t * p) {
+smpl_t aubio_peakpicker_get_threshold(aubio_peakpicker_t * p) {
        return p->threshold;
 }
 
-void aubio_peakpicker_set_thresholdfn(aubio_pickpeak_t * p, aubio_thresholdfn_t thresholdfn) {
+void aubio_peakpicker_set_thresholdfn(aubio_peakpicker_t * p, aubio_thresholdfn_t thresholdfn) {
        p->thresholdfn = thresholdfn;
        return;
 }
 
-aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_pickpeak_t * p) {
+aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_peakpicker_t * p) {
        return (aubio_thresholdfn_t) (p->thresholdfn);
 }
 
-aubio_pickpeak_t * new_aubio_peakpicker(smpl_t threshold) {
-       aubio_pickpeak_t * t = AUBIO_NEW(aubio_pickpeak_t);
+aubio_peakpicker_t * new_aubio_peakpicker(smpl_t threshold) {
+       aubio_peakpicker_t * t = AUBIO_NEW(aubio_peakpicker_t);
        t->threshold = 0.1; /* 0.0668; 0.33; 0.082; 0.033; */
        if (threshold > 0. && threshold < 10.)
                t->threshold = threshold;
@@ -166,7 +166,7 @@ aubio_pickpeak_t * new_aubio_peakpicker(smpl_t threshold) {
        return t;
 }
 
-void del_aubio_peakpicker(aubio_pickpeak_t * p) {
+void del_aubio_peakpicker(aubio_peakpicker_t * p) {
        del_aubio_biquad(p->biquad);
        del_fvec(p->onset_keep);
        del_fvec(p->onset_proc);
index 73ad728227ae52514cf9c43b6e550fd05517dccb..4d193f45316909318053c522de82777660c6d5e5 100644 (file)
@@ -35,25 +35,25 @@ typedef smpl_t (*aubio_thresholdfn_t)(fvec_t *input);
 /** function pointer to peak-picking function */
 typedef uint_t (*aubio_pickerfn_t)(fvec_t *input, uint_t pos);
 /** peak-picker structure */
-typedef struct _aubio_pickpeak_t aubio_pickpeak_t;
+typedef struct _aubio_peakpicker_t aubio_peakpicker_t;
 
 /** peak-picker creation function */
-aubio_pickpeak_t * new_aubio_peakpicker(smpl_t threshold);
+aubio_peakpicker_t * new_aubio_peakpicker(smpl_t threshold);
 /** real time peak picking function */
-smpl_t aubio_peakpicker_do(aubio_pickpeak_t * p, fvec_t * DF);
+smpl_t aubio_peakpicker_do(aubio_peakpicker_t * p, fvec_t * DF);
 /** get current peak value */
-smpl_t aubio_peakpicker_get_thresholded_input(aubio_pickpeak_t * p);
+smpl_t aubio_peakpicker_get_thresholded_input(aubio_peakpicker_t * p);
 /** destroy peak picker structure */
-void del_aubio_peakpicker(aubio_pickpeak_t * p);
+void del_aubio_peakpicker(aubio_peakpicker_t * p);
 
 /** set peak picking threshold */
-void aubio_peakpicker_set_threshold(aubio_pickpeak_t * p, smpl_t threshold);
+void aubio_peakpicker_set_threshold(aubio_peakpicker_t * p, smpl_t threshold);
 /** get peak picking threshold */
-smpl_t aubio_peakpicker_get_threshold(aubio_pickpeak_t * p);
+smpl_t aubio_peakpicker_get_threshold(aubio_peakpicker_t * p);
 /** set peak picker thresholding function */
-void aubio_peakpicker_set_thresholdfn(aubio_pickpeak_t * p, aubio_thresholdfn_t thresholdfn);
+void aubio_peakpicker_set_thresholdfn(aubio_peakpicker_t * p, aubio_thresholdfn_t thresholdfn);
 /** get peak picker thresholding function */
-aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_pickpeak_t * p);
+aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_peakpicker_t * p);
 
 #ifdef __cplusplus
 }
index a16a68daaa5d53330bb8047c705ca82009f2e5cb..16346a23102d08e683d3fc82e0e1371e1920a34f 100644 (file)
@@ -31,7 +31,7 @@
 struct _aubio_tempo_t {
   aubio_onsetdetection_t * od;   /** onset detection */
   aubio_pvoc_t * pv;             /** phase vocoder */
-  aubio_pickpeak_t * pp;         /** peak picker */
+  aubio_peakpicker_t * pp;       /** peak picker */
   aubio_beattracking_t * bt;     /** beat tracking */
   cvec_t * fftgrain;             /** spectral frame */
   fvec_t * of;                   /** onset detection function value */
index 939d835ff8e0aea3b4f1962c1f0bb54fd93275c1..892660ef79591d7e93035f618f959de2da89867a 100644 (file)
@@ -162,7 +162,7 @@ smpl_t aubio_spectral_centroid(cvec_t * spectrum, smpl_t samplerate);
 
 /* filterbank */
 aubio_filterbank_t * new_aubio_filterbank(uint_t win_s, uint_t channels);
-void aubio_filterbank_set_mel_coeffs(aubio_filterbank_t *fb, uint_t samplerate, fvec_t *freqs);
+void aubio_filterbank_set_triangle_bands (aubio_filterbank_t *fb, uint_t samplerate, fvec_t *freqs);
 void aubio_filterbank_set_mel_coeffs_slaney(aubio_filterbank_t *fb, uint_t samplerate);
 void del_aubio_filterbank(aubio_filterbank_t * fb);
 void aubio_filterbank_do(aubio_filterbank_t * fb, cvec_t * in, fvec_t *out);
@@ -269,12 +269,12 @@ smpl_t aubio_pitchfcomb_do (aubio_pitchfcomb_t *p, fvec_t * input);
 void del_aubio_pitchfcomb (aubio_pitchfcomb_t *p);
 
 /* peakpicker */
-aubio_pickpeak_t * new_aubio_peakpicker(smpl_t threshold);
-smpl_t aubio_peakpicker_do(aubio_pickpeak_t * p, fvec_t * df);
-smpl_t aubio_peakpicker_get_thresholded_input(aubio_pickpeak_t* p);
-void del_aubio_peakpicker(aubio_pickpeak_t * p);
-void aubio_peakpicker_set_threshold(aubio_pickpeak_t * p, smpl_t threshold);
-smpl_t aubio_peakpicker_get_threshold(aubio_pickpeak_t * p);
+aubio_peakpicker_t * new_aubio_peakpicker(smpl_t threshold);
+smpl_t aubio_peakpicker_do(aubio_peakpicker_t * p, fvec_t * df);
+smpl_t aubio_peakpicker_get_thresholded_input(aubio_peakpicker_t* p);
+void del_aubio_peakpicker(aubio_peakpicker_t * p);
+void aubio_peakpicker_set_threshold(aubio_peakpicker_t * p, smpl_t threshold);
+smpl_t aubio_peakpicker_get_threshold(aubio_peakpicker_t * p);
 
 /* transient/steady state separation */
 aubio_tss_t * new_aubio_tss(smpl_t thrs, smpl_t alfa, smpl_t beta,
index dcfb51356eca87753e4ac2662f782a3326e347a2..81c8e7fcee3b37848076fa4ccc1d87366d28462e 100644 (file)
@@ -5,7 +5,7 @@ int main(){
         uint_t win_s      = 1024;                       /* window size */
         uint_t channels   = 1;                          /* number of channel */
         fvec_t * in       = new_fvec (win_s, channels); /* input buffer */
-        aubio_pickpeak_t * o = new_aubio_peakpicker(0.3);
+        aubio_peakpicker_t * o = new_aubio_peakpicker(0.3);
 
         aubio_peakpicker_do(o, in);
         aubio_peakpicker_do(o, in);