Changeset 1aeac4c
- Timestamp:
- Aug 22, 2005, 9:30:10 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:
- f97445c
- Parents:
- 162fd27
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/pitchyin.c
r162fd27 r1aeac4c 91 91 uint_t aubio_pitchyin_getpitchfast(fvec_t * input, fvec_t * yin, smpl_t tol){ 92 92 uint_t c=0,j,tau = 0; 93 smpl_t tmp = 0; 94 for (tau=0;tau<yin->length;tau++) 93 smpl_t tmp = 0., tmp2 = 0.; 94 yin->data[c][0] = 1.; 95 for (tau=1;tau<yin->length;tau++) 95 96 { 96 97 yin->data[c][tau] = 0.; 97 }98 for (tau=1;tau<yin->length;tau++)99 {100 98 for (j=0;j<yin->length;j++) 101 99 { … … 103 101 yin->data[c][tau] += SQR(tmp); 104 102 } 105 } 106 yin->data[c][0] = 1.; 107 tmp = 0.; 108 for (tau=1;tau<yin->length;tau++) 109 { 110 tmp += yin->data[c][tau]; 111 yin->data[c][tau] *= tau/tmp; 112 } 113 /* should merge the following with above */ 114 tau = 1; 115 do 116 { 117 if(yin->data[c][tau] < tol) { 118 while (yin->data[c][tau+1] < yin->data[c][tau]) { 119 tau++; 120 } 121 return tau; 103 tmp2 += yin->data[c][tau]; 104 yin->data[c][tau] *= tau/tmp2; 105 if((yin->data[c][tau] < tol) && 106 (yin->data[c][tau-1] < yin->data[c][tau])) { 107 return tau-1; 122 108 } 123 tau++; 124 } while (tau<yin->length); 109 } 125 110 return 0; 126 111 }
Note: See TracChangeset
for help on using the changeset viewer.