Changeset 55ce41c


Ignore:
Timestamp:
Sep 8, 2007, 2:13:16 PM (17 years ago)
Author:
Paul Brossier <piem@piem.org>
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:
34d72f0
Parents:
f918cb9
Message:

filterbank.c: remove to be deleted code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/filterbank.c

    rf918cb9 r55ce41c  
    163163}
    164164
    165 //to be deleted code
    166 
    167 
    168 // int aubio_mfcc_init(int N, smpl_t nyquist, int style, smpl_t freq_min, smpl_t freq_max, int freq_bands, smpl_t **fft_tables){
    169 //
    170 //     int n, i, k, *fft_peak, M, next_peak;
    171 //     smpl_t norm, mel_freq_max, mel_freq_min, norm_fact, height, inc, val,
    172 //         freq_bw_mel, *mel_peak, *height_norm, *lin_peak;
    173 //
    174 //     mel_peak = height_norm = lin_peak = NULL;
    175 //     fft_peak = NULL;
    176 //     norm = 1;
    177 //
    178 //     mel_freq_max = 1127 * log(1 + freq_max / 700);
    179 //     mel_freq_min = 1127 * log(1 + freq_min / 700);
    180 //     freq_bw_mel = (mel_freq_max - mel_freq_min) / freq_bands;
    181 //
    182 //     mel_peak = (smpl_t *)malloc((freq_bands + 2) * sizeof(smpl_t));
    183 //     /* +2 for zeros at start and end */
    184 //     lin_peak = (smpl_t *)malloc((freq_bands + 2) * sizeof(smpl_t));
    185 //     fft_peak = (int *)malloc((freq_bands + 2) * sizeof(int));
    186 //     height_norm = (smpl_t *)malloc(freq_bands * sizeof(smpl_t));
    187 //
    188 //     if(mel_peak == NULL || height_norm == NULL ||
    189 //                     lin_peak == NULL || fft_peak == NULL)
    190 //                     return XTRACT_MALLOC_FAILED;
    191 //     
    192 //     M = N >> 1;
    193 //
    194 //     mel_peak[0] = mel_freq_min;
    195 //     lin_peak[0] = 700 * (exp(mel_peak[0] / 1127) - 1);
    196 //     fft_peak[0] = lin_peak[0] / nyquist * M;
    197 //
    198 //
    199 //     for (n = 1; n <= freq_bands; n++){ 
    200 //     /*roll out peak locations - mel, linear and linear on fft window scale */
    201 //         mel_peak[n] = mel_peak[n - 1] + freq_bw_mel;
    202 //         lin_peak[n] = 700 * (exp(mel_peak[n] / 1127) -1);
    203 //         fft_peak[n] = lin_peak[n] / nyquist * M;
    204 //     }
    205 //
    206 //     for (n = 0; n < freq_bands; n++){
    207 //         /*roll out normalised gain of each peak*/
    208 //         if (style == XTRACT_EQUAL_GAIN){
    209 //             height = 1;
    210 //             norm_fact = norm;
    211 //         }
    212 //         else{
    213 //             height = 2 / (lin_peak[n + 2] - lin_peak[n]);
    214 //             norm_fact = norm / (2 / (lin_peak[2] - lin_peak[0]));
    215 //         }
    216 //         height_norm[n] = height * norm_fact;
    217 //     }
    218 //
    219 //     i = 0;
    220 //   
    221 //     for(n = 0; n < freq_bands; n++){
    222 //   
    223 //   /*calculate the rise increment*/
    224 //         if(n > 0)
    225 //             inc = height_norm[n] / (fft_peak[n] - fft_peak[n - 1]);
    226 //         else
    227 //             inc = height_norm[n] / fft_peak[n];
    228 //         val = 0; 
    229 //   
    230 //   /*zero the start of the array*/
    231 //   for(k = 0; k < i; k++)
    232 //      fft_tables[n][k] = 0.f;
    233 //   
    234 //   /*fill in the rise */
    235 //         for(; i <= fft_peak[n]; i++){
    236 //             fft_tables[n][i] = val;
    237 //             val += inc;
    238 //         }
    239 //   
    240 //         /*calculate the fall increment */
    241 //         inc = height_norm[n] / (fft_peak[n + 1] - fft_peak[n]);
    242 //   
    243 //         val = 0;
    244 //   next_peak = fft_peak[n + 1];
    245 //   
    246 //   /*reverse fill the 'fall' */
    247 //         for(i = next_peak; i > fft_peak[n]; i--){
    248 //             fft_tables[n][i] = val;
    249 //             val += inc;
    250 //         }
    251 //
    252 //   /*zero the rest of the array*/
    253 //   for(k = next_peak + 1; k < N; k++)
    254 //       fft_tables[n][k] = 0.f;
    255 //     }
    256 //
    257 //     free(mel_peak);
    258 //     free(lin_peak);
    259 //     free(height_norm);
    260 //     free(fft_peak);
    261 //
    262 //     return XTRACT_SUCCESS;
    263 //
    264 // }
Note: See TracChangeset for help on using the changeset viewer.