Changeset 5d10ac1 for src/cvec.h


Ignore:
Timestamp:
Dec 17, 2013, 5:11:35 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
c34336e
Parents:
b0ab6ef
Message:

src/cvec.h: clean up cvec api

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/cvec.h

    rb0ab6ef r5d10ac1  
    2828/** \file
    2929
    30   Vector of complex-valued data
     30  Vector of complex-valued data, stored in polar coordinates
    3131
    3232  This file specifies the ::cvec_t buffer type, which is used throughout aubio
    3333  to store complex data. Complex values are stored in terms of ::cvec_t.phas
    34   and norm, within size/2+1 long vectors of ::smpl_t.
     34  and norm, within 2 vectors of ::smpl_t of size (size/2+1) each.
    3535
    3636  \example test-cvec.c
     
    3838*/
    3939
    40 /** Buffer for complex data
     40/** Vector of real-valued phase and spectrum data
    4141
    4242  \code
     
    7979*/
    8080cvec_t * new_cvec(uint_t length);
     81
    8182/** cvec_t buffer deletion function
    8283
     
    8586*/
    8687void del_cvec(cvec_t *s);
     88
    8789/** write norm value in a complex buffer
    8890
    89   Note that this function is not used in the aubio library, since the same
    90   result can be obtained by assigning vec->norm[position]. Its purpose
    91   is to access these values from wrappers, as created by swig.
     91  This is equivalent to:
     92  \code
     93  s->norm[position] = val;
     94  \endcode
    9295
    9396  \param s vector to write to
    94   \param data norm value to write in s->norm[position]
     97  \param val norm value to write in s->norm[position]
    9598  \param position sample position to write to
    9699
    97100*/
    98 void cvec_write_norm(cvec_t *s, smpl_t data, uint_t position);
     101void cvec_norm_set_sample (cvec_t *s, smpl_t val, uint_t position);
     102
    99103/** write phase value in a complex buffer
    100104
    101   Note that this function is not used in the aubio library, since the same
    102   result can be obtained by assigning vec->phas[position]. Its purpose
    103   is to access these values from wrappers, as created by swig.
     105  This is equivalent to:
     106  \code
     107  s->phas[position] = val;
     108  \endcode
    104109
    105110  \param s vector to write to
    106   \param data phase value to write in s->phas[position]
     111  \param val phase value to write in s->phas[position]
    107112  \param position sample position to write to
    108113
    109114*/
    110 void cvec_write_phas(cvec_t *s, smpl_t data, uint_t position);
     115void cvec_phas_set_sample (cvec_t *s, smpl_t val, uint_t position);
     116
    111117/** read norm value from a complex buffer
    112118
    113   Note that this function is not used in the aubio library, since the same
    114   result can be obtained with vec->norm[position]. Its purpose is to
    115   access these values from wrappers, as created by swig.
     119  This is equivalent to:
     120  \code
     121  smpl_t foo = s->norm[position];
     122  \endcode
    116123
    117124  \param s vector to read from
     
    119126
    120127*/
    121 smpl_t cvec_read_norm(cvec_t *s, uint_t position);
     128smpl_t cvec_norm_get_sample (cvec_t *s, uint_t position);
     129
    122130/** read phase value from a complex buffer
    123131
    124   Note that this function is not used in the aubio library, since the same
    125   result can be obtained with vec->phas[position]. Its purpose is to
    126   access these values from wrappers, as created by swig.
     132  This is equivalent to:
     133  \code
     134  smpl_t foo = s->phas[position];
     135  \endcode
    127136
    128137  \param s vector to read from
    129138  \param position sample position to read from
    130 
    131 */
    132 smpl_t cvec_read_phas(cvec_t *s, uint_t position);
     139  \returns the value of the sample at position
     140
     141*/
     142smpl_t cvec_phas_get_sample (cvec_t *s, uint_t position);
     143
    133144/** read norm data from a complex buffer
    134145
    135   Note that this function is not used in the aubio library, since the same
    136   result can be obtained with vec->norm. Its purpose is to access these values
    137   from wrappers, as created by swig.
    138 
    139   \param s vector to read from
    140 
    141 */
    142 smpl_t * cvec_get_norm(cvec_t *s);
     146  \code
     147  smpl_t *data = s->norm;
     148  \endcode
     149
     150  \param s vector to read from
     151
     152*/
     153smpl_t * cvec_norm_get_data (cvec_t *s);
     154
    143155/** read phase data from a complex buffer
    144156
    145   Note that this function is not used in the aubio library, since the same
    146   result can be obtained with vec->phas. Its purpose is to access these values
    147   from wrappers, as created by swig.
    148 
    149   \param s vector to read from
    150 
    151 */
    152 smpl_t * cvec_get_phas(cvec_t *s);
     157  This is equivalent to:
     158  \code
     159  smpl_t *data = s->phas;
     160  \endcode
     161
     162  \param s vector to read from
     163
     164*/
     165smpl_t * cvec_phas_get_data (cvec_t *s);
    153166
    154167/** print out cvec data
     
    173186
    174187*/
    175 void cvec_set_all_norm(cvec_t *s, smpl_t val);
     188void cvec_norm_set_all (cvec_t *s, smpl_t val);
    176189
    177190/** set all norm elements to zero
     
    180193
    181194*/
    182 void cvec_zeros_norm(cvec_t *s);
     195void cvec_norm_zeros(cvec_t *s);
    183196
    184197/** set all norm elements to one
     
    187200
    188201*/
    189 void cvec_ones_norm(cvec_t *s);
     202void cvec_norm_ones(cvec_t *s);
    190203
    191204/** set all phase elements to a given value
     
    195208
    196209*/
    197 void cvec_set_all_phas(cvec_t *s, smpl_t val);
     210void cvec_phas_set_all (cvec_t *s, smpl_t val);
    198211
    199212/** set all phase elements to zero
     
    202215
    203216*/
    204 void cvec_zeros_phas(cvec_t *s);
     217void cvec_phas_zeros(cvec_t *s);
    205218
    206219/** set all phase elements to one
     
    209222
    210223*/
    211 void cvec_ones_phas(cvec_t *s);
     224void cvec_phas_ones(cvec_t *s);
    212225
    213226/** set all norm and phas elements to zero
Note: See TracChangeset for help on using the changeset viewer.