- Timestamp:
- Oct 2, 2009, 1:19:10 AM (15 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:
- 38e9732
- Parents:
- 2f64b0e
- Location:
- src/pitch
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/pitch/pitchmcomb.c
r2f64b0e r5c4ec3c 99 99 newmag->data[i][j]=fftgrain->norm[i][j]; 100 100 /* detect only if local energy > 10. */ 101 //if ( vec_local_energy(newmag)>10.) {102 //hfc = vec_local_hfc(newmag); //not used101 //if (fvec_local_energy(newmag)>10.) { 102 //hfc = fvec_local_hfc(newmag); //not used 103 103 aubio_pitchmcomb_spectral_pp(p, newmag); 104 104 aubio_pitchmcomb_combdet(p,newmag); … … 132 132 newmag->data[i][j]=fftgrain->norm[i][j]; 133 133 /* detect only if local energy > 10. */ 134 if ( vec_local_energy(newmag)>10.) {135 /* hfc = vec_local_hfc(newmag); do not use */134 if (fvec_local_energy(newmag)>10.) { 135 /* hfc = fvec_local_hfc(newmag); do not use */ 136 136 aubio_pitchmcomb_spectral_pp(p, newmag); 137 137 aubio_pitchmcomb_combdet(p,newmag); … … 159 159 mag->data[i][j] = newmag->data[i][j]; 160 160 } 161 vec_dc_removal(mag); /* dc removal */162 vec_alpha_normalise(mag,p->alpha); /* alpha normalisation */161 fvec_dc_removal(mag); /* dc removal */ 162 fvec_alpha_normalise(mag,p->alpha); /* alpha normalisation */ 163 163 /* skipped */ /* low pass filtering */ 164 /** \bug vec_moving_thres may write out of bounds */165 vec_adapt_thres(mag,tmp,p->win_post,p->win_pre); /* adaptative threshold */166 vec_add(mag,-p->threshold); /* fixed threshold */164 /** \bug fvec_moving_thres may write out of bounds */ 165 fvec_adapt_thres(mag,tmp,p->win_post,p->win_pre); /* adaptative threshold */ 166 fvec_add(mag,-p->threshold); /* fixed threshold */ 167 167 { 168 168 aubio_spectralpeak_t * peaks = (aubio_spectralpeak_t *)p->peaks; … … 269 269 for (i=0;i<X->channels;i++) 270 270 for (j=1;j<X->length-1;j++) { 271 ispeak = vec_peakpick(X,j);271 ispeak = fvec_peakpick(X,j); 272 272 if (ispeak) { 273 273 count += ispeak; 274 274 spectral_peaks[count-1].bin = j; 275 spectral_peaks[count-1].ebin = vec_quadint(X, j, 1) - 1.;275 spectral_peaks[count-1].ebin = fvec_quadint(X, j, 1) - 1.; 276 276 } 277 277 } -
src/pitch/pitchyin.c
r2f64b0e r5c4ec3c 107 107 if(tau > 4 && (yin->data[c][period] < tol) && 108 108 (yin->data[c][period] < yin->data[c][period+1])) { 109 return vec_quadint(yin,period,1);109 return fvec_quadint(yin,period,1); 110 110 } 111 111 } 112 return vec_quadint(yin,fvec_min_elem(yin),1);112 return fvec_quadint(yin,fvec_min_elem(yin),1); 113 113 //return 0; 114 114 } -
src/pitch/pitchyinfft.c
r2f64b0e r5c4ec3c 125 125 //return tau; 126 126 /* 3 point quadratic interpolation */ 127 //return vec_quadint_min(yin,tau,1);127 //return fvec_quadint_min(yin,tau,1); 128 128 /* additional check for (unlikely) octave doubling in higher frequencies */ 129 129 if (tau>35) { 130 return vec_quadint(yin,tau,1);130 return fvec_quadint(yin,tau,1); 131 131 } else { 132 132 /* should compare the minimum value of each interpolated peaks */ 133 133 halfperiod = FLOOR(tau/2+.5); 134 134 if (yin->data[0][halfperiod] < tol) 135 return vec_quadint(yin,halfperiod,1);135 return fvec_quadint(yin,halfperiod,1); 136 136 else 137 return vec_quadint(yin,tau,1);137 return fvec_quadint(yin,tau,1); 138 138 } 139 139 } else
Note: See TracChangeset
for help on using the changeset viewer.