source: src/vecutils.c @ 1f4d932

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 1f4d932 was b155ed03, checked in by Paul Brossier <piem@piem.org>, 11 years ago

src/vecutils.*: remove cvec functions for clarity

  • Property mode set to 100644
File size: 749 bytes
RevLine 
[916f8983]1#include "config.h"
[83963b3]2#include "aubio_priv.h"
[916f8983]3#include "types.h"
4#include "fvec.h"
5#include "cvec.h"
6#include "vecutils.h"
7
8#define AUBIO_OP(OPNAME, OP, TYPE, OBJ) \
9void TYPE ## _ ## OPNAME (TYPE ## _t *o) \
10{ \
[c17a0ee]11  uint_t j; \
12  for (j = 0; j < o->length; j++) { \
13    o->OBJ[j] = OP (o->OBJ[j]); \
[916f8983]14  } \
15}
16
[b155ed03]17#define AUBIO_OP_C(OPNAME, OP) \
18  AUBIO_OP(OPNAME, OP, fvec, data)
[916f8983]19
[b155ed03]20AUBIO_OP_C(exp, EXP)
21AUBIO_OP_C(cos, COS)
22AUBIO_OP_C(sin, SIN)
23AUBIO_OP_C(abs, ABS)
24AUBIO_OP_C(sqrt, SQRT)
25AUBIO_OP_C(log10, SAFE_LOG10)
26AUBIO_OP_C(log, SAFE_LOG)
27AUBIO_OP_C(floor, FLOOR)
28AUBIO_OP_C(ceil, CEIL)
29AUBIO_OP_C(round, ROUND)
[916f8983]30
31void fvec_pow (fvec_t *s, smpl_t power)
32{
[c17a0ee]33  uint_t j;
34  for (j = 0; j < s->length; j++) {
35    s->data[j] = POW(s->data[j], power);
[916f8983]36  }
37}
Note: See TracBrowser for help on using the repository browser.