source: src/vecutils.h @ 47eabeb

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

src/vecutils.{c,h}: expand header and add documentation, add cvec_pow, fix SAFE_LOG macros

  • Property mode set to 100644
File size: 3.5 KB
Line 
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/** compute \f$e^x\f$ of each vector elements
34
35  \param s vector to modify
36
37*/
38void fvec_exp (fvec_t *s);
39
40/** compute \f$cos(x)\f$ of each vector elements
41
42  \param s vector to modify
43
44*/
45void fvec_cos (fvec_t *s);
46
47/** compute \f$sin(x)\f$ of each vector elements
48
49  \param s vector to modify
50
51*/
52void fvec_sin (fvec_t *s);
53
54/** compute the \f$abs(x)\f$ of each vector elements
55
56  \param s vector to modify
57
58*/
59void fvec_abs (fvec_t *s);
60
61/** compute the \f$sqrt(x)\f$ of each vector elements
62
63  \param s vector to modify
64
65*/
66void fvec_sqrt (fvec_t *s);
67
68/** compute the \f$log10(x)\f$ of each vector elements
69
70  \param s vector to modify
71
72*/
73void fvec_log10 (fvec_t *s);
74
75/** compute the \f$log(x)\f$ of each vector elements
76
77  \param s vector to modify
78
79*/
80void fvec_log (fvec_t *s);
81
82/** compute the \f$floor(x)\f$ of each vector elements
83
84  \param s vector to modify
85
86*/
87void fvec_floor (fvec_t *s);
88
89/** compute the \f$ceil(x)\f$ of each vector elements
90
91  \param s vector to modify
92
93*/
94void fvec_ceil (fvec_t *s);
95
96/** compute the \f$round(x)\f$ of each vector elements
97
98  \param s vector to modify
99
100*/
101void fvec_round (fvec_t *s);
102
103/** raise each vector elements to the power pow
104
105  \param s vector to modify
106  \param pow power to raise to
107
108*/
109void fvec_pow (fvec_t *s, smpl_t pow);
110
111/** compute \f$e^x\f$ of each vector norm elements
112
113  \param s vector to modify
114
115*/
116void cvec_exp (cvec_t *s);
117
118/** compute \f$cos(x)\f$ of each vector norm elements
119
120  \param s vector to modify
121
122*/
123void cvec_cos (cvec_t *s);
124
125/** compute \f$sin(x)\f$ of each vector norm elements
126
127  \param s vector to modify
128
129*/
130void cvec_sin (cvec_t *s);
131
132/** compute the \f$abs(x)\f$ of each vector norm elements
133
134  \param s vector to modify
135
136*/
137void cvec_abs (cvec_t *s);
138
139/** compute the \f$sqrt(x)\f$ of each vector norm elements
140
141  \param s vector to modify
142
143*/
144void cvec_sqrt (cvec_t *s);
145
146/** compute the \f$log10(x)\f$ of each vector norm elements
147
148  \param s vector to modify
149
150*/
151void cvec_log10 (cvec_t *s);
152
153/** compute the \f$log(x)\f$ of each vector norm elements
154
155  \param s vector to modify
156
157*/
158void cvec_log (cvec_t *s);
159
160/** compute the \f$floor(x)\f$ of each vector norm elements
161
162  \param s vector to modify
163
164*/
165void cvec_floor (cvec_t *s);
166
167/** compute the \f$ceil(x)\f$ of each vector norm elements
168
169  \param s vector to modify
170
171*/
172void cvec_ceil (cvec_t *s);
173
174/** compute the \f$round(x)\f$ of each vector norm elements
175
176  \param s vector to modify
177
178*/
179void cvec_round (cvec_t *s);
180
181/** raise each vector norm elements to the power pow
182
183  \param s vector to modify
184  \param pow power to raise to
185
186*/
187void cvec_pow (cvec_t *s, smpl_t pow);
188
189#ifdef __cplusplus
190}
191#endif
192
193#endif /*_VECUTILS_H*/
Note: See TracBrowser for help on using the repository browser.