Changes in / [381a44e:bcc5387]


Ignore:
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/spectral/filterbank.c

    r381a44e rbcc5387  
    4343  /* allocate space for filterbank object */
    4444  aubio_filterbank_t *fb = AUBIO_NEW (aubio_filterbank_t);
     45
     46  if ((sint_t)n_filters <= 0) {
     47    AUBIO_ERR("filterbank: n_filters should be > 0, got %d\n", n_filters);
     48    goto fail;
     49  }
     50  if ((sint_t)win_s <= 0) {
     51    AUBIO_ERR("filterbank: win_s should be > 0, got %d\n", win_s);
     52    goto fail;
     53  }
    4554  fb->win_s = win_s;
    4655  fb->n_filters = n_filters;
     
    5463
    5564  return fb;
     65fail:
     66  AUBIO_FREE (fb);
     67  return NULL;
    5668}
    5769
  • tests/src/spectral/test-filterbank.c

    r381a44e rbcc5387  
    88  cvec_t *in_spec = new_cvec (win_s); // input vector of samples
    99  fvec_t *out_filters = new_fvec (n_filters); // per-band outputs
     10
     11  if (new_aubio_filterbank(0, win_s)) return 1;
     12  if (new_aubio_filterbank(n_filters, 0)) return 1;
    1013
    1114  // create filterbank object
Note: See TracChangeset for help on using the changeset viewer.