Changeset 8f68dfb for tests/src/spectral
- Timestamp:
- Mar 3, 2013, 4:54:04 AM (12 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:
- ed1deac
- Parents:
- b8c0685
- Location:
- tests/src/spectral
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/spectral/test-filterbank.c
rb8c0685 r8f68dfb 4 4 #include <aubio.h> 5 5 6 int 7 main (void) 8 { 9 /* allocate some memory */ 10 uint_t win_s = 1024; /* window size */ 11 uint_t n_filters = 13; /* number of filters */ 12 cvec_t *in = new_cvec (win_s); /* input buffer */ 13 fvec_t *out = new_fvec (win_s); /* input buffer */ 6 int main (void) { 7 uint_t win_s = 1024; // window size 8 uint_t n_filters = 13; // number of filters 9 cvec_t *in = new_cvec (win_s); // input buffer 10 fvec_t *out = new_fvec (win_s); // vector output */ 14 11 fmat_t *coeffs = NULL; 15 12 16 / * allocate fft and other memory space */13 // create filterbank 17 14 aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s); 18 15 -
tests/src/spectral/test-filterbank_mel.c
rb8c0685 r8f68dfb 8 8 { 9 9 /* allocate some memory */ 10 uint_t win_s = 512; /* fft size */11 uint_t n_filters = 40; /* number of filters */12 cvec_t *in = new_cvec (win_s); /*input buffer */13 fvec_t *out = new_fvec (win_s); /* input buffer*/10 uint_t win_s = 512; // fft size 11 uint_t n_filters = 40; // number of filters 12 cvec_t *in_spec = new_cvec (win_s); // input buffer */ 13 fvec_t *out_filters = new_fvec (n_filters); // output coeffs */ 14 14 fmat_t *coeffs = NULL; 15 15 smpl_t samplerate = 16000.; … … 22 22 23 23 coeffs = aubio_filterbank_get_coeffs (o); 24 if (coeffs == NULL) {25 return -1;26 }27 24 28 //fmat_print (coeffs);25 fmat_print (coeffs); 29 26 30 27 //fprintf(stderr, "%f\n", fvec_sum(coeffs)); 31 28 32 aubio_filterbank_do (o, in, out); 29 aubio_filterbank_do (o, in_spec, out_filters); 30 31 fvec_print(in_spec); 32 fvec_print(out_filters); 33 33 34 34 del_aubio_filterbank (o); 35 del_cvec (in );36 del_fvec (out );35 del_cvec (in_spec); 36 del_fvec (out_filters); 37 37 aubio_cleanup (); 38 38
Note: See TracChangeset
for help on using the changeset viewer.