source: src/vecutils.h @ 916f8983

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

src/vecutils.{c,h}: add a bunch of function to modify fvec and cvec, defined with some magic macros

  • Property mode set to 100644
File size: 1.6 KB
RevLine 
[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
30extern "C" {
31#endif
32
33#define AUBIO_OP_PROTO(OPNAME, TYPE) \
34void 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
40AUBIO_OP_C_AND_F_PROTO(exp)
41AUBIO_OP_C_AND_F_PROTO(cos)
42AUBIO_OP_C_AND_F_PROTO(sin)
43AUBIO_OP_C_AND_F_PROTO(abs)
44//AUBIO_OP_C_AND_F_PROTO(pow)
45AUBIO_OP_C_AND_F_PROTO(sqrt)
46AUBIO_OP_C_AND_F_PROTO(log10)
47AUBIO_OP_C_AND_F_PROTO(log)
48AUBIO_OP_C_AND_F_PROTO(floor)
49AUBIO_OP_C_AND_F_PROTO(ceil)
50AUBIO_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*/
58void 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*/
Note: See TracBrowser for help on using the repository browser.