Changes in src/pitch/pitchmcomb.c [5b41ef9:ce3ff2b]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/pitch/pitchmcomb.c
r5b41ef9 rce3ff2b 32 32 uint_t length); 33 33 uint_t aubio_pitchmcomb_quadpick (aubio_spectralpeak_t * spectral_peaks, 34 fvec_t * X);35 void aubio_pitchmcomb_spectral_pp (aubio_pitchmcomb_t * p, fvec_t * oldmag);36 void aubio_pitchmcomb_combdet (aubio_pitchmcomb_t * p, fvec_t * newmag);34 const fvec_t * X); 35 void aubio_pitchmcomb_spectral_pp (aubio_pitchmcomb_t * p, const fvec_t * oldmag); 36 void aubio_pitchmcomb_combdet (aubio_pitchmcomb_t * p, const fvec_t * newmag); 37 37 /* not used but useful : sort by amplitudes (or anything else) 38 38 * sort_pitchpeak(peaks, length); … … 43 43 void aubio_pitchmcomb_sort_peak (aubio_spectralpeak_t * peaks, uint_t nbins); 44 44 /** select the best candidates */ 45 uint_t aubio_pitch_cands (aubio_pitchmcomb_t * p, c vec_t * fftgrain,45 uint_t aubio_pitch_cands (aubio_pitchmcomb_t * p, const cvec_t * fftgrain, 46 46 smpl_t * cands); 47 47 … … 102 102 103 103 void 104 aubio_pitchmcomb_do (aubio_pitchmcomb_t * p, c vec_t * fftgrain, fvec_t * output)104 aubio_pitchmcomb_do (aubio_pitchmcomb_t * p, const cvec_t * fftgrain, fvec_t * output) 105 105 { 106 106 uint_t j; … … 135 135 136 136 uint_t 137 aubio_pitch_cands (aubio_pitchmcomb_t * p, c vec_t * fftgrain, smpl_t * cands)137 aubio_pitch_cands (aubio_pitchmcomb_t * p, const cvec_t * fftgrain, smpl_t * cands) 138 138 { 139 139 uint_t j; … … 166 166 167 167 void 168 aubio_pitchmcomb_spectral_pp (aubio_pitchmcomb_t * p, fvec_t * newmag)168 aubio_pitchmcomb_spectral_pp (aubio_pitchmcomb_t * p, const fvec_t * newmag) 169 169 { 170 170 fvec_t *mag = (fvec_t *) p->scratch; … … 198 198 199 199 void 200 aubio_pitchmcomb_combdet (aubio_pitchmcomb_t * p, fvec_t * newmag)200 aubio_pitchmcomb_combdet (aubio_pitchmcomb_t * p, const fvec_t * newmag) 201 201 { 202 202 aubio_spectralpeak_t *peaks = (aubio_spectralpeak_t *) p->peaks; … … 286 286 */ 287 287 uint_t 288 aubio_pitchmcomb_quadpick (aubio_spectralpeak_t * spectral_peaks, fvec_t * X)288 aubio_pitchmcomb_quadpick (aubio_spectralpeak_t * spectral_peaks, const fvec_t * X) 289 289 { 290 290 uint_t j, ispeak, count = 0; … … 336 336 uint_t run = 0; 337 337 for (cur = 0; cur < nbins; cur++) { 338 run = cur + 1; 339 for (run = cur; run < nbins; run++) { 338 for (run = cur + 1; run < nbins; run++) { 340 339 if (candidates[run]->ene > candidates[cur]->ene) 341 340 CAND_SWAP (candidates[run], candidates[cur]); … … 352 351 uint_t run = 0; 353 352 for (cur = 0; cur < nbins; cur++) { 354 run = cur + 1; 355 for (run = cur; run < nbins; run++) { 353 for (run = cur + 1; run < nbins; run++) { 356 354 if (candidates[run]->ebin < candidates[cur]->ebin) 357 355 CAND_SWAP (candidates[run], candidates[cur]); … … 367 365 uint_t i, j; 368 366 uint_t spec_size; 369 p->spec_partition = 4;367 p->spec_partition = 2; 370 368 p->ncand = 5; 371 369 p->npartials = 5; … … 379 377 p->phasefreq = bufsize / hopsize / TWO_PI; 380 378 p->phasediff = TWO_PI * hopsize / bufsize; 381 spec_size = bufsize / p->spec_partition ;379 spec_size = bufsize / p->spec_partition + 1; 382 380 //p->pickerfn = quadpick; 383 381 //p->biquad = new_biquad(0.1600,0.3200,0.1600, -0.5949, 0.2348);
Note: See TracChangeset
for help on using the changeset viewer.