Changeset 9590e81 for src/temporal/c_weighting.c
- Timestamp:
- Feb 9, 2016, 3:24:53 PM (8 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:
- 1175883
- Parents:
- a33d406
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/temporal/c_weighting.c
ra33d406 r9590e81 30 30 { 31 31 uint_t order; lsmp_t *a, *b; lvec_t *as, *bs; 32 33 if ((sint_t)samplerate <= 0) { 34 AUBIO_ERROR("aubio_filter: failed setting C-weighting with samplerate %d\n", samplerate); 35 return AUBIO_FAIL; 36 } 37 if (f == NULL) { 38 AUBIO_ERROR("aubio_filter: failed setting C-weighting with filter NULL\n"); 39 return AUBIO_FAIL; 40 } 41 42 order = aubio_filter_get_order (f); 43 if ( order != 5 ) { 44 AUBIO_ERROR ("aubio_filter: order of C-weighting filter must be 5, not %d\n", order); 45 return 1; 46 } 47 32 48 aubio_filter_set_samplerate (f, samplerate); 33 49 bs = aubio_filter_get_feedforward (f); 34 50 as = aubio_filter_get_feedback (f); 35 51 b = bs->data, a = as->data; 36 order = aubio_filter_get_order (f);37 38 if ( order != 5 ) {39 AUBIO_ERROR ("order of C-weighting filter must be 5, not %d\n", order);40 return 1;41 }42 52 43 53 /* select coefficients according to sampling frequency */ … … 200 210 aubio_filter_t * new_aubio_filter_c_weighting (uint_t samplerate) { 201 211 aubio_filter_t * f = new_aubio_filter(5); 202 aubio_filter_set_c_weighting (f, samplerate); 212 if (aubio_filter_set_c_weighting(f,samplerate) != AUBIO_OK) { 213 del_aubio_filter(f); 214 return NULL; 215 } 203 216 return f; 204 217 } 205
Note: See TracChangeset
for help on using the changeset viewer.