Changeset 28d8c4a
- Timestamp:
- Aug 9, 2005, 12:09:36 PM (20 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:
- 5e9c68a
- Parents:
- ea865c9
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/tests/test-fft.c
rea865c9 r28d8c4a 20 20 spec[i] = AUBIO_ARRAY(fft_data_t,win_s); 21 21 /* initialize the window (see mathutils.c) */ 22 window(w,win_s,aubio_win_hanningz);22 aubio_window(w,win_s,aubio_win_hanningz); 23 23 24 24 /* fill input with some data */ … … 35 35 for (i=0; i < channels; i++) { 36 36 for (j=0; j<win_s/2+1; j++) { 37 spec[i][j] = CEXPC(I* unwrap2pi(fftgrain->phas[i][j]));37 spec[i][j] = CEXPC(I*aubio_unwrap2pi(fftgrain->phas[i][j])); 38 38 spec[i][j] *= fftgrain->norm[i][j]; 39 39 } -
examples/utils.c
rea865c9 r28d8c4a 330 330 void send_noteon(int pitch, int velo) 331 331 { 332 smpl_t mpitch = (FLOOR)( freqtomidi(pitch)+.5);332 smpl_t mpitch = (FLOOR)(aubio_freqtomidi(pitch)+.5); 333 333 /* we should check if we use midi here, not jack */ 334 334 #if ALSA_SUPPORT -
src/fft.c
rea865c9 r28d8c4a 150 150 for (i=0; i < fft->channels; i++) { 151 151 for (j=0; j<fft->winsize/2+1; j++) { 152 fft->spec[i][j] = CEXPC(I* unwrap2pi(fftgrain->phas[i][j]));152 fft->spec[i][j] = CEXPC(I*aubio_unwrap2pi(fftgrain->phas[i][j])); 153 153 fft->spec[i][j] *= fftgrain->norm[i][j]; 154 154 } -
src/mathutils.c
rea865c9 r28d8c4a 24 24 #include "mathutils.h" 25 25 26 void window(smpl_t *w, uint_t size, aubio_window_type_twintype) {26 void aubio_window(smpl_t *w, uint_t size, aubio_window_type wintype) { 27 27 uint_t i; 28 28 switch(wintype) { … … 74 74 75 75 76 smpl_t unwrap2pi(smpl_t phase) {76 smpl_t aubio_unwrap2pi(smpl_t phase) { 77 77 /* mod(phase+pi,-2pi)+pi */ 78 78 return phase + TWO_PI * (1. + floorf(-(phase+PI)/TWO_PI)); … … 319 319 /* increase frac */ 320 320 for (frac = 0.; frac < 2.; frac = frac + step) { 321 res = quadfrac(s0, s1, s2, frac);321 res = aubio_quadfrac(s0, s1, s2, frac); 322 322 if (res > resold) 323 323 resold = res; … … 331 331 } 332 332 333 smpl_t quadfrac(smpl_t s0, smpl_t s1, smpl_t s2, smpl_t pf) {333 smpl_t aubio_quadfrac(smpl_t s0, smpl_t s1, smpl_t s2, smpl_t pf) { 334 334 smpl_t tmp = s0 + (pf/2.) * (pf * ( s0 - 2.*s1 + s2 ) - 3.*s0 + 4.*s1 - s2); 335 335 return tmp; … … 345 345 } 346 346 347 smpl_t freqtomidi(smpl_t freq) {347 smpl_t aubio_freqtomidi(smpl_t freq) { 348 348 smpl_t midi = freq/6.875; 349 349 /* log(freq/A-2)/log(2) */ … … 354 354 } 355 355 356 smpl_t bintofreq(smpl_t bin, smpl_t samplerate, smpl_t fftsize) {356 smpl_t aubio_bintofreq(smpl_t bin, smpl_t samplerate, smpl_t fftsize) { 357 357 smpl_t freq = samplerate/fftsize; 358 358 return freq*bin; … … 360 360 361 361 362 smpl_t bintomidi(smpl_t bin, smpl_t samplerate, smpl_t fftsize) {363 smpl_t midi = bintofreq(bin,samplerate,fftsize);364 return freqtomidi(midi);362 smpl_t aubio_bintomidi(smpl_t bin, smpl_t samplerate, smpl_t fftsize) { 363 smpl_t midi = aubio_bintofreq(bin,samplerate,fftsize); 364 return aubio_freqtomidi(midi); 365 365 } 366 366 -
src/mathutils.h
rea865c9 r28d8c4a 104 104 aubio_win_welch, 105 105 aubio_win_parzen 106 } aubio_window_type _t;106 } aubio_window_type; 107 107 108 108 /** create window */ 109 void window(smpl_t *w, uint_t size, aubio_window_type_twintype);109 void aubio_window(smpl_t *w, uint_t size, aubio_window_type wintype); 110 110 111 111 /** principal argument … … 113 113 * mod(phase+PI,-TWO_PI)+PI 114 114 */ 115 smpl_t unwrap2pi (smpl_t phase);115 smpl_t aubio_unwrap2pi (smpl_t phase); 116 116 117 117 /** calculates the mean of a vector … … 225 225 * \param pf is the floating point index [0;2] 226 226 */ 227 smpl_t quadfrac(smpl_t s0, smpl_t s1, smpl_t s2, smpl_t pf);227 smpl_t aubio_quadfrac(smpl_t s0, smpl_t s1, smpl_t s2, smpl_t pf); 228 228 229 229 /** returns 1 if X1 is a peak and positive */ 230 230 uint_t vec_peakpick(fvec_t * input, uint_t pos); 231 231 232 smpl_t bintomidi(smpl_t bin, smpl_t samplerate, smpl_t fftsize);233 smpl_t bintofreq(smpl_t bin, smpl_t samplerate, smpl_t fftsize);234 smpl_t freqtomidi(smpl_t freq);232 smpl_t aubio_bintomidi(smpl_t bin, smpl_t samplerate, smpl_t fftsize); 233 smpl_t aubio_bintofreq(smpl_t bin, smpl_t samplerate, smpl_t fftsize); 234 smpl_t aubio_freqtomidi(smpl_t freq); 235 235 236 236 uint_t aubio_silence_detection(fvec_t * ibuf, smpl_t threshold); -
src/onsetdetection.c
rea865c9 r28d8c4a 74 74 onset->data[i][0] = 0.; 75 75 for (j=0;j<nbins; j++) { 76 o->dev1->data[i][j] = unwrap2pi(76 o->dev1->data[i][j] = aubio_unwrap2pi( 77 77 fftgrain->phas[i][j] 78 78 -2.0*o->theta1->data[i][j]+ … … 104 104 for ( j=0;j<nbins; j++ ) { 105 105 o->dev1->data[i][j] = 106 unwrap2pi(106 aubio_unwrap2pi( 107 107 fftgrain->phas[i][j] 108 108 -2.0*o->theta1->data[i][j] -
src/phasevoc.c
rea865c9 r28d8c4a 114 114 pv->synthold = new_fvec (win_s-hop_s, channels); 115 115 pv->w = AUBIO_ARRAY(smpl_t,win_s); 116 window(pv->w,win_s,aubio_win_hanningz);116 aubio_window(pv->w,win_s,aubio_win_hanningz); 117 117 118 118 pv->channels = channels; -
src/pitchdetection.c
rea865c9 r28d8c4a 139 139 aubio_pvoc_do(p->pv,ibuf,p->fftgrain); 140 140 pitch = aubio_pitchmcomb_detect(p->mcomb,p->fftgrain); 141 /** \bug should move the >0 check within bintofreq */141 /** \bug should move the >0 check within aubio_bintofreq */ 142 142 if (pitch>0.) { 143 pitch = bintofreq(pitch,p->srate,p->bufsize);143 pitch = aubio_bintofreq(pitch,p->srate,p->bufsize); 144 144 } else { 145 145 pitch = 0.; -
src/pitchfcomb.c
rea865c9 r28d8c4a 91 91 92 92 /* map delta phase into +/- Pi interval */ 93 tmp = unwrap2pi(tmp);93 tmp = aubio_unwrap2pi(tmp); 94 94 95 95 /* get deviation from bin frequency from the +/- Pi interval */ -
src/tss.c
rea865c9 r28d8c4a 56 56 for (i=0;i<channels; i++){ 57 57 for (j=0;j<nbins; j++){ 58 dev[i][j] = unwrap2pi(input->phas[i][j]58 dev[i][j] = aubio_unwrap2pi(input->phas[i][j] 59 59 -2.0*theta1[i][j]+theta2[i][j]); 60 60 theta2[i][j] = theta1[i][j]; -
swig/aubio.i
rea865c9 r28d8c4a 98 98 aubio_win_welch, 99 99 aubio_win_parzen 100 } aubio_window_type _t;101 102 void window(smpl_t *w, uint_t size, aubio_window_type_twintype);103 smpl_t unwrap2pi (smpl_t phase);100 } aubio_window_type; 101 102 void aubio_window(smpl_t *w, uint_t size, aubio_window_type wintype); 103 smpl_t aubio_unwrap2pi (smpl_t phase); 104 104 smpl_t vec_mean(fvec_t *s); 105 105 smpl_t vec_max(fvec_t *s); … … 119 119 smpl_t vec_median(fvec_t * input); 120 120 smpl_t vec_quadint(fvec_t * x,uint_t pos); 121 smpl_t quadfrac(smpl_t s0, smpl_t s1, smpl_t s2, smpl_t pf);121 smpl_t aubio_quadfrac(smpl_t s0, smpl_t s1, smpl_t s2, smpl_t pf); 122 122 uint_t vec_peakpick(fvec_t * input, uint_t pos); 123 smpl_t bintomidi(smpl_t bin, smpl_t samplerate, smpl_t fftsize);124 smpl_t bintofreq(smpl_t bin, smpl_t samplerate, smpl_t fftsize);125 smpl_t freqtomidi(smpl_t freq);123 smpl_t aubio_bintomidi(smpl_t bin, smpl_t samplerate, smpl_t fftsize); 124 smpl_t aubio_bintofreq(smpl_t bin, smpl_t samplerate, smpl_t fftsize); 125 smpl_t aubio_freqtomidi(smpl_t freq); 126 126 uint_t aubio_silence_detection(fvec_t * ibuf, smpl_t threshold); 127 127 smpl_t aubio_level_detection(fvec_t * ibuf, smpl_t threshold);
Note: See TracChangeset
for help on using the changeset viewer.