Changes in src/onset/peakpicker.c [e149aa9:67b6618]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/onset/peakpicker.c
re149aa9 r67b6618 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; 95 96 uint_t j = 0; 96 97 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); 101 102 /* filter this copy */ 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]; 106 107 /* filter onset_proc */ 108 /** \bug filtfilt calculated post+pre times, should be only once !? */ 103 109 aubio_filter_do_filtfilt (p->biquad, onset_proc, scratch); 104 110 105 111 /* calculate mean and median for onset_proc */ 106 112 mean = fvec_mean (onset_proc); 107 108 /* copy to scratch and compute its median */109 fvec_copy(onset_proc, scratch);113 /* copy to scratch */ 114 for (j = 0; j < length; j++) 115 scratch->data[j] = onset_proc->data[j]; 110 116 median = p->thresholdfn (scratch); 111 117
Note: See TracChangeset
for help on using the changeset viewer.