Changeset 8766cb6 for src/onset/peakpick.c
- Timestamp:
- Oct 7, 2009, 8:31:43 PM (14 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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);
Note: See TracChangeset
for help on using the changeset viewer.