- Timestamp:
- Nov 24, 2007, 5:44:49 PM (17 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:
- d7a104c
- Parents:
- 4bb32f4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/pitchmcomb.c
r4bb32f4 r9638f84 192 192 uint_t l; 193 193 uint_t d; 194 uint_t curlen ;194 uint_t curlen = 0; 195 195 196 196 smpl_t delta2; … … 214 214 candidate[l]->ebin=scaler*peaks[root_peak].ebin; 215 215 /* if less than N peaks available, curlen < N */ 216 curlen = (uint_t)FLOOR(length/(candidate[l]->ebin)); 216 if (candidate[l]->ebin != 0.) 217 curlen = (uint_t)FLOOR(length/(candidate[l]->ebin)); 217 218 curlen = (N < curlen )? N : curlen; 218 219 /* fill candidate[l]->ecomb[k] with (k+1)*candidate[l]->ebin */ … … 326 327 aubio_pitchmcomb_t * p = AUBIO_NEW(aubio_pitchmcomb_t); 327 328 /* bug: should check if size / 8 > post+pre+1 */ 328 uint_t i ;329 uint_t i, j; 329 330 uint_t spec_size; 330 331 p->spec_partition = 4; … … 353 354 /* array of spectral peaks */ 354 355 p->peaks = AUBIO_ARRAY(aubio_spectralpeak_t,spec_size); 356 for (i = 0; i < spec_size; i++) { 357 p->peaks[i].bin = 0.; 358 p->peaks[i].ebin = 0.; 359 p->peaks[i].mag = 0.; 360 } 355 361 /* array of pointers to spectral candidates */ 356 362 p->candidates = AUBIO_ARRAY(aubio_spectralcandidate_t *,p->ncand); … … 358 364 p->candidates[i] = AUBIO_NEW(aubio_spectralcandidate_t); 359 365 p->candidates[i]->ecomb = AUBIO_ARRAY(smpl_t, spec_size); 366 for (j=0; j < spec_size; j++) { 367 p->candidates[i]->ecomb[j] = 0.; 368 } 369 p->candidates[i]->ene = 0.; 370 p->candidates[i]->ebin = 0.; 371 p->candidates[i]->len = 0.; 360 372 } 361 373 return p; … … 371 383 AUBIO_FREE(p->peaks); 372 384 for (i=0;i<p->ncand;i++) { 385 AUBIO_FREE(p->candidates[i]->ecomb); 373 386 AUBIO_FREE(p->candidates[i]); 374 387 }
Note: See TracChangeset
for help on using the changeset viewer.