Changeset 6481c0c for src


Ignore:
Timestamp:
Sep 29, 2009, 7:58:43 PM (15 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:
a54502c
Parents:
78d14d4
Message:

src/temporal/filter.c: fix aubio_filter_do and aubio_filter_do_outplace

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/temporal/filter.c

    r78d14d4 r6481c0c  
    3737};
    3838
    39 void aubio_filter_do(aubio_filter_t * f, fvec_t * in) {
    40   aubio_filter_do_outplace(f, in, in);
     39void aubio_filter_do_outplace(aubio_filter_t * f, fvec_t * in, fvec_t * out) {
     40  fvec_copy(in, out);
     41  aubio_filter_do (f, out);
    4142}
    4243
    43 void aubio_filter_do_outplace(aubio_filter_t * f, fvec_t * in, fvec_t * out) {
     44void aubio_filter_do(aubio_filter_t * f, fvec_t * in) {
    4445  uint_t i,j,l, order = f->order;
    4546  lsmp_t *x;
     
    5354    for (j = 0; j < in->length; j++) {
    5455      /* new input */
    55       if (IS_DENORMAL(in->data[i][j])) {
    56         x[0] = y[0] = 0.;
    57       } else {
    58         x[0] = in->data[i][j];
    59         y[0] = b[0] * x[0];
    60         for (l=1;l<order; l++) {
    61           y[0] += b[l] * x[l];
    62           y[0] -= a[l] * y[l];
    63         }
     56      x[0] = KILL_DENORMAL(in->data[i][j]);
     57      y[0] = b[0] * x[0];
     58      for (l=1;l<order; l++) {
     59        y[0] += b[l] * x[l];
     60        y[0] -= a[l] * y[l];
    6461      }
    6562      /* new output */
    66       out->data[i][j] = y[0];
     63      in->data[i][j] = y[0];
    6764      /* store for next sample */
    6865      for (l=order-1; l>0; l--){
Note: See TracChangeset for help on using the changeset viewer.