Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/pitch/pitchmcomb.c

    r5b41ef9 rce3ff2b  
    3232    uint_t length);
    3333uint_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);
     35void aubio_pitchmcomb_spectral_pp (aubio_pitchmcomb_t * p, const fvec_t * oldmag);
     36void aubio_pitchmcomb_combdet (aubio_pitchmcomb_t * p, const fvec_t * newmag);
    3737/* not used but useful : sort by amplitudes (or anything else)
    3838 * sort_pitchpeak(peaks, length);
     
    4343void aubio_pitchmcomb_sort_peak (aubio_spectralpeak_t * peaks, uint_t nbins);
    4444/** select the best candidates */
    45 uint_t aubio_pitch_cands (aubio_pitchmcomb_t * p, cvec_t * fftgrain,
     45uint_t aubio_pitch_cands (aubio_pitchmcomb_t * p, const cvec_t * fftgrain,
    4646    smpl_t * cands);
    4747
     
    102102
    103103void
    104 aubio_pitchmcomb_do (aubio_pitchmcomb_t * p, cvec_t * fftgrain, fvec_t * output)
     104aubio_pitchmcomb_do (aubio_pitchmcomb_t * p, const cvec_t * fftgrain, fvec_t * output)
    105105{
    106106  uint_t j;
     
    135135
    136136uint_t
    137 aubio_pitch_cands (aubio_pitchmcomb_t * p, cvec_t * fftgrain, smpl_t * cands)
     137aubio_pitch_cands (aubio_pitchmcomb_t * p, const cvec_t * fftgrain, smpl_t * cands)
    138138{
    139139  uint_t j;
     
    166166
    167167void
    168 aubio_pitchmcomb_spectral_pp (aubio_pitchmcomb_t * p, fvec_t * newmag)
     168aubio_pitchmcomb_spectral_pp (aubio_pitchmcomb_t * p, const fvec_t * newmag)
    169169{
    170170  fvec_t *mag = (fvec_t *) p->scratch;
     
    198198
    199199void
    200 aubio_pitchmcomb_combdet (aubio_pitchmcomb_t * p, fvec_t * newmag)
     200aubio_pitchmcomb_combdet (aubio_pitchmcomb_t * p, const fvec_t * newmag)
    201201{
    202202  aubio_spectralpeak_t *peaks = (aubio_spectralpeak_t *) p->peaks;
     
    286286 */
    287287uint_t
    288 aubio_pitchmcomb_quadpick (aubio_spectralpeak_t * spectral_peaks, fvec_t * X)
     288aubio_pitchmcomb_quadpick (aubio_spectralpeak_t * spectral_peaks, const fvec_t * X)
    289289{
    290290  uint_t j, ispeak, count = 0;
     
    336336  uint_t run = 0;
    337337  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++) {
    340339      if (candidates[run]->ene > candidates[cur]->ene)
    341340        CAND_SWAP (candidates[run], candidates[cur]);
     
    352351  uint_t run = 0;
    353352  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++) {
    356354      if (candidates[run]->ebin < candidates[cur]->ebin)
    357355        CAND_SWAP (candidates[run], candidates[cur]);
     
    367365  uint_t i, j;
    368366  uint_t spec_size;
    369   p->spec_partition = 4;
     367  p->spec_partition = 2;
    370368  p->ncand = 5;
    371369  p->npartials = 5;
     
    379377  p->phasefreq = bufsize / hopsize / TWO_PI;
    380378  p->phasediff = TWO_PI * hopsize / bufsize;
    381   spec_size = bufsize / p->spec_partition;
     379  spec_size = bufsize / p->spec_partition + 1;
    382380  //p->pickerfn = quadpick;
    383381  //p->biquad = new_biquad(0.1600,0.3200,0.1600, -0.5949, 0.2348);
Note: See TracChangeset for help on using the changeset viewer.