Changes in src/cvec.h [39a7b26:5d10ac1]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/cvec.h
r39a7b26 r5d10ac1 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 19 19 */ 20 20 21 #ifndef _ CVEC_H22 #define _ CVEC_H21 #ifndef _AUBIO__CVEC_H 22 #define _AUBIO__CVEC_H 23 23 24 24 #ifdef __cplusplus … … 28 28 /** \file 29 29 30 Vector of complex-valued data 30 Vector of complex-valued data, stored in polar coordinates 31 31 32 32 This file specifies the ::cvec_t buffer type, which is used throughout aubio 33 33 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. 35 35 36 36 \example test-cvec.c … … 38 38 */ 39 39 40 /** Buffer for complexdata40 /** Vector of real-valued phase and spectrum data 41 41 42 42 \code … … 79 79 */ 80 80 cvec_t * new_cvec(uint_t length); 81 81 82 /** cvec_t buffer deletion function 82 83 … … 85 86 */ 86 87 void del_cvec(cvec_t *s); 88 87 89 /** write norm value in a complex buffer 88 90 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 92 95 93 96 \param s vector to write to 94 \param datanorm value to write in s->norm[position]97 \param val norm value to write in s->norm[position] 95 98 \param position sample position to write to 96 99 97 100 */ 98 void cvec_write_norm(cvec_t *s, smpl_t data, uint_t position); 101 void cvec_norm_set_sample (cvec_t *s, smpl_t val, uint_t position); 102 99 103 /** write phase value in a complex buffer 100 104 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 104 109 105 110 \param s vector to write to 106 \param dataphase value to write in s->phas[position]111 \param val phase value to write in s->phas[position] 107 112 \param position sample position to write to 108 113 109 114 */ 110 void cvec_write_phas(cvec_t *s, smpl_t data, uint_t position); 115 void cvec_phas_set_sample (cvec_t *s, smpl_t val, uint_t position); 116 111 117 /** read norm value from a complex buffer 112 118 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 116 123 117 124 \param s vector to read from … … 119 126 120 127 */ 121 smpl_t cvec_read_norm(cvec_t *s, uint_t position); 128 smpl_t cvec_norm_get_sample (cvec_t *s, uint_t position); 129 122 130 /** read phase value from a complex buffer 123 131 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 127 136 128 137 \param s vector to read from 129 138 \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 */ 142 smpl_t cvec_phas_get_sample (cvec_t *s, uint_t position); 143 133 144 /** read norm data from a complex buffer 134 145 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 */ 153 smpl_t * cvec_norm_get_data (cvec_t *s); 154 143 155 /** read phase data from a complex buffer 144 156 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 */ 165 smpl_t * cvec_phas_get_data (cvec_t *s); 153 166 154 167 /** print out cvec data … … 173 186 174 187 */ 175 void cvec_ set_all_norm(cvec_t *s, smpl_t val);188 void cvec_norm_set_all (cvec_t *s, smpl_t val); 176 189 177 190 /** set all norm elements to zero … … 180 193 181 194 */ 182 void cvec_ zeros_norm(cvec_t *s);195 void cvec_norm_zeros(cvec_t *s); 183 196 184 197 /** set all norm elements to one … … 187 200 188 201 */ 189 void cvec_ ones_norm(cvec_t *s);202 void cvec_norm_ones(cvec_t *s); 190 203 191 204 /** set all phase elements to a given value … … 195 208 196 209 */ 197 void cvec_ set_all_phas(cvec_t *s, smpl_t val);210 void cvec_phas_set_all (cvec_t *s, smpl_t val); 198 211 199 212 /** set all phase elements to zero … … 202 215 203 216 */ 204 void cvec_ zeros_phas(cvec_t *s);217 void cvec_phas_zeros(cvec_t *s); 205 218 206 219 /** set all phase elements to one … … 209 222 210 223 */ 211 void cvec_ ones_phas(cvec_t *s);224 void cvec_phas_ones(cvec_t *s); 212 225 213 226 /** set all norm and phas elements to zero … … 222 235 #endif 223 236 224 #endif /* _CVEC_H */ 225 237 #endif /* _AUBIO__CVEC_H */
Note: See TracChangeset
for help on using the changeset viewer.