ref: 8766cb6ec331b4b5b572f825727a0c9fd9f76233
parent: cfa0f12a613d3425efeeddc68e5dbf1bb1181f0c
author: Paul Brossier <piem@piem.org>
date: Wed Oct 7 16:31:43 EDT 2009
src/onset/peakpick.c: rename aubio_pickpeak_t to aubio_peakpicker_t
--- a/examples/utils.c
+++ b/examples/utils.c
@@ -68,7 +68,7 @@
fvec_t *onset;
fvec_t *onset2;
smpl_t isonset = 0;
-aubio_pickpeak_t *parms;
+aubio_peakpicker_t *parms;
/* pitch objects */
--- a/examples/utils.h
+++ b/examples/utils.h
@@ -101,7 +101,7 @@
extern fvec_t *onset;
extern fvec_t *onset2;
extern smpl_t isonset;
-extern aubio_pickpeak_t *parms;
+extern aubio_peakpicker_t *parms;
/* pitch objects */
--- a/src/onset/onset.c
+++ b/src/onset/onset.c
@@ -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 */
--- a/src/onset/peakpick.c
+++ b/src/onset/peakpick.c
@@ -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 @@
/** 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 @@
/** 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 @@
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);
--- a/src/onset/peakpick.h
+++ b/src/onset/peakpick.h
@@ -35,25 +35,25 @@
/** 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
}
--- a/src/tempo/tempo.c
+++ b/src/tempo/tempo.c
@@ -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 */
--- a/swig/aubio.i
+++ b/swig/aubio.i
@@ -162,7 +162,7 @@
/* 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 @@
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,
--- a/tests/src/test-peakpick.c
+++ b/tests/src/test-peakpick.c
@@ -5,7 +5,7 @@
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);