- Timestamp:
- Sep 16, 2007, 6:06:07 PM (18 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:
- 177f09a
- Parents:
- 45134c5 (diff), bc4ba75 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- examples
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/aubiomfcc.c
r45134c5 re5f6a0b 23 23 fvec_t * mfcc_out; 24 24 aubio_mfcc_t * mfcc; 25 26 uint_t n_filters = 40; 27 uint_t n_coefs = 11; 25 28 26 29 unsigned int pos = 0; /*frames%dspblocksize*/ … … 50 53 //compute mfccs 51 54 aubio_mfcc_do(mfcc, fftgrain, mfcc_out); 52 55 56 uint_t coef_cnt; 57 for (coef_cnt = 0; coef_cnt < n_coefs; coef_cnt++) { 58 outmsg("%f ",mfcc_out->data[0][coef_cnt]); 59 } 60 outmsg("\n"); 61 53 62 /* end of block loop */ 54 63 pos = -1; /* so it will be zero next j loop */ … … 65 74 */ 66 75 67 uint_t filter_cnt;76 uint_t coef_cnt; 68 77 if (output_filename == NULL) { 69 if(frames >= 4) { 70 outmsg("%f\t",(frames-4)*overlap_size/(float)samplerate); 71 } else if (frames < 4) { 72 outmsg("%f\t",0.); 73 } 74 outmsg("%f",mfcc_out->data[0][0]); 75 for (filter_cnt = 1; filter_cnt < mfcc_out->length; filter_cnt++) { 76 outmsg(",%f",mfcc_out->data[0][filter_cnt]); 77 } 78 outmsg("\n"); 78 // if(frames >= 4) { 79 // outmsg("%f\t",(frames-4)*overlap_size/(float)samplerate); 80 // } 81 // else if (frames < 4) { 82 // outmsg("%f\t",0.); 83 // } 84 //outmsg("%f ",mfcc_out->data[0][0]); 85 86 79 87 } 80 88 } … … 82 90 int main(int argc, char **argv) { 83 91 // params 84 uint_t n_filters = 11;92 85 93 examples_common_init(argc,argv); 86 smpl_t lowfreq = 0.; 87 smpl_t highfreq = samplerate; 88 mfcc_out = new_fvec(n_filters,channels); 94 smpl_t lowfreq = 133.333f; 95 smpl_t highfreq = 44100.f; 96 mfcc_out = new_fvec(n_coefs,channels); 97 89 98 90 99 //populating the filter 91 mfcc = new_aubio_mfcc(buffer_size, samplerate, n_filters, lowfreq, highfreq, 92 channels); 93 100 mfcc = new_aubio_mfcc(buffer_size, samplerate, n_filters, n_coefs , lowfreq, highfreq, channels); 101 dump_filterbank(mfcc); 102 103 94 104 //process 95 105 examples_common_process(aubio_process,process_print); -
examples/utils.c
r45134c5 re5f6a0b 40 40 smpl_t threshold = 0.3; 41 41 smpl_t silence = -90.; 42 uint_t buffer_size = 512; //1024; 43 uint_t overlap_size = 256; //512; 42 // uint_t buffer_size = 512; 43 // uint_t overlap_size = 256; 44 uint_t buffer_size = 1024; 45 uint_t overlap_size = 512; 46 // uint_t buffer_size = 2048; 47 // uint_t overlap_size = 1024; 44 48 uint_t channels = 1; 45 49 uint_t samplerate = 44100; … … 60 64 int isonset = 0; 61 65 aubio_pickpeak_t * parms; 62 63 /* mfcc objects */64 //parameters65 uint_t n_filters=20;66 smpl_t lowfreq=80.f;67 smpl_t highfreq=18000.f;68 // filterbank object69 aubio_filterbank_t * mf;70 71 // DCT mfft and result storage72 aubio_mfft_t * fft_dct;73 cvec_t * fftgrain_dct;74 smpl_t * mfcc_outbuf[11];75 76 66 77 67 /* pitch objects */ … … 314 304 fftgrain = new_cvec(buffer_size, channels); 315 305 316 //init for mfcc process 317 fftgrain_dct= new_cvec(n_filters, channels); 318 306 319 307 if (usepitch) { 320 308 pitchdet = new_aubio_pitchdetection(buffer_size*4, … … 330 318 pv = new_aubio_pvoc(buffer_size, overlap_size, channels); 331 319 332 // dct phase vocoder333 //TODO: check size334 fft_dct = new_aubio_mfft(n_filters, channels);335 336 320 /* onsets */ 337 321 parms = new_aubio_peakpicker(threshold); … … 367 351 del_fvec(onset); 368 352 del_fvec(woodblock); 369 370 //mffc related371 del_aubio_mfft(fft_dct);372 del_cvec(fftgrain_dct);373 353 374 354 aubio_cleanup();
Note: See TracChangeset
for help on using the changeset viewer.