- Timestamp:
- Nov 4, 2007, 4:44:54 PM (17 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:
- 3c707f7
- Parents:
- 274839f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hist.c
r274839f r812b376 31 31 uint_t nelems; 32 32 uint_t channels; 33 smpl_t * cent;33 fvec_t * cent; 34 34 aubio_scale_t *scaler; 35 35 }; … … 46 46 s->nelems = nelems; 47 47 s->hist = new_fvec(nelems, channels); 48 s->cent = AUBIO_ARRAY(smpl_t, nelems);48 s->cent = new_fvec(nelems, 1); 49 49 50 50 /* use scale to map ilow/ihig -> 0/nelems */ 51 51 s->scaler = new_aubio_scale(ilow,ihig,0,nelems); 52 52 /* calculate centers now once */ 53 s->cent [0] = ilow + 0.5 * step;53 s->cent->data[0][0] = ilow + 0.5 * step; 54 54 for (i=1; i < s->nelems; i++, accum+=step ) 55 s->cent [i] = s->cent[0] + accum;55 s->cent->data[0][i] = s->cent->data[0][0] + accum; 56 56 57 57 return s; … … 60 60 void del_aubio_hist(aubio_hist_t *s) { 61 61 del_fvec(s->hist); 62 AUBIO_FREE(s->cent);62 del_fvec(s->cent); 63 63 del_aubio_scale(s->scaler); 64 64 AUBIO_FREE(s); … … 121 121 122 122 /* recalculate centers */ 123 s->cent [0] = ilow + 0.5f * step;123 s->cent->data[0][0] = ilow + 0.5f * step; 124 124 for (i=1; i < s->nelems; i++) 125 s->cent [i] = s->cent[0] + i * step;125 s->cent->data[0][i] = s->cent->data[0][0] + i * step; 126 126 127 127 /* scale */ … … 149 149 for (i=0; i < s->channels; i++) 150 150 for (j=0; j < s->nelems; j++) { 151 s->hist->data[i][j] *= s->cent [j];151 s->hist->data[i][j] *= s->cent->data[0][j]; 152 152 } 153 153 }
Note: See TracChangeset
for help on using the changeset viewer.