 Timestamp:
 Sep 5, 2017, 1:01:34 PM (2 years ago)
 Branches:
 feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master
 Children:
 5d46eca
 Parents:
 60583a3
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/spectral/dct_ooura.c
r60583a3 r3873e5e 31 31 smpl_t *w; 32 32 int *ip; 33 smpl_t scalers[5]; 33 34 }; 34 35 … … 45 46 s>ip = AUBIO_ARRAY(int, 3 + (1 << (int)FLOOR(LOG(s>size/2) / LOG(2))) / 2); 46 47 s>ip[0] = 0; 48 s>scalers[0] = 2. * SQRT(1./(4.*s>size)); 49 s>scalers[1] = 2. * SQRT(1./(2.*s>size)); 50 s>scalers[2] = 1. / s>scalers[0]; 51 s>scalers[3] = 1. / s>scalers[1]; 52 s>scalers[4] = 2. / s>size; 47 53 return s; 48 54 beach: … … 63 69 aubio_ooura_ddct(s>size, 1, s>input>data, s>ip, s>w); 64 70 // apply orthonormal scaling 65 s>input>data[0] *= 2.* SQRT(1./(4.*s>input>length));71 s>input>data[0] *= s>scalers[0]; 66 72 for (i = 1; i < s>input>length; i++) { 67 s>input>data[i] *= 2. * SQRT(1./(2.*s>input>length));73 s>input>data[i] *= s>scalers[1]; 68 74 } 69 75 fvec_copy(s>input, output); … … 73 79 uint_t i = 0; 74 80 fvec_copy(input, s>input); 75 s>input>data[0] /= 2.* SQRT(1./(4.*s>input>length));81 s>input>data[0] *= s>scalers[2]; 76 82 for (i = 1; i < s>input>length; i++) { 77 s>input>data[i] /= 2. * SQRT(1./(2.*s>input>length));83 s>input>data[i] *= s>scalers[3]; 78 84 } 79 85 s>input>data[0] *= .5; 80 86 aubio_ooura_ddct(s>size, 1, s>input>data, s>ip, s>w); 81 87 for (i = 0; i < s>input>length; i++) { 82 s>input>data[i] *= 2./s>input>length;88 s>input>data[i] *= s>scalers[4]; 83 89 } 84 90 fvec_copy(s>input, output);
Note: See TracChangeset
for help on using the changeset viewer.