- Timestamp:
- Oct 19, 2009, 3:00:32 PM (15 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:
- 615ac7d
- Parents:
- b849106
- Location:
- src/temporal
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/temporal/filter.c
rb849106 r3f99693 80 80 } 81 81 82 /* 83 * 84 * despite mirroring, end effects destroy both phse and amplitude. the longer 85 * the buffer, the less affected they are. 86 * 87 * replacing with zeros clicks. 88 * 89 * seems broken for order > 4 (see biquad_do_filtfilt for audible one) 90 */ 82 /* The rough way: reset memory of filter between each run to avoid end effects. */ 91 83 void aubio_filter_do_filtfilt(aubio_filter_t * f, fvec_t * in, fvec_t * tmp) { 92 84 uint_t j,i=0; 93 85 uint_t length = in->length; 94 //uint_t order = f->order;95 //lsmp_t mir;96 /* mirroring */97 //mir = 2*in->data[i][0];98 //for (j=1;j<order;j++)99 //f->x[j] = 0.;//mir - in->data[i][order-j];100 86 /* apply filtering */ 101 87 aubio_filter_do(f,in); 102 /* invert */ 88 aubio_filter_do_reset(f); 89 /* mirror */ 103 90 for (j = 0; j < length; j++) 104 91 tmp->data[i][length-j-1] = in->data[i][j]; 105 /* mirror inverted */ 106 //mir = 2*tmp->data[i][0]; 107 //for (j=1;j<order;j++) 108 //f->x[j] = 0.;//mir - tmp->data[i][order-j]; 109 /* apply filtering on inverted */ 92 /* apply filtering on mirrored */ 110 93 aubio_filter_do(f,tmp); 94 aubio_filter_do_reset(f); 111 95 /* invert back */ 112 96 for (j = 0; j < length; j++) … … 145 129 } 146 130 131 void 132 aubio_filter_do_reset (aubio_filter_t * f) 133 { 134 lvec_zeros(f->x); 135 lvec_zeros(f->y); 136 } 137 147 138 aubio_filter_t * 148 139 new_aubio_filter (uint_t order, uint_t channels) -
src/temporal/filter.h
rb849106 r3f99693 141 141 uint_t aubio_filter_set_samplerate (aubio_filter_t * f, uint_t samplerate); 142 142 143 /** reset filter memory */ 144 void aubio_filter_do_reset (aubio_filter_t * f); 145 143 146 /** create new filter object 144 147
Note: See TracChangeset
for help on using the changeset viewer.