Changeset 95a64c7
- Timestamp:
- Sep 12, 2007, 7:23:35 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:
- bc4ba75
- Parents:
- 787f1f3
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/filterbank.c
r787f1f3 r95a64c7 181 181 182 182 //buffers for computing filter frequencies 183 fvec_t * freqs=new_fvec( allFilters+2 , 1);183 fvec_t * freqs=new_fvec(allFilters+2 , 1); 184 184 185 185 fvec_t * lower_freqs=new_fvec( allFilters, 1); 186 186 fvec_t * upper_freqs=new_fvec( allFilters, 1); 187 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*/; 188 192 189 193 190 fvec_t * triangle_heights=new_fvec( allFilters, 1); … … 197 194 uint_t filter_cnt, bin_cnt; 198 195 199 //first : filling all the linear filter frequencies196 //first step: filling all the linear filter frequencies 200 197 for(filter_cnt=0; filter_cnt<linearFilters; filter_cnt++){ 201 198 freqs->data[0][filter_cnt]=lowestFrequency+ filter_cnt*linearSpacing; … … 203 200 smpl_t lastlinearCF=freqs->data[0][filter_cnt-1]; 204 201 205 //second : filling all the log filter frequencies202 //second step: filling all the log filter frequencies 206 203 for(filter_cnt=0; filter_cnt<logFilters+2; filter_cnt++){ 207 204 freqs->data[0][filter_cnt+linearFilters]=lastlinearCF*(pow(logSpacing,filter_cnt+1)); 208 205 } 209 210 211 //make fvec->data point directly to freqs arrays 212 lower_freqs->data=freqs->data; 213 center_freqs->data[0]=&(freqs->data[0][1]); 214 upper_freqs->data[0]=&(freqs->data[0][2]); 215 216 206 207 //Option 1. copying interesting values to lower_freqs, center_freqs and upper freqs arrays 208 //TODO: would be nicer to have a reference to freqs->data, anyway we do not care in this init step 209 210 for(filter_cnt=0; filter_cnt<allFilters; filter_cnt++){ 211 lower_freqs->data[0][filter_cnt]=freqs->data[0][filter_cnt]; 212 center_freqs->data[0][filter_cnt]=freqs->data[0][filter_cnt+1]; 213 upper_freqs->data[0][filter_cnt]=freqs->data[0][filter_cnt+2]; 214 } 215 216 217 217 //computing triangle heights so that each triangle has unit area 218 218 for(filter_cnt=0; filter_cnt<allFilters; filter_cnt++){ 219 219 triangle_heights->data[0][filter_cnt]=2./(upper_freqs->data[0][filter_cnt]-lower_freqs->data[0][filter_cnt]); 220 220 } 221 221 222 222 223 //AUBIO_DBG 223 224 AUBIO_DBG("filter tables frequencies\n"); … … 300 301 301 302 303 302 304 del_fvec(freqs); 303 //TODO: Check how to do a proper free for the following f_vec 304 305 //del_fvec(lower_freqs); 306 //del_fvec(upper_freqs); 307 //del_fvec(center_freqs); 305 del_fvec(lower_freqs); 306 del_fvec(upper_freqs); 307 del_fvec(center_freqs); 308 308 309 del_fvec(triangle_heights); 309 310 del_fvec(fft_freqs); 310 311 312 311 313 312 return fb; -
src/sample.c
r787f1f3 r95a64c7 20 20 #include "aubio_priv.h" 21 21 #include "sample.h" 22 22 23 23 24 fvec_t * new_fvec( uint_t length, uint_t channels) {
Note: See TracChangeset
for help on using the changeset viewer.