Changes in src/cvec.h [f72364d:66fb3ea]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/cvec.h ¶
rf72364d r66fb3ea 28 28 /** \file 29 29 30 Vector of complex-valued data30 Complex buffers 31 31 32 This file specifies the ::cvec_t buffer type, which is used throughout aubio 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. 35 36 \example test-cvec.c 32 This file specifies the cvec_t buffer type, which is used throughout aubio to 33 store complex data. Complex values are stored in terms of phase and 34 norm, within size/2+1 long vectors. 37 35 38 36 */ 39 37 40 /** Buffer for complex data 41 42 \code 43 44 uint_t buffer_size = 1024; 45 46 // create a complex vector of 512 values 47 cvec_t * input = new_cvec (buffer_size); 48 49 // set some values of the vector 50 input->norm[23] = 2.; 51 input->phas[23] = M_PI; 52 // .. 53 54 // compute the mean of the vector 55 mean = cvec_mean(input); 56 57 // destroy the vector 58 del_cvec (input); 59 60 \endcode 61 62 */ 38 /** Buffer for complex data */ 63 39 typedef struct { 64 uint_t length; /**< length of buffer = (requested length)/2 + 1 */65 smpl_t *norm; /**< norm array of size ::cvec_t.length*/66 smpl_t *phas; /**< phase array of size ::cvec_t.length*/40 uint_t length; /**< length of buffer = (requested length)/2 + 1 */ 41 smpl_t *norm; /**< norm array of size [length] */ 42 smpl_t *phas; /**< phase array of size [length] */ 67 43 } cvec_t; 68 44 … … 72 48 [length/2+1], corresponding to the norm and phase values of the 73 49 spectral frame. The length stored in the structure is the actual size of both 74 arrays, not the length of the complex and sym metrical vector, specified as50 arrays, not the length of the complex and symetrical vector, specified as 75 51 creation argument. 76 52 … … 91 67 is to access these values from wrappers, as created by swig. 92 68 93 \param s vector to write to 69 \param s vector to write to 94 70 \param data norm value to write in s->norm[position] 95 71 \param position sample position to write to … … 152 128 smpl_t * cvec_get_phas(cvec_t *s); 153 129 154 /** print out cvec data 130 /** print out cvec data 155 131 156 \param s vector to print out 132 \param s vector to print out 157 133 158 134 */ … … 167 143 void cvec_set(cvec_t *s, smpl_t val); 168 144 169 /** set all elements to zero 145 /** set all elements to zero 170 146 171 147 \param s vector to modify … … 174 150 void cvec_zeros(cvec_t *s); 175 151 176 /** set all elements to ones 152 /** set all elements to ones 177 153 178 154 \param s vector to modify
Note: See TracChangeset
for help on using the changeset viewer.