Changeset ddf04fd for src/spectral/filterbank_mel.c
- Timestamp:
- Dec 31, 2013, 12:31:59 AM (11 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:
- 5cc88f7
- Parents:
- 67b05b4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/spectral/filterbank_mel.c
r67b05b4 rddf04fd 35 35 fmat_t *filters = aubio_filterbank_get_coeffs (fb); 36 36 uint_t n_filters = filters->height, win_s = filters->length; 37 fvec_t *lower_freqs, *upper_freqs, *center_freqs; 38 fvec_t *triangle_heights, *fft_freqs; 37 39 38 40 uint_t fn; /* filter counter */ 39 41 uint_t bin; /* bin counter */ 42 43 smpl_t riseInc, downInc; 40 44 41 45 /* freqs define the bands of triangular overlapping windows. … … 57 61 58 62 /* convenience reference to lower/center/upper frequency for each triangle */ 59 fvec_t *lower_freqs = new_fvec (n_filters);60 fvec_t *upper_freqs = new_fvec (n_filters);61 fvec_t *center_freqs = new_fvec (n_filters);63 lower_freqs = new_fvec (n_filters); 64 upper_freqs = new_fvec (n_filters); 65 center_freqs = new_fvec (n_filters); 62 66 63 67 /* height of each triangle */ 64 fvec_t *triangle_heights = new_fvec (n_filters);68 triangle_heights = new_fvec (n_filters); 65 69 66 70 /* lookup table of each bin frequency in hz */ 67 f vec_t *fft_freqs = new_fvec (win_s);71 fft_freqs = new_fvec (win_s); 68 72 69 73 /* fill up the lower/center/upper */ … … 113 117 114 118 /* compute positive slope step size */ 115 smpl_triseInc =119 riseInc = 116 120 triangle_heights->data[fn] / 117 121 (center_freqs->data[fn] - lower_freqs->data[fn]); … … 129 133 130 134 /* compute negative slope step size */ 131 smpl_tdownInc =135 downInc = 132 136 triangle_heights->data[fn] / 133 137 (upper_freqs->data[fn] - center_freqs->data[fn]); … … 177 181 uint_t fn; /* filter counter */ 178 182 183 smpl_t lastlinearCF; 184 179 185 /* buffers to compute filter frequencies */ 180 186 fvec_t *freqs = new_fvec (n_filters + 2); … … 184 190 freqs->data[fn] = lowestFrequency + fn * linearSpacing; 185 191 } 186 smpl_tlastlinearCF = freqs->data[fn - 1];192 lastlinearCF = freqs->data[fn - 1]; 187 193 188 194 /* second step: fill all the log filter frequencies */
Note: See TracChangeset
for help on using the changeset viewer.