Changeset c02a1cc
- Timestamp:
- Feb 16, 2016, 9:50:08 PM (9 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/spectral/mfcc.c
rfc2d7fb rc02a1cc 68 68 mfcc->in_dct = new_fvec (n_filters); 69 69 70 mfcc->dct_coeffs = new_fmat (n_ filters, n_coefs);70 mfcc->dct_coeffs = new_fmat (n_coefs, n_filters); 71 71 72 /* compute DCT transform dct_coeffs[ i][j] as72 /* compute DCT transform dct_coeffs[j][i] as 73 73 cos ( j * (i+.5) * PI / n_filters ) */ 74 74 scaling = 1. / SQRT (n_filters / 2.); 75 75 for (i = 0; i < n_filters; i++) { 76 76 for (j = 0; j < n_coefs; j++) { 77 mfcc->dct_coeffs->data[ i][j] =77 mfcc->dct_coeffs->data[j][i] = 78 78 scaling * COS (j * (i + 0.5) * PI / n_filters); 79 79 } 80 mfcc->dct_coeffs->data[ i][0] *= SQRT (2.) / 2.;80 mfcc->dct_coeffs->data[0][i] *= SQRT (2.) / 2.; 81 81 } 82 82 … … 121 121 for (k = 0; k < mf->n_coefs; k++) { 122 122 out->data[k] += mf->in_dct->data[j] 123 * mf->dct_coeffs->data[ j][k];123 * mf->dct_coeffs->data[k][j]; 124 124 } 125 125 }
Note: See TracChangeset
for help on using the changeset viewer.