Changeset f264b17 for src/spectral/filterbank.c
- Timestamp:
- Jun 22, 2016, 1:00:10 PM (9 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:
- 4b9443c4
- Parents:
- 60fc05b (diff), 6769586 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/spectral/filterbank.c
r60fc05b rf264b17 57 57 58 58 void 59 aubio_filterbank_do (aubio_filterbank_t * f, c vec_t * in, fvec_t * out)59 aubio_filterbank_do (aubio_filterbank_t * f, const cvec_t * in, fvec_t * out) 60 60 { 61 uint_t j, fn; 61 /* apply filter to all input channel, provided out has enough channels */ 62 //uint_t max_filters = MIN (f->n_filters, out->length); 63 //uint_t max_length = MIN (in->length, f->filters->length); 62 64 63 /* apply filter to all input channel, provided out has enough channels */ 64 uint_t max_filters = MIN (f->n_filters, out->length); 65 uint_t max_length = MIN (in->length, f->filters->length); 65 // view cvec->norm as fvec->data 66 fvec_t tmp; 67 tmp.length = in->length; 68 tmp.data = in->norm; 66 69 67 /* reset all values in output vector */ 68 fvec_zeros (out); 69 70 /* for each filter */ 71 for (fn = 0; fn < max_filters; fn++) { 72 /* for each sample */ 73 for (j = 0; j < max_length; j++) { 74 out->data[fn] += in->norm[j] * f->filters->data[fn][j]; 75 } 76 } 70 fmat_vecmul(f->filters, &tmp, out); 77 71 78 72 return; … … 80 74 81 75 fmat_t * 82 aubio_filterbank_get_coeffs ( aubio_filterbank_t * f)76 aubio_filterbank_get_coeffs (const aubio_filterbank_t * f) 83 77 { 84 78 return f->filters; … … 86 80 87 81 uint_t 88 aubio_filterbank_set_coeffs (aubio_filterbank_t * f, fmat_t * filter_coeffs)82 aubio_filterbank_set_coeffs (aubio_filterbank_t * f, const fmat_t * filter_coeffs) 89 83 { 90 84 fmat_copy(filter_coeffs, f->filters);
Note: See TracChangeset
for help on using the changeset viewer.