Changeset 6efdc83
- Timestamp:
- Sep 27, 2005, 9:10:49 PM (19 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:
- 26d9f8f
- Parents:
- bfe76d4
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/peakpick.c
rbfe76d4 r6efdc83 38 38 uint_t win_pre; 39 39 /** threshfn: name or handle of fn for computing adaptive threshold [@median] */ 40 //aubio_thresholdfn_t thresholdfn;40 aubio_thresholdfn_t thresholdfn; 41 41 /** picker: name or handle of fn for picking event times [@peakpick] */ 42 42 aubio_pickerfn_t pickerfn; … … 48 48 /** modified onsets */ 49 49 fvec_t * onset_proc; 50 /* peak picked window [3] */50 /** peak picked window [3] */ 51 51 fvec_t * onset_peek; 52 52 /** scratch pad for biquad and median */ … … 98 98 for (j = 0; j < length; j++) 99 99 scratch->data[i][j] = onset_proc->data[i][j]; 100 median = vec_median(scratch);100 median = p->thresholdfn(scratch); 101 101 /* } */ 102 102 … … 165 165 } 166 166 167 167 void aubio_peakpicker_set_threshold(aubio_pickpeak_t * p, smpl_t threshold) { 168 p->threshold = threshold; 169 return; 170 } 171 172 smpl_t aubio_peakpicker_get_threshold(aubio_pickpeak_t * p) { 173 return p->threshold; 174 } 175 176 void aubio_peakpicker_set_thresholdfn(aubio_pickpeak_t * p, aubio_thresholdfn_t thresholdfn) { 177 p->thresholdfn = thresholdfn; 178 return; 179 } 180 181 aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_pickpeak_t * p) { 182 return (aubio_thresholdfn_t) (p->thresholdfn); 183 } 168 184 169 185 aubio_pickpeak_t * new_aubio_peakpicker(smpl_t threshold) { … … 175 191 t->win_pre = 1; 176 192 177 //t->thresholdfn = (aubio_thresholdfn_t)(vec_median); /* (vec_mean); */193 t->thresholdfn = (aubio_thresholdfn_t)(vec_median); /* (vec_mean); */ 178 194 t->pickerfn = (aubio_pickerfn_t)(vec_peakpick); 179 195 -
src/peakpick.h
rbfe76d4 r6efdc83 41 41 void del_aubio_peakpicker(aubio_pickpeak_t * p); 42 42 43 void aubio_peakpicker_set_threshold(aubio_pickpeak_t * p, smpl_t threshold); 44 smpl_t aubio_peakpicker_get_threshold(aubio_pickpeak_t * p); 45 void aubio_peakpicker_set_thresholdfn(aubio_pickpeak_t * p, aubio_thresholdfn_t thresholdfn); 46 aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_pickpeak_t * p); 47 43 48 #ifdef __cplusplus 44 49 }
Note: See TracChangeset
for help on using the changeset viewer.