- Timestamp:
- Nov 17, 2018, 12:18:11 PM (6 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
- Children:
- 6b46a4e
- Parents:
- 1d51820
- Location:
- src/spectral
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/spectral/filterbank.c
r1d51820 r0e30a12 24 24 #include "fmat.h" 25 25 #include "cvec.h" 26 #include "vecutils.h" 26 27 #include "spectral/filterbank.h" 27 28 #include "mathutils.h" … … 33 34 uint_t n_filters; 34 35 fmat_t *filters; 36 smpl_t norm; 37 smpl_t power; 35 38 }; 36 39 … … 45 48 /* allocate filter tables, a matrix of length win_s and of height n_filters */ 46 49 fb->filters = new_fmat (n_filters, win_s / 2 + 1); 50 51 fb->norm = 1; 52 53 fb->power = 1; 47 54 48 55 return fb; … … 68 75 tmp.data = in->norm; 69 76 77 if (f->power != 1.) fvec_pow(&tmp, f->power); 78 70 79 fmat_vecmul(f->filters, &tmp, out); 71 80 … … 85 94 return 0; 86 95 } 96 97 uint_t 98 aubio_filterbank_set_norm (aubio_filterbank_t *f, smpl_t norm) 99 { 100 if (norm != 0 && norm != 1) return AUBIO_FAIL; 101 f->norm = norm; 102 return AUBIO_OK; 103 } 104 105 smpl_t 106 aubio_filterbank_get_norm (aubio_filterbank_t *f) 107 { 108 return f->norm; 109 } 110 111 uint_t 112 aubio_filterbank_set_power (aubio_filterbank_t *f, smpl_t power) 113 { 114 f->power = power; 115 return AUBIO_OK; 116 } 117 118 smpl_t 119 aubio_filterbank_get_power (aubio_filterbank_t *f) 120 { 121 return f->norm; 122 } -
src/spectral/filterbank.h
r1d51820 r0e30a12 84 84 uint_t aubio_filterbank_set_coeffs (aubio_filterbank_t * f, const fmat_t * filters); 85 85 86 uint_t aubio_filterbank_set_norm (aubio_filterbank_t *f, smpl_t norm); 87 88 smpl_t aubio_filterbank_get_norm (aubio_filterbank_t *f); 89 90 uint_t aubio_filterbank_set_power (aubio_filterbank_t *f, smpl_t power); 91 92 smpl_t aubio_filterbank_get_power (aubio_filterbank_t *f); 93 86 94 #ifdef __cplusplus 87 95 }
Note: See TracChangeset
for help on using the changeset viewer.