Changeset 407bba9
- Timestamp:
- Oct 17, 2009, 2:38:47 PM (15 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:
- 74516f7
- Parents:
- 858cfa7
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mathutils.c
r858cfa7 r407bba9 26 26 #include "config.h" 27 27 28 29 /** Window types */ 30 typedef enum 31 { 32 aubio_win_rectangle, 33 aubio_win_hamming, 34 aubio_win_hanning, 35 aubio_win_hanningz, 36 aubio_win_blackman, 37 aubio_win_blackman_harris, 38 aubio_win_gaussian, 39 aubio_win_welch, 40 aubio_win_parzen, 41 aubio_win_default = aubio_win_hanningz, 42 } aubio_window_type; 43 28 44 fvec_t * 29 new_aubio_window ( uint_t size, aubio_window_type wintype)45 new_aubio_window (char_t * window_type, uint_t size) 30 46 { 31 47 // create fvec of size x 1 channel … … 33 49 smpl_t * w = win->data[0]; 34 50 uint_t i; 51 aubio_window_type wintype; 52 if (strcmp (window_type, "rectangle") == 0) 53 wintype = aubio_win_rectangle; 54 else if (strcmp (window_type, "hamming") == 0) 55 wintype = aubio_win_hamming; 56 else if (strcmp (window_type, "hanning") == 0) 57 wintype = aubio_win_hanning; 58 else if (strcmp (window_type, "hanningz") == 0) 59 wintype = aubio_win_hanningz; 60 else if (strcmp (window_type, "blackman") == 0) 61 wintype = aubio_win_blackman; 62 else if (strcmp (window_type, "blackman_harris") == 0) 63 wintype = aubio_win_blackman_harris; 64 else if (strcmp (window_type, "gaussian") == 0) 65 wintype = aubio_win_gaussian; 66 else if (strcmp (window_type, "welch") == 0) 67 wintype = aubio_win_welch; 68 else if (strcmp (window_type, "parzen") == 0) 69 wintype = aubio_win_parzen; 70 else if (strcmp (window_type, "default") == 0) 71 wintype = aubio_win_default; 72 else { 73 AUBIO_ERR ("unknown window type %s, using default.\n", window_type); 74 wintype = aubio_win_default; 75 return NULL; 76 } 35 77 switch(wintype) { 36 78 case aubio_win_rectangle: -
src/mathutils.h
r858cfa7 r407bba9 30 30 #endif 31 31 32 /** Window types32 /** create window 33 33 34 34 References: … … 44 44 45 45 */ 46 typedef enum 47 { 48 aubio_win_rectangle, 49 aubio_win_hamming, 50 aubio_win_hanning, 51 aubio_win_hanningz, 52 aubio_win_blackman, 53 aubio_win_blackman_harris, 54 aubio_win_gaussian, 55 aubio_win_welch, 56 aubio_win_parzen 57 } aubio_window_type; 58 59 /** create window */ 60 fvec_t *new_aubio_window (uint_t size, aubio_window_type wintype); 46 fvec_t *new_aubio_window (char_t * window_type, uint_t size); 61 47 62 48 /** compute the principal argument -
src/pitch/pitchfcomb.c
r858cfa7 r407bba9 52 52 p->fftLastPhase = new_fvec(bufsize, channels); 53 53 p->fft = new_aubio_fft(bufsize, 1); 54 p->win = new_aubio_window( bufsize, aubio_win_hanning);54 p->win = new_aubio_window("hanning", bufsize); 55 55 return p; 56 56 } -
src/pitch/pitchyinfft.c
r858cfa7 r407bba9 57 57 p->yinfft = new_fvec(bufsize/2+1,1); 58 58 p->tol = 0.85; 59 p->win = new_aubio_window( bufsize, aubio_win_hanningz);59 p->win = new_aubio_window("hanningz", bufsize); 60 60 p->weight = new_fvec(bufsize/2+1,1); 61 61 { -
src/spectral/phasevoc.c
r858cfa7 r407bba9 96 96 pv->dataold = new_fvec (win_s-hop_s, channels); 97 97 pv->synthold = new_fvec (win_s-hop_s, channels); 98 pv->w = new_aubio_window ( win_s, aubio_win_hanningz);98 pv->w = new_aubio_window ("hanningz", win_s); 99 99 100 100 pv->channels = channels; -
tests/src/test-hist.c
r858cfa7 r407bba9 7 7 for (length = 1; length < 10; length ++ ) { 8 8 aubio_hist_t *o = new_aubio_hist(0, 1, length, 5); 9 fvec_t *t = new_aubio_window( length,aubio_win_hanning);9 fvec_t *t = new_aubio_window("hanning", length); 10 10 aubio_hist_do(o,t); 11 11 fvec_print(t); … … 15 15 fvec_print(t); 16 16 del_fvec(t); 17 t = new_aubio_window( length,aubio_win_hanningz);17 t = new_aubio_window("hanningz", length); 18 18 aubio_hist_do(o,t); 19 19 fvec_print(t); -
tests/src/test-window.c
r858cfa7 r407bba9 7 7 for (length = 2; length <= 5; length++) 8 8 { 9 fvec_t *t = new_aubio_window( length,aubio_win_rectangle);9 fvec_t *t = new_aubio_window("rectangle", length); 10 10 del_fvec(t); 11 t = new_aubio_window( length,aubio_win_hamming);11 t = new_aubio_window("hamming", length); 12 12 fvec_print(t); 13 13 del_fvec(t); 14 t = new_aubio_window( length,aubio_win_hanning);14 t = new_aubio_window("hanning", length); 15 15 fvec_print(t); 16 16 del_fvec(t); 17 t = new_aubio_window( length,aubio_win_hanningz);17 t = new_aubio_window("hanningz", length); 18 18 fvec_print(t); 19 19 del_fvec(t); 20 t = new_aubio_window( length,aubio_win_blackman);20 t = new_aubio_window("blackman", length); 21 21 fvec_print(t); 22 22 del_fvec(t); 23 t = new_aubio_window( length,aubio_win_blackman_harris);23 t = new_aubio_window("blackman_harris", length); 24 24 fvec_print(t); 25 25 del_fvec(t); 26 t = new_aubio_window( length,aubio_win_gaussian);26 t = new_aubio_window("gaussian", length); 27 27 fvec_print(t); 28 28 del_fvec(t); 29 t = new_aubio_window( length,aubio_win_welch);29 t = new_aubio_window("welch", length); 30 30 fvec_print(t); 31 31 del_fvec(t); 32 t = new_aubio_window(length,aubio_win_parzen); 32 t = new_aubio_window("parzen", length); 33 fvec_print(t); 34 del_fvec(t); 35 t = new_aubio_window("default", length); 33 36 fvec_print(t); 34 37 del_fvec(t);
Note: See TracChangeset
for help on using the changeset viewer.