Changeset e5f6a0b for examples


Ignore:
Timestamp:
Sep 16, 2007, 6:06:07 PM (18 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:
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.
Message:

merge from amaury's branch

Location:
examples
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • examples/aubiomfcc.c

    r45134c5 re5f6a0b  
    2323fvec_t * mfcc_out;
    2424aubio_mfcc_t * mfcc;
     25
     26uint_t n_filters = 40;
     27uint_t n_coefs = 11;
    2528
    2629unsigned int pos = 0; /*frames%dspblocksize*/
     
    5053      //compute mfccs
    5154      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     
    5362      /* end of block loop */
    5463      pos = -1; /* so it will be zero next j loop */
     
    6574      */
    6675     
    67       uint_t filter_cnt;
     76      uint_t coef_cnt;
    6877      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       
    7987      }
    8088}
     
    8290int main(int argc, char **argv) {
    8391  // params
    84   uint_t n_filters = 11;
     92 
    8593  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 
    8998 
    9099  //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 
    94104  //process
    95105  examples_common_process(aubio_process,process_print);
  • examples/utils.c

    r45134c5 re5f6a0b  
    4040smpl_t threshold                      = 0.3;
    4141smpl_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;
     44uint_t buffer_size                    = 1024;
     45uint_t overlap_size                   = 512;
     46// uint_t buffer_size                    = 2048;
     47// uint_t overlap_size                   = 1024;
    4448uint_t channels                       = 1;
    4549uint_t samplerate                     = 44100;
     
    6064int isonset = 0;
    6165aubio_pickpeak_t * parms;
    62 
    63 /* mfcc objects */
    64 //parameters
    65 uint_t n_filters=20;
    66 smpl_t lowfreq=80.f;
    67 smpl_t highfreq=18000.f;
    68 // filterbank object
    69 aubio_filterbank_t * mf;
    70 
    71 // DCT mfft and result storage
    72 aubio_mfft_t * fft_dct;
    73 cvec_t * fftgrain_dct;
    74 smpl_t * mfcc_outbuf[11];
    75 
    7666
    7767/* pitch objects */
     
    314304  fftgrain  = new_cvec(buffer_size, channels);
    315305
    316   //init for mfcc process
    317   fftgrain_dct= new_cvec(n_filters, channels);
    318 
     306 
    319307  if (usepitch) {
    320308    pitchdet = new_aubio_pitchdetection(buffer_size*4,
     
    330318  pv = new_aubio_pvoc(buffer_size, overlap_size, channels);
    331319 
    332   // dct phase vocoder
    333   //TODO: check size
    334   fft_dct = new_aubio_mfft(n_filters, channels);
    335 
    336320  /* onsets */
    337321  parms = new_aubio_peakpicker(threshold);
     
    367351  del_fvec(onset);
    368352  del_fvec(woodblock);
    369  
    370   //mffc related
    371   del_aubio_mfft(fft_dct);
    372   del_cvec(fftgrain_dct);
    373353 
    374354  aubio_cleanup();
Note: See TracChangeset for help on using the changeset viewer.