Changeset b155ed03
- Timestamp:
- Dec 17, 2013, 4:42:20 PM (11 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- ad76ce2
- Parents:
- aa033c2
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/vecutils.c
raa033c2 rb155ed03 15 15 } 16 16 17 #define AUBIO_OP_C_AND_F(OPNAME, OP) \ 18 AUBIO_OP(OPNAME, OP, fvec, data) \ 19 AUBIO_OP(norm ## _ ## OPNAME, OP, cvec, norm) \ 20 AUBIO_OP(phas ## _ ## OPNAME, OP, cvec, phas) 17 #define AUBIO_OP_C(OPNAME, OP) \ 18 AUBIO_OP(OPNAME, OP, fvec, data) 21 19 22 AUBIO_OP_C _AND_F(exp, EXP)23 AUBIO_OP_C _AND_F(cos, COS)24 AUBIO_OP_C _AND_F(sin, SIN)25 AUBIO_OP_C _AND_F(abs, ABS)26 AUBIO_OP_C _AND_F(sqrt, SQRT)27 AUBIO_OP_C _AND_F(log10, SAFE_LOG10)28 AUBIO_OP_C _AND_F(log, SAFE_LOG)29 AUBIO_OP_C _AND_F(floor, FLOOR)30 AUBIO_OP_C _AND_F(ceil, CEIL)31 AUBIO_OP_C _AND_F(round, ROUND)20 AUBIO_OP_C(exp, EXP) 21 AUBIO_OP_C(cos, COS) 22 AUBIO_OP_C(sin, SIN) 23 AUBIO_OP_C(abs, ABS) 24 AUBIO_OP_C(sqrt, SQRT) 25 AUBIO_OP_C(log10, SAFE_LOG10) 26 AUBIO_OP_C(log, SAFE_LOG) 27 AUBIO_OP_C(floor, FLOOR) 28 AUBIO_OP_C(ceil, CEIL) 29 AUBIO_OP_C(round, ROUND) 32 30 33 //AUBIO_OP_C_AND_F(pow, POW)34 31 void fvec_pow (fvec_t *s, smpl_t power) 35 32 { … … 39 36 } 40 37 } 41 42 void cvec_pow (cvec_t *s, smpl_t power)43 {44 uint_t j;45 for (j = 0; j < s->length; j++) {46 s->norm[j] = POW(s->norm[j], power);47 }48 }49 -
src/vecutils.h
raa033c2 rb155ed03 21 21 /** \file 22 22 23 Utility functions for ::fvec_t and ::cvec_t objects23 Utility functions for ::fvec_t 24 24 25 25 */ … … 110 110 void fvec_pow (fvec_t *s, smpl_t pow); 111 111 112 /** compute \f$e^x\f$ of each vector norm elements113 114 \param s vector to modify115 116 */117 void cvec_norm_exp (cvec_t *s);118 119 /** compute \f$cos(x)\f$ of each vector norm elements120 121 \param s vector to modify122 123 */124 void cvec_norm_cos (cvec_t *s);125 126 /** compute \f$sin(x)\f$ of each vector norm elements127 128 \param s vector to modify129 130 */131 void cvec_norm_sin (cvec_t *s);132 133 /** compute the \f$abs(x)\f$ of each vector norm elements134 135 \param s vector to modify136 137 */138 void cvec_norm_abs (cvec_t *s);139 140 /** compute the \f$sqrt(x)\f$ of each vector norm elements141 142 \param s vector to modify143 144 */145 void cvec_norm_sqrt (cvec_t *s);146 147 /** compute the \f$log10(x)\f$ of each vector norm elements148 149 \param s vector to modify150 151 */152 void cvec_norm_log10 (cvec_t *s);153 154 /** compute the \f$log(x)\f$ of each vector norm elements155 156 \param s vector to modify157 158 */159 void cvec_norm_log (cvec_t *s);160 161 /** compute the \f$floor(x)\f$ of each vector norm elements162 163 \param s vector to modify164 165 */166 void cvec_norm_floor (cvec_t *s);167 168 /** compute the \f$ceil(x)\f$ of each vector norm elements169 170 \param s vector to modify171 172 */173 void cvec_norm_ceil (cvec_t *s);174 175 /** compute the \f$round(x)\f$ of each vector norm elements176 177 \param s vector to modify178 179 */180 void cvec_norm_round (cvec_t *s);181 182 /** raise each vector norm elements to the power pow183 184 \param s vector to modify185 \param pow power to raise to186 187 */188 void cvec_norm_pow (cvec_t *s, smpl_t pow);189 190 /** compute \f$e^x\f$ of each vector phas elements191 192 \param s vector to modify193 194 */195 void cvec_phas_exp (cvec_t *s);196 197 /** compute \f$cos(x)\f$ of each vector phas elements198 199 \param s vector to modify200 201 */202 void cvec_phas_cos (cvec_t *s);203 204 /** compute \f$sin(x)\f$ of each vector phas elements205 206 \param s vector to modify207 208 */209 void cvec_phas_sin (cvec_t *s);210 211 /** compute the \f$abs(x)\f$ of each vector phas elements212 213 \param s vector to modify214 215 */216 void cvec_phas_abs (cvec_t *s);217 218 /** compute the \f$sqrt(x)\f$ of each vector phas elements219 220 \param s vector to modify221 222 */223 void cvec_phas_sqrt (cvec_t *s);224 225 /** compute the \f$log10(x)\f$ of each vector phas elements226 227 \param s vector to modify228 229 */230 void cvec_phas_log10 (cvec_t *s);231 232 /** compute the \f$log(x)\f$ of each vector phas elements233 234 \param s vector to modify235 236 */237 void cvec_phas_log (cvec_t *s);238 239 /** compute the \f$floor(x)\f$ of each vector phas elements240 241 \param s vector to modify242 243 */244 void cvec_phas_floor (cvec_t *s);245 246 /** compute the \f$ceil(x)\f$ of each vector phas elements247 248 \param s vector to modify249 250 */251 void cvec_phas_ceil (cvec_t *s);252 253 /** compute the \f$round(x)\f$ of each vector phas elements254 255 \param s vector to modify256 257 */258 void cvec_phas_round (cvec_t *s);259 260 /** raise each vector phas elements to the power pow261 262 \param s vector to modify263 \param pow power to raise to264 265 */266 void cvec_phas_pow (cvec_t *s, smpl_t pow);267 268 112 #ifdef __cplusplus 269 113 }
Note: See TracChangeset
for help on using the changeset viewer.