Changeset 71b1b4b for examples


Ignore:
Timestamp:
Sep 6, 2007, 3:52:19 PM (17 years ago)
Author:
Amaury Hazan <mahmoudax@gmail.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:
7c6c806d
Parents:
dcc649c (diff), 97886fa (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:

merged from laptop

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/aubiomfcc.c

    rdcc649c r71b1b4b  
    4646      //compute mag spectrum
    4747      aubio_pvoc_do (pv,ibuf, fftgrain);
     48     
     49      uint_t coef_cnt;
     50      uint_t n_filters=20;
     51      smpl_t outbuf[20];
     52
     53      for (coef_cnt=0; coef_cnt<n_filters ; coef_cnt++)
     54        outbuf[coef_cnt]=0.f;
     55       
     56      //compute mfccs
     57      aubio_mffc_do(fftgrain->norm, nframes, mf, outbuf);
    4858     
    49       //TODO: extract Magnitude buffer f_fvec from fftgrain cvec
    50 
    51       //compute mfccs
    52       aubio_mffc_do (magbuf, nframes, filterbank, outbuf);
     59      for (coef_cnt=0; coef_cnt<n_filters ; coef_cnt++)
     60        outmsg("%f ",outbuf[coef_cnt]);
     61      outmsg("\n");
    5362     
    5463     
     
    7988int main(int argc, char **argv) {
    8089  examples_common_init(argc,argv);
     90 
     91  //allocate and initialize mel filter bank
     92  uint_t n_filters=20;
     93  uint_t nyquist= samplerate / 2.;
     94  smpl_t lowfreq=80.f;
     95  smpl_t highfreq=18000.f;
     96
     97  uint_t banksize = (uint) ( sizeof(aubio_mel_filter));
     98  aubio_mel_filter * mf = (aubio_mel_filter *)getbytes(banksize);
     99
     100  mf->n_filters = 20;
     101  mf->filters = (smpl_t **)getbytes(mf->n_filters * sizeof(smpl_t *));
     102  for(n = 0; n < mf->n_filters; n++)
     103    mf->filters[n] = (smpl_t *)getbytes((buffer_size/2+1) * sizeof(smpl_t));
     104 
     105  //populating the filter
     106  aubio_mfcc_init(buffer_size, nyquist, XTRACT_EQUAL_GAIN, lowfreq, highfreq, mf->n_filters, mf->filters);
     107
     108  //process
    81109  examples_common_process(aubio_process,process_print);
    82110  examples_common_del();
    83111  debug("End of program.\n");
    84112  fflush(stderr);
     113 
     114  //destroying filterbank
     115  free(mf);
     116 
    85117  return 0;
    86118}
Note: See TracChangeset for help on using the changeset viewer.