Changes in / [83d5abf:787f1f3]
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/aubiomfcc.c
r83d5abf r787f1f3 25 25 26 26 uint_t n_filters = 40; 27 uint_t n_coefs = 20;27 uint_t n_coefs = 11; 28 28 29 29 unsigned int pos = 0; /*frames%dspblocksize*/ -
src/filterbank.c
r83d5abf r787f1f3 182 182 //buffers for computing filter frequencies 183 183 fvec_t * freqs=new_fvec( allFilters +2 , 1); 184 184 185 fvec_t * lower_freqs=new_fvec( allFilters, 1); 185 186 fvec_t * upper_freqs=new_fvec( allFilters, 1); 186 187 fvec_t * center_freqs=new_fvec( allFilters, 1); 188 189 /*fvec_t * lower_freqs=freqs; 190 fvec_t * upper_freqs=freqs; 191 fvec_t * center_freqs=freqs*/; 192 187 193 fvec_t * triangle_heights=new_fvec( allFilters, 1); 188 194 //lookup table of each bin frequency in hz … … 203 209 204 210 205 // TODO: Check how these f_vec will be freed211 //make fvec->data point directly to freqs arrays 206 212 lower_freqs->data=freqs->data; 207 213 center_freqs->data[0]=&(freqs->data[0][1]); … … 214 220 } 215 221 216 // debug217 debug("filter tables frequencies\n");222 //AUBIO_DBG 223 AUBIO_DBG("filter tables frequencies\n"); 218 224 for(filter_cnt=0; filter_cnt<allFilters; filter_cnt++) 219 debug("filter n. %d %f %f %f %f\n",filter_cnt, lower_freqs->data[0][filter_cnt], center_freqs->data[0][filter_cnt], upper_freqs->data[0][filter_cnt], triangle_heights->data[0][filter_cnt]);225 AUBIO_DBG("filter n. %d %f %f %f %f\n",filter_cnt, lower_freqs->data[0][filter_cnt], center_freqs->data[0][filter_cnt], upper_freqs->data[0][filter_cnt], triangle_heights->data[0][filter_cnt]); 220 226 221 227 … … 240 246 241 247 //zeroing begining of filter 242 debug("\nfilter %d",filter_cnt);243 244 debug("\nzero begin\n");248 AUBIO_DBG("\nfilter %d",filter_cnt); 249 250 AUBIO_DBG("\nzero begin\n"); 245 251 246 252 for(bin_cnt=0; bin_cnt<win_s-1; bin_cnt++){ 247 253 //zeroing beigining of array 248 254 fb->filters[filter_cnt]->data[0][bin_cnt]=0.f; 249 debug(".");250 // debug("%f %f %f\n", fft_freqs->data[0][bin_cnt], fft_freqs->data[0][bin_cnt+1], lower_freqs->data[0][filter_cnt]);255 AUBIO_DBG("."); 256 //AUBIO_DBG("%f %f %f\n", fft_freqs->data[0][bin_cnt], fft_freqs->data[0][bin_cnt+1], lower_freqs->data[0][filter_cnt]); 251 257 if(fft_freqs->data[0][bin_cnt]<= lower_freqs->data[0][filter_cnt] && fft_freqs->data[0][bin_cnt+1]> lower_freqs->data[0][filter_cnt]){ 252 258 break; … … 255 261 bin_cnt++; 256 262 257 debug("\npos slope\n");263 AUBIO_DBG("\npos slope\n"); 258 264 //positive slope 259 265 for(; bin_cnt<win_s-1; bin_cnt++){ 260 debug(".");266 AUBIO_DBG("."); 261 267 fb->filters[filter_cnt]->data[0][bin_cnt]=(fft_freqs->data[0][bin_cnt]-lower_freqs->data[0][filter_cnt])*riseInc; 262 268 //if(fft_freqs->data[0][bin_cnt]<= center_freqs->data[0][filter_cnt] && fft_freqs->data[0][bin_cnt+1]> center_freqs->data[0][filter_cnt]) … … 266 272 //bin_cnt++; 267 273 268 //debug("\nneg slope\n");269 274 270 275 //negative slope 276 AUBIO_DBG("\nneg slope\n"); 271 277 for(; bin_cnt<win_s-1; bin_cnt++){ 272 // debug(".");278 //AUBIO_DBG("."); 273 279 274 280 //checking whether last value is less than 0... … … 285 291 //bin_cnt++; 286 292 287 //debug("\nzero end\n");293 AUBIO_DBG("\nzero end\n"); 288 294 //zeroing tail 289 295 for(; bin_cnt<win_s; bin_cnt++) 290 // debug(".");296 //AUBIO_DBG("."); 291 297 fb->filters[filter_cnt]->data[0][bin_cnt]=0.f; 292 298
Note: See TracChangeset
for help on using the changeset viewer.