Changeset 831f702 for src


Ignore:
Timestamp:
Nov 17, 2018, 12:22:59 PM (10 months ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master
Children:
78706cd
Parents:
6b46a4e
Message:

[filterbank] check norm in set_triangle_bands

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/spectral/filterbank_mel.c

    r6b46a4e r831f702  
    9191
    9292  /* compute triangle heights so that each triangle has unit area */
    93   for (fn = 0; fn < n_filters; fn++) {
    94     triangle_heights->data[fn] =
    95         2. / (upper_freqs->data[fn] - lower_freqs->data[fn]);
     93  if (aubio_filterbank_get_norm(fb)) {
     94    for (fn = 0; fn < n_filters; fn++) {
     95      triangle_heights->data[fn] =
     96          2. / (upper_freqs->data[fn] - lower_freqs->data[fn]);
     97    }
     98  } else {
     99    fvec_ones (triangle_heights);
    96100  }
    97101
     
    118122
    119123    /* compute positive slope step size */
    120     riseInc =
    121         triangle_heights->data[fn] /
    122         (center_freqs->data[fn] - lower_freqs->data[fn]);
     124    riseInc = triangle_heights->data[fn]
     125      / (center_freqs->data[fn] - lower_freqs->data[fn]);
    123126
    124127    /* compute coefficients in positive slope */
     
    134137
    135138    /* compute negative slope step size */
    136     downInc =
    137         triangle_heights->data[fn] /
    138         (upper_freqs->data[fn] - center_freqs->data[fn]);
     139    downInc = triangle_heights->data[fn]
     140      / (upper_freqs->data[fn] - center_freqs->data[fn]);
    139141
    140142    /* compute coefficents in negative slope */
Note: See TracChangeset for help on using the changeset viewer.