[916f8983] | 1 | /* |
---|
| 2 | Copyright (C) 2009 Paul Brossier <piem@aubio.org> |
---|
| 3 | |
---|
| 4 | This file is part of aubio. |
---|
| 5 | |
---|
| 6 | aubio is free software: you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation, either version 3 of the License, or |
---|
| 9 | (at your option) any later version. |
---|
| 10 | |
---|
| 11 | aubio is distributed in the hope that it will be useful, |
---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 14 | GNU General Public License for more details. |
---|
| 15 | |
---|
| 16 | You should have received a copy of the GNU General Public License |
---|
| 17 | along with aubio. If not, see <http://www.gnu.org/licenses/>. |
---|
| 18 | |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | /** @file |
---|
| 22 | * various utilities functions for fvec and cvec objects |
---|
| 23 | * |
---|
| 24 | */ |
---|
| 25 | |
---|
| 26 | #ifndef _VECUTILS_H |
---|
| 27 | #define _VECUTILS_H |
---|
| 28 | |
---|
| 29 | #ifdef __cplusplus |
---|
| 30 | extern "C" { |
---|
| 31 | #endif |
---|
| 32 | |
---|
| 33 | #define AUBIO_OP_PROTO(OPNAME, TYPE) \ |
---|
| 34 | void TYPE ## _ ## OPNAME (TYPE ## _t *o); |
---|
| 35 | |
---|
| 36 | #define AUBIO_OP_C_AND_F_PROTO(OPNAME) \ |
---|
| 37 | AUBIO_OP_PROTO(OPNAME, fvec) \ |
---|
| 38 | AUBIO_OP_PROTO(OPNAME, cvec) |
---|
| 39 | |
---|
| 40 | AUBIO_OP_C_AND_F_PROTO(exp) |
---|
| 41 | AUBIO_OP_C_AND_F_PROTO(cos) |
---|
| 42 | AUBIO_OP_C_AND_F_PROTO(sin) |
---|
| 43 | AUBIO_OP_C_AND_F_PROTO(abs) |
---|
| 44 | //AUBIO_OP_C_AND_F_PROTO(pow) |
---|
| 45 | AUBIO_OP_C_AND_F_PROTO(sqrt) |
---|
| 46 | AUBIO_OP_C_AND_F_PROTO(log10) |
---|
| 47 | AUBIO_OP_C_AND_F_PROTO(log) |
---|
| 48 | AUBIO_OP_C_AND_F_PROTO(floor) |
---|
| 49 | AUBIO_OP_C_AND_F_PROTO(ceil) |
---|
| 50 | AUBIO_OP_C_AND_F_PROTO(round) |
---|
| 51 | |
---|
| 52 | /** raise each vector elements to the power pow |
---|
| 53 | |
---|
| 54 | \param s vector to modify |
---|
| 55 | \param pow power to raise to |
---|
| 56 | |
---|
| 57 | */ |
---|
| 58 | void fvec_pow (fvec_t *s, smpl_t pow); |
---|
| 59 | |
---|
| 60 | //void fvec_log10 (fvec_t *s); |
---|
| 61 | |
---|
| 62 | #ifdef __cplusplus |
---|
| 63 | } |
---|
| 64 | #endif |
---|
| 65 | |
---|
| 66 | #endif /*_VECUTILS_H*/ |
---|