Changeset b4b0324 for src/mathutils.c
 Timestamp:
 Aug 9, 2005, 10:58:47 AM (14 years ago)
 Branches:
 feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
 Children:
 32669d9
 Parents:
 876c5e7
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/mathutils.c
r876c5e7 rb4b0324 24 24 #include "mathutils.h" 25 25 26 void window(smpl_t *w, uint_t size, window_type_t wintype) {26 void window(smpl_t *w, uint_t size, aubio_window_type_t wintype) { 27 27 uint_t i; 28 28 switch(wintype) { 29 case rectangle:29 case aubio_win_rectangle: 30 30 for (i=0;i<size;i++) 31 31 w[i] = 0.5; 32 32 break; 33 case hamming:33 case aubio_win_hamming: 34 34 for (i=0;i<size;i++) 35 35 w[i] = 0.54  0.46 * COS(TWO_PI * i / (size)); 36 36 break; 37 case hanning:37 case aubio_win_hanning: 38 38 for (i=0;i<size;i++) 39 39 w[i] = 0.5  (0.5 * COS(TWO_PI * i / (size))); 40 40 break; 41 case hanningz:41 case aubio_win_hanningz: 42 42 for (i=0;i<size;i++) 43 43 w[i] = 0.5 * (1.0  COS(TWO_PI * i / (size))); 44 44 break; 45 case blackman:45 case aubio_win_blackman: 46 46 for (i=0;i<size;i++) 47 47 w[i] = 0.42 … … 49 49 + 0.08 * COS(2.0*TWO_PI*i/(size1.0)); 50 50 break; 51 case blackman_harris:51 case aubio_win_blackman_harris: 52 52 for (i=0;i<size;i++) 53 53 w[i] = 0.35875 … … 56 56  0.01168 * COS(3.0*TWO_PI*i/(size1.0)); 57 57 break; 58 case gaussian:58 case aubio_win_gaussian: 59 59 for (i=0;i<size;i++) 60 60 w[i] = EXP( 1.0 / SQR(size) * SQR(2.0*isize)); 61 61 break; 62 case welch:62 case aubio_win_welch: 63 63 for (i=0;i<size;i++) 64 64 w[i] = 1.0  SQR((2*isize)/(size+1.0)); 65 65 break; 66 case parzen:66 case aubio_win_parzen: 67 67 for (i=0;i<size;i++) 68 68 w[i] = 1.0  fabsf((2*isize)/(size+1.0));
Note: See TracChangeset
for help on using the changeset viewer.