Changeset 56ef7e1 for src/pitch


Ignore:
Timestamp:
Oct 18, 2009, 3:08:59 PM (15 years ago)
Author:
Paul Brossier <piem@piem.org>
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:
e5f49af
Parents:
74516f7
Message:

Change peakpicker to match API specs, make quadint per channel

  • src/mathutils.c
    • add per channel mean and median
    • update moving thres and adapt_thres accordingly
    • change quadint unused span argument to a channel argument
  • src/onset/onset.c:
    • make wasonset a vector for multi channel, use new peakpicker
  • src/onset/peakpick.c:
    • update peakpicker do for multi channeling
  • src/pitch/: update use to fvec_quadint
  • src/tempo/beattracking.c: update calls to fvec_quadint
  • src/tempo/tempo.c: update peakpicker usage
  • tests/src/test-peakpick.c: update peakpicker usage
Location:
src/pitch
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/pitch/pitchmcomb.c

    r74516f7 r56ef7e1  
    167167  /* skipped */                       /* low pass filtering   */
    168168  /** \bug fvec_moving_thres may write out of bounds */
    169   fvec_adapt_thres(mag,tmp,p->win_post,p->win_pre); /* adaptative threshold */
     169  fvec_adapt_thres(mag,tmp,p->win_post,p->win_pre,i); /* adaptative threshold */
    170170  fvec_add(mag,-p->threshold);        /* fixed threshold      */
    171171  {
     
    277277        count += ispeak;
    278278        spectral_peaks[count-1].bin = j;
    279         spectral_peaks[count-1].ebin = fvec_quadint(X, j, 1) - 1.;
     279        spectral_peaks[count-1].ebin = fvec_quadint(X, j, i) - 1.;
    280280      }
    281281    }
  • src/pitch/pitchyin.c

    r74516f7 r56ef7e1  
    149149      if(tau > 4 && (yin->data[c][period] < tol) &&
    150150          (yin->data[c][period] < yin->data[c][period+1])) {
    151         out->data[c][0] = fvec_quadint(yin,period,1);
     151        out->data[c][0] = fvec_quadint(yin,period,c);
    152152        goto beach;
    153153      }
    154154    }
    155     out->data[c][0] = fvec_quadint(yin,fvec_min_elem(yin),1);
     155    out->data[c][0] = fvec_quadint(yin,fvec_min_elem(yin),c);
    156156beach:
    157157    continue;
  • src/pitch/pitchyinfft.c

    r74516f7 r56ef7e1  
    132132    /* additional check for (unlikely) octave doubling in higher frequencies */
    133133    if (tau>35) {
    134       output->data[i][0] = fvec_quadint(yin,tau,1);
     134      output->data[i][0] = fvec_quadint(yin,tau,i);
    135135    } else {
    136136      /* should compare the minimum value of each interpolated peaks */
    137137      halfperiod = FLOOR(tau/2+.5);
    138138      if (yin->data[0][halfperiod] < p->tol)
    139         output->data[i][0] = fvec_quadint(yin,halfperiod,1);
     139        output->data[i][0] = fvec_quadint(yin,halfperiod,i);
    140140      else
    141         output->data[i][0] = fvec_quadint(yin,tau,1);
     141        output->data[i][0] = fvec_quadint(yin,tau,i);
    142142    }
    143143  } else {
Note: See TracChangeset for help on using the changeset viewer.