Ignore:
Timestamp:
Sep 6, 2007, 7:32:13 PM (13 years ago)
Author:
Amaury Hazan <mahmoudax@gmail.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
7a46bf6, fdf39ba
Parents:
71b1b4b
Message:

minor changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/aubiomfcc.c

    r71b1b4b r7c6c806  
    2727  unsigned int j;       /*frames*/
    2828 
    29   // declare the mel filter bank
    30   // TODO: should be done only once
    31   aubio_mfcc_init(int N, NYQUIST, int style, float freq_min, float freq_max, int freq_bands, float **fft_tables);
    32 
    3329  for (j=0;j<(unsigned)nframes;j++) {
    3430    if(usejack) {
     
    4743      aubio_pvoc_do (pv,ibuf, fftgrain);
    4844     
     45      uint_t n_coefs= n_filters/2 +1;
    4946      uint_t coef_cnt;
    50       uint_t n_filters=20;
    51       smpl_t outbuf[20];
     47       
    5248
    53       for (coef_cnt=0; coef_cnt<n_filters ; coef_cnt++)
    54         outbuf[coef_cnt]=0.f;
     49      for (coef_cnt=0; coef_cnt<n_coefs ; coef_cnt++)
     50        mfcc_outbuf[coef_cnt]=0.f;
    5551       
    5652      //compute mfccs
    57       aubio_mffc_do(fftgrain->norm, nframes, mf, outbuf);
     53      aubio_mffc_do(fftgrain->norm, nframes, mf, mfcc_outbuf, fft_dct, fftgrain_dct);
    5854     
    59       for (coef_cnt=0; coef_cnt<n_filters ; coef_cnt++)
    60         outmsg("%f ",outbuf[coef_cnt]);
     55      for (coef_cnt=0; coef_cnt<n_coefs ; coef_cnt++)
     56        outmsg("%f ",mfcc_outbuf[coef_cnt]);
    6157      outmsg("\n");
    6258     
     
    9086 
    9187  //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;
     88 
    9689
     90  //allocating global mf (in utils.c)
    9791  uint_t banksize = (uint) ( sizeof(aubio_mel_filter));
    98   aubio_mel_filter * mf = (aubio_mel_filter *)getbytes(banksize);
     92  mf = (aubio_mel_filter *)getbytes(banksize);
    9993
    10094  mf->n_filters = 20;
Note: See TracChangeset for help on using the changeset viewer.