- Timestamp:
- Mar 10, 2017, 5:18:25 PM (8 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, sampler
- Children:
- 2410d3d2
- Parents:
- ee8a57c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/onset/peakpicker.c
ree8a57c re149aa9 93 93 fvec_t *scratch = p->scratch; 94 94 smpl_t mean = 0., median = 0.; 95 uint_t length = p->win_post + p->win_pre + 1;96 95 uint_t j = 0; 97 96 98 /* store onset in onset_keep */ 99 /* shift all elements but last, then write last */ 100 for (j = 0; j < length - 1; j++) { 101 onset_keep->data[j] = onset_keep->data[j + 1]; 102 onset_proc->data[j] = onset_keep->data[j]; 103 } 104 onset_keep->data[length - 1] = onset->data[0]; 105 onset_proc->data[length - 1] = onset->data[0]; 97 /* push new novelty to the end */ 98 fvec_push(onset_keep, onset->data[0]); 99 /* store a copy */ 100 fvec_copy(onset_keep, onset_proc); 106 101 107 /* filter onset_proc */ 108 /** \bug filtfilt calculated post+pre times, should be only once !? */ 102 /* filter this copy */ 109 103 aubio_filter_do_filtfilt (p->biquad, onset_proc, scratch); 110 104 111 105 /* calculate mean and median for onset_proc */ 112 106 mean = fvec_mean (onset_proc); 113 /* copy to scratch */ 114 for (j = 0; j < length; j++)115 scratch->data[j] = onset_proc->data[j];107 108 /* copy to scratch and compute its median */ 109 fvec_copy(onset_proc, scratch); 116 110 median = p->thresholdfn (scratch); 117 111
Note: See TracChangeset
for help on using the changeset viewer.