Changeset c02a1cc


Ignore:
Timestamp:
Feb 16, 2016, 9:50:08 PM (8 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:
73e8f65
Parents:
fc2d7fb
Message:

src/spectral/mfcc.c: swap dct_coeffs matrix to prepare for fmat_vecmul

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/spectral/mfcc.c

    rfc2d7fb rc02a1cc  
    6868  mfcc->in_dct = new_fvec (n_filters);
    6969
    70   mfcc->dct_coeffs = new_fmat (n_filters, n_coefs);
     70  mfcc->dct_coeffs = new_fmat (n_coefs, n_filters);
    7171
    72   /* compute DCT transform dct_coeffs[i][j] as
     72  /* compute DCT transform dct_coeffs[j][i] as
    7373     cos ( j * (i+.5) * PI / n_filters ) */
    7474  scaling = 1. / SQRT (n_filters / 2.);
    7575  for (i = 0; i < n_filters; i++) {
    7676    for (j = 0; j < n_coefs; j++) {
    77       mfcc->dct_coeffs->data[i][j] =
     77      mfcc->dct_coeffs->data[j][i] =
    7878          scaling * COS (j * (i + 0.5) * PI / n_filters);
    7979    }
    80     mfcc->dct_coeffs->data[i][0] *= SQRT (2.) / 2.;
     80    mfcc->dct_coeffs->data[0][i] *= SQRT (2.) / 2.;
    8181  }
    8282
     
    121121    for (k = 0; k < mf->n_coefs; k++) {
    122122      out->data[k] += mf->in_dct->data[j]
    123           * mf->dct_coeffs->data[j][k];
     123          * mf->dct_coeffs->data[k][j];
    124124    }
    125125  }
Note: See TracChangeset for help on using the changeset viewer.