Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/aubiomfcc.c

    r38837b1 rf72ceeb  
    2323fvec_t * mfcc_out;
    2424aubio_mfcc_t * mfcc;
     25
     26uint_t n_filters = 40;
     27uint_t n_coefs = 20;
    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);
Note: See TracChangeset for help on using the changeset viewer.