Changeset 8766cb6
- Timestamp:
- Oct 7, 2009, 8:31:43 PM (15 years ago)
- 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
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/utils.c
rcfa0f12 r8766cb6 69 69 fvec_t *onset2; 70 70 smpl_t isonset = 0; 71 aubio_p ickpeak_t *parms;71 aubio_peakpicker_t *parms; 72 72 73 73 -
examples/utils.h
rcfa0f12 r8766cb6 102 102 extern fvec_t *onset2; 103 103 extern smpl_t isonset; 104 extern aubio_p ickpeak_t *parms;104 extern aubio_peakpicker_t *parms; 105 105 106 106 -
src/onset/onset.c
rcfa0f12 r8766cb6 31 31 aubio_pvoc_t * pv; /**< phase vocoder */ 32 32 aubio_onsetdetection_t * od; /**< onset detection */ 33 aubio_p ickpeak_t * pp;/**< peak picker */33 aubio_peakpicker_t * pp; /**< peak picker */ 34 34 cvec_t * fftgrain; /**< phase vocoder output */ 35 35 fvec_t * of; /**< onset detection function */ -
src/onset/peakpick.c
rcfa0f12 r8766cb6 30 30 * time-> ^now 31 31 */ 32 struct _aubio_p ickpeak_t {32 struct _aubio_peakpicker_t { 33 33 /** thresh: offset threshold [0.033 or 0.01] */ 34 34 smpl_t threshold; … … 68 68 * is slightly more permissive than the offline one, and yelds to an increase 69 69 * of false positives. best */ 70 smpl_t aubio_peakpicker_do(aubio_p ickpeak_t * p, fvec_t * onset) {70 smpl_t aubio_peakpicker_do(aubio_peakpicker_t * p, fvec_t * onset) { 71 71 fvec_t * onset_keep = (fvec_t *)p->onset_keep; 72 72 fvec_t * onset_proc = (fvec_t *)p->onset_proc; … … 121 121 * after smoothing 122 122 */ 123 smpl_t aubio_peakpicker_get_thresholded_input(aubio_p ickpeak_t * p)123 smpl_t aubio_peakpicker_get_thresholded_input(aubio_peakpicker_t * p) 124 124 { 125 125 return p->onset_peek->data[0][1]; … … 127 127 128 128 /** function added by Miguel Ramirez to return the onset detection amplitude in peakval */ 129 void aubio_peakpicker_set_threshold(aubio_p ickpeak_t * p, smpl_t threshold) {129 void aubio_peakpicker_set_threshold(aubio_peakpicker_t * p, smpl_t threshold) { 130 130 p->threshold = threshold; 131 131 return; 132 132 } 133 133 134 smpl_t aubio_peakpicker_get_threshold(aubio_p ickpeak_t * p) {134 smpl_t aubio_peakpicker_get_threshold(aubio_peakpicker_t * p) { 135 135 return p->threshold; 136 136 } 137 137 138 void aubio_peakpicker_set_thresholdfn(aubio_p ickpeak_t * p, aubio_thresholdfn_t thresholdfn) {138 void aubio_peakpicker_set_thresholdfn(aubio_peakpicker_t * p, aubio_thresholdfn_t thresholdfn) { 139 139 p->thresholdfn = thresholdfn; 140 140 return; 141 141 } 142 142 143 aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_p ickpeak_t * p) {143 aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_peakpicker_t * p) { 144 144 return (aubio_thresholdfn_t) (p->thresholdfn); 145 145 } 146 146 147 aubio_p ickpeak_t * new_aubio_peakpicker(smpl_t threshold) {148 aubio_p ickpeak_t * t = AUBIO_NEW(aubio_pickpeak_t);147 aubio_peakpicker_t * new_aubio_peakpicker(smpl_t threshold) { 148 aubio_peakpicker_t * t = AUBIO_NEW(aubio_peakpicker_t); 149 149 t->threshold = 0.1; /* 0.0668; 0.33; 0.082; 0.033; */ 150 150 if (threshold > 0. && threshold < 10.) … … 167 167 } 168 168 169 void del_aubio_peakpicker(aubio_p ickpeak_t * p) {169 void del_aubio_peakpicker(aubio_peakpicker_t * p) { 170 170 del_aubio_biquad(p->biquad); 171 171 del_fvec(p->onset_keep); -
src/onset/peakpick.h
rcfa0f12 r8766cb6 36 36 typedef uint_t (*aubio_pickerfn_t)(fvec_t *input, uint_t pos); 37 37 /** peak-picker structure */ 38 typedef struct _aubio_p ickpeak_t aubio_pickpeak_t;38 typedef struct _aubio_peakpicker_t aubio_peakpicker_t; 39 39 40 40 /** peak-picker creation function */ 41 aubio_p ickpeak_t * new_aubio_peakpicker(smpl_t threshold);41 aubio_peakpicker_t * new_aubio_peakpicker(smpl_t threshold); 42 42 /** real time peak picking function */ 43 smpl_t aubio_peakpicker_do(aubio_p ickpeak_t * p, fvec_t * DF);43 smpl_t aubio_peakpicker_do(aubio_peakpicker_t * p, fvec_t * DF); 44 44 /** get current peak value */ 45 smpl_t aubio_peakpicker_get_thresholded_input(aubio_p ickpeak_t * p);45 smpl_t aubio_peakpicker_get_thresholded_input(aubio_peakpicker_t * p); 46 46 /** destroy peak picker structure */ 47 void del_aubio_peakpicker(aubio_p ickpeak_t * p);47 void del_aubio_peakpicker(aubio_peakpicker_t * p); 48 48 49 49 /** set peak picking threshold */ 50 void aubio_peakpicker_set_threshold(aubio_p ickpeak_t * p, smpl_t threshold);50 void aubio_peakpicker_set_threshold(aubio_peakpicker_t * p, smpl_t threshold); 51 51 /** get peak picking threshold */ 52 smpl_t aubio_peakpicker_get_threshold(aubio_p ickpeak_t * p);52 smpl_t aubio_peakpicker_get_threshold(aubio_peakpicker_t * p); 53 53 /** set peak picker thresholding function */ 54 void aubio_peakpicker_set_thresholdfn(aubio_p ickpeak_t * p, aubio_thresholdfn_t thresholdfn);54 void aubio_peakpicker_set_thresholdfn(aubio_peakpicker_t * p, aubio_thresholdfn_t thresholdfn); 55 55 /** get peak picker thresholding function */ 56 aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_p ickpeak_t * p);56 aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_peakpicker_t * p); 57 57 58 58 #ifdef __cplusplus -
src/tempo/tempo.c
rcfa0f12 r8766cb6 32 32 aubio_onsetdetection_t * od; /** onset detection */ 33 33 aubio_pvoc_t * pv; /** phase vocoder */ 34 aubio_p ickpeak_t * pp;/** peak picker */34 aubio_peakpicker_t * pp; /** peak picker */ 35 35 aubio_beattracking_t * bt; /** beat tracking */ 36 36 cvec_t * fftgrain; /** spectral frame */ -
swig/aubio.i
rcfa0f12 r8766cb6 163 163 /* filterbank */ 164 164 aubio_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);165 void aubio_filterbank_set_triangle_bands (aubio_filterbank_t *fb, uint_t samplerate, fvec_t *freqs); 166 166 void aubio_filterbank_set_mel_coeffs_slaney(aubio_filterbank_t *fb, uint_t samplerate); 167 167 void del_aubio_filterbank(aubio_filterbank_t * fb); … … 270 270 271 271 /* peakpicker */ 272 aubio_p ickpeak_t * new_aubio_peakpicker(smpl_t threshold);273 smpl_t aubio_peakpicker_do(aubio_p ickpeak_t * p, fvec_t * df);274 smpl_t aubio_peakpicker_get_thresholded_input(aubio_p ickpeak_t* p);275 void del_aubio_peakpicker(aubio_p ickpeak_t * p);276 void aubio_peakpicker_set_threshold(aubio_p ickpeak_t * p, smpl_t threshold);277 smpl_t aubio_peakpicker_get_threshold(aubio_p ickpeak_t * p);272 aubio_peakpicker_t * new_aubio_peakpicker(smpl_t threshold); 273 smpl_t aubio_peakpicker_do(aubio_peakpicker_t * p, fvec_t * df); 274 smpl_t aubio_peakpicker_get_thresholded_input(aubio_peakpicker_t* p); 275 void del_aubio_peakpicker(aubio_peakpicker_t * p); 276 void aubio_peakpicker_set_threshold(aubio_peakpicker_t * p, smpl_t threshold); 277 smpl_t aubio_peakpicker_get_threshold(aubio_peakpicker_t * p); 278 278 279 279 /* transient/steady state separation */ -
tests/src/test-peakpick.c
rcfa0f12 r8766cb6 6 6 uint_t channels = 1; /* number of channel */ 7 7 fvec_t * in = new_fvec (win_s, channels); /* input buffer */ 8 aubio_p ickpeak_t * o = new_aubio_peakpicker(0.3);8 aubio_peakpicker_t * o = new_aubio_peakpicker(0.3); 9 9 10 10 aubio_peakpicker_do(o, in);
Note: See TracChangeset
for help on using the changeset viewer.