From: Paul Brossier Date: Wed, 7 Oct 2009 18:31:43 +0000 (+0200) Subject: src/onset/peakpick.c: rename aubio_pickpeak_t to aubio_peakpicker_t X-Git-Tag: bzr2git~194 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8766cb6ec331b4b5b572f825727a0c9fd9f76233;p=aubio.git src/onset/peakpick.c: rename aubio_pickpeak_t to aubio_peakpicker_t --- diff --git a/examples/utils.c b/examples/utils.c index fe86ef8c..a50aef27 100644 --- a/examples/utils.c +++ b/examples/utils.c @@ -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 */ diff --git a/examples/utils.h b/examples/utils.h index b3acf328..b01defcb 100644 --- a/examples/utils.h +++ b/examples/utils.h @@ -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 */ diff --git a/src/onset/onset.c b/src/onset/onset.c index ae739656..c5cff855 100644 --- 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 */ diff --git a/src/onset/peakpick.c b/src/onset/peakpick.c index ee2bfe58..b93918df 100644 --- 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 @@ 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); diff --git a/src/onset/peakpick.h b/src/onset/peakpick.h index 73ad7282..4d193f45 100644 --- a/src/onset/peakpick.h +++ b/src/onset/peakpick.h @@ -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 } diff --git a/src/tempo/tempo.c b/src/tempo/tempo.c index a16a68da..16346a23 100644 --- 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 */ diff --git a/swig/aubio.i b/swig/aubio.i index 939d835f..892660ef 100644 --- a/swig/aubio.i +++ b/swig/aubio.i @@ -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, diff --git a/tests/src/test-peakpick.c b/tests/src/test-peakpick.c index dcfb5135..81c8e7fc 100644 --- a/tests/src/test-peakpick.c +++ b/tests/src/test-peakpick.c @@ -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);