Changeset 6938a20 for tests/src/spectral/test-filterbank_mel.c
- Timestamp:
- Mar 3, 2013, 7:37:43 PM (11 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:
- 9547247
- Parents:
- 26775a3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/spectral/test-filterbank_mel.c
r26775a3 r6938a20 1 #define AUBIO_UNSTABLE 12 3 #include <stdio.h>4 1 #include <aubio.h> 5 2 6 int 7 main (void) 3 int main () 8 4 { 9 /* allocate some memory */5 uint_t samplerate = 16000; // samplerate of signal to filter 10 6 uint_t win_s = 512; // fft size 11 7 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 fmat_t *coeffs = NULL;15 smpl_t samplerate = 16000.;16 8 17 /* allocate fft and other memory space */ 9 cvec_t *in_spec = new_cvec (win_s); // input vector of samples 10 fvec_t *out_filters = new_fvec (n_filters); // per-band outputs 11 fmat_t *coeffs; // pointer to the coefficients 12 13 // create filterbank object 18 14 aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s); 19 15 20 / * assign Mel-frequency coefficients */16 // assign Mel-frequency coefficients 21 17 aubio_filterbank_set_mel_coeffs_slaney (o, samplerate); 22 18 23 19 coeffs = aubio_filterbank_get_coeffs (o); 24 20 25 fmat_print (coeffs);26 27 //fprintf(stderr, "%f\n", fvec_sum(coeffs));28 29 21 aubio_filterbank_do (o, in_spec, out_filters); 30 22 31 fvec_print(in_spec); 32 fvec_print(out_filters); 23 // fmat_print (coeffs); 24 // cvec_print(in_spec); 25 // fvec_print(out_filters); 33 26 34 27 del_aubio_filterbank (o);
Note: See TracChangeset
for help on using the changeset viewer.