Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/aubiomfcc.c

    rf72ceeb r38837b1  
    2323fvec_t * mfcc_out;
    2424aubio_mfcc_t * mfcc;
    25 
    26 uint_t n_filters = 40;
    27 uint_t n_coefs = 20;
    2825
    2926unsigned int pos = 0; /*frames%dspblocksize*/
     
    5350      //compute mfccs
    5451      aubio_mfcc_do(mfcc, fftgrain, mfcc_out);
    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      
     52
    6253      /* end of block loop */
    6354      pos = -1; /* so it will be zero next j loop */
     
    7465      */
    7566     
    76       uint_t coef_cnt;
     67      uint_t filter_cnt;
    7768      if (output_filename == NULL) {
    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        
     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");
    8779      }
    8880}
     
    9082int main(int argc, char **argv) {
    9183  // params
    92  
     84  uint_t n_filters = 11;
    9385  examples_common_init(argc,argv);
    94   smpl_t lowfreq = 133.333f;
    95   smpl_t highfreq = 44100.f;
    96   mfcc_out = new_fvec(n_coefs,channels);
    97  
     86  smpl_t lowfreq = 0.;
     87  smpl_t highfreq = samplerate;
     88  mfcc_out = new_fvec(n_filters,channels);
    9889 
    9990  //populating the filter
    100   mfcc = new_aubio_mfcc(buffer_size, samplerate, n_filters, n_coefs , lowfreq, highfreq, channels);
    101   dump_filterbank(mfcc);
    102  
    103  
     91  mfcc = new_aubio_mfcc(buffer_size, samplerate, n_filters, lowfreq, highfreq,
     92      channels);
     93
    10494  //process
    10595  examples_common_process(aubio_process,process_print);
Note: See TracChangeset for help on using the changeset viewer.