Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mathutils.c

    r33d0242 rb799241  
    290290}
    291291
     292void fvec_push(fvec_t *in, smpl_t new_elem) {
     293  uint_t i;
     294  for (i = 0; i < in->length - 1; i++) {
     295    in->data[i] = in->data[i + 1];
     296  }
     297  in->data[in->length - 1] = new_elem;
     298}
     299
     300void fvec_clamp(fvec_t *in, smpl_t absmax) {
     301  uint_t i;
     302  for (i = 0; i < in->length; i++) {
     303    if (in->data[i] > 0 && in->data[i] > ABS(absmax)) {
     304      in->data[i] = absmax;
     305    } else if (in->data[i] < 0 && in->data[i] < -ABS(absmax)) {
     306      in->data[i] = -absmax;
     307    }
     308  }
     309}
     310
    292311smpl_t
    293312aubio_level_lin (const fvec_t * f)
Note: See TracChangeset for help on using the changeset viewer.