Changeset 6940b55 for src


Ignore:
Timestamp:
Sep 28, 2009, 9:27:10 PM (15 years ago)
Author:
Paul Brossier <piem@piem.org>
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:
d90db7d4
Parents:
d37400c
Message:

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

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/vecutils.c

    rd37400c r6940b55  
    2626AUBIO_OP_C_AND_F(abs, ABS)
    2727AUBIO_OP_C_AND_F(sqrt, SQRT)
    28 AUBIO_OP_C_AND_F(log10, SAFELOG10)
    29 AUBIO_OP_C_AND_F(log, SAFELOG)
     28AUBIO_OP_C_AND_F(log10, SAFE_LOG10)
     29AUBIO_OP_C_AND_F(log, SAFE_LOG)
    3030AUBIO_OP_C_AND_F(floor, FLOOR)
    3131AUBIO_OP_C_AND_F(ceil, CEIL)
     
    4343}
    4444
     45void cvec_pow (cvec_t *s, smpl_t power)
     46{
     47  uint_t i,j;
     48  for (i = 0; i < s->channels; i++) {
     49    for (j = 0; j < s->length; j++) {
     50      s->norm[i][j] = POW(s->norm[i][j], power);
     51    }
     52  }
     53}
     54
  • src/vecutils.h

    rd37400c r6940b55  
    3131#endif
    3232
    33 #define AUBIO_OP_PROTO(OPNAME, TYPE) \
    34 void TYPE ## _ ## OPNAME (TYPE ## _t *o);
     33/** compute \f$e^x\f$ of each vector elements
    3534
    36 #define AUBIO_OP_C_AND_F_PROTO(OPNAME) \
    37   AUBIO_OP_PROTO(OPNAME, fvec) \
    38   AUBIO_OP_PROTO(OPNAME, cvec)
     35  \param s vector to modify
    3936
    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)
     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);
    51102
    52103/** raise each vector elements to the power pow
     
    58109void fvec_pow (fvec_t *s, smpl_t pow);
    59110
    60 //void fvec_log10 (fvec_t *s);
     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);
    61188
    62189#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.