From 845c4354cde7bc7ca3b5255a9281ff0b5117d013 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Mon, 30 Sep 2013 08:58:12 -0500 Subject: [PATCH] tests/src/spectral/test-filterbank*: improve comments, print coeffs --- tests/src/spectral/test-filterbank.c | 18 ++++++++++++------ tests/src/spectral/test-filterbank_mel.c | 17 +++++++++++------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/tests/src/spectral/test-filterbank.c b/tests/src/spectral/test-filterbank.c index 679e6cde..3817f137 100644 --- a/tests/src/spectral/test-filterbank.c +++ b/tests/src/spectral/test-filterbank.c @@ -7,19 +7,25 @@ int main () cvec_t *in_spec = new_cvec (win_s); // input vector of samples fvec_t *out_filters = new_fvec (n_filters); // per-band outputs - fmat_t *coeffs; // pointer to the coefficients // create filterbank object aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s); - coeffs = aubio_filterbank_get_coeffs (o); + // apply filterbank ten times + uint_t n = 10; + while (n) { + aubio_filterbank_do (o, in_spec, out_filters); + n--; + } - aubio_filterbank_do (o, in_spec, out_filters); + // print out filterbank coeffs + fmat_t *coeffs; // pointer to the coefficients + coeffs = aubio_filterbank_get_coeffs (o); + fmat_print (coeffs); - // fmat_print (coeffs); - // cvec_print(in_spec); - // fvec_print(out_filters); + //fvec_print (out_filters); + // clean up del_aubio_filterbank (o); del_cvec (in_spec); del_fvec (out_filters); diff --git a/tests/src/spectral/test-filterbank_mel.c b/tests/src/spectral/test-filterbank_mel.c index 89f6e774..23e402e3 100644 --- a/tests/src/spectral/test-filterbank_mel.c +++ b/tests/src/spectral/test-filterbank_mel.c @@ -8,7 +8,6 @@ int main () cvec_t *in_spec = new_cvec (win_s); // input vector of samples fvec_t *out_filters = new_fvec (n_filters); // per-band outputs - fmat_t *coeffs; // pointer to the coefficients // create filterbank object aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s); @@ -16,13 +15,19 @@ int main () // assign Mel-frequency coefficients aubio_filterbank_set_mel_coeffs_slaney (o, samplerate); - coeffs = aubio_filterbank_get_coeffs (o); + // apply filterbank ten times + uint_t n = 10; + while (n) { + aubio_filterbank_do (o, in_spec, out_filters); + n--; + } - aubio_filterbank_do (o, in_spec, out_filters); + // print out filter coefficients + fmat_t *coeffs; // pointer to the coefficients + coeffs = aubio_filterbank_get_coeffs (o); + fmat_print (coeffs); - // fmat_print (coeffs); - // cvec_print(in_spec); - // fvec_print(out_filters); + //fvec_print (out_filters); del_aubio_filterbank (o); del_cvec (in_spec); -- 2.11.0