Changeset 1120f86
- Timestamp:
- Apr 21, 2016, 6:21:43 PM (9 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:
- ae5d58a
- Parents:
- c4d251c
- Location:
- src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/cvec.c
rc4d251c r1120f86 22 22 #include "cvec.h" 23 23 24 cvec_t * new_cvec( 24 cvec_t * new_cvec(uint_t length) { 25 25 cvec_t * s; 26 26 if ((sint_t)length <= 0) { … … 56 56 } 57 57 58 smpl_t * cvec_norm_get_data (c vec_t *s) {58 smpl_t * cvec_norm_get_data (const cvec_t *s) { 59 59 return s->norm; 60 60 } 61 61 62 smpl_t * cvec_phas_get_data (c vec_t *s) {62 smpl_t * cvec_phas_get_data (const cvec_t *s) { 63 63 return s->phas; 64 64 } … … 66 66 /* helper functions */ 67 67 68 void cvec_print(c vec_t *s) {68 void cvec_print(const cvec_t *s) { 69 69 uint_t j; 70 70 AUBIO_MSG("norm: "); … … 80 80 } 81 81 82 void cvec_copy(c vec_t *s, cvec_t *t) {82 void cvec_copy(const cvec_t *s, cvec_t *t) { 83 83 if (s->length != t->length) { 84 84 AUBIO_ERR("trying to copy %d elements to %d elements \n", -
src/cvec.h
rc4d251c r1120f86 151 151 152 152 */ 153 smpl_t * cvec_norm_get_data (c vec_t *s);153 smpl_t * cvec_norm_get_data (const cvec_t *s); 154 154 155 155 /** read phase data from a complex buffer … … 163 163 164 164 */ 165 smpl_t * cvec_phas_get_data (c vec_t *s);165 smpl_t * cvec_phas_get_data (const cvec_t *s); 166 166 167 167 /** print out cvec data … … 170 170 171 171 */ 172 void cvec_print(c vec_t *s);172 void cvec_print(const cvec_t *s); 173 173 174 174 /** make a copy of a vector … … 178 178 179 179 */ 180 void cvec_copy(c vec_t *s, cvec_t *t);180 void cvec_copy(const cvec_t *s, cvec_t *t); 181 181 182 182 /** set all norm elements to a given value -
src/fmat.c
rc4d251c r1120f86 54 54 } 55 55 56 smpl_t fmat_get_sample( fmat_t *s, uint_t channel, uint_t position) {56 smpl_t fmat_get_sample(const fmat_t *s, uint_t channel, uint_t position) { 57 57 return s->data[channel][position]; 58 58 } 59 59 60 void fmat_get_channel( fmat_t *s, uint_t channel, fvec_t *output) {60 void fmat_get_channel(const fmat_t *s, uint_t channel, fvec_t *output) { 61 61 output->data = s->data[channel]; 62 62 output->length = s->length; … … 64 64 } 65 65 66 smpl_t * fmat_get_channel_data( fmat_t *s, uint_t channel) {66 smpl_t * fmat_get_channel_data(const fmat_t *s, uint_t channel) { 67 67 return s->data[channel]; 68 68 } 69 69 70 smpl_t ** fmat_get_data( fmat_t *s) {70 smpl_t ** fmat_get_data(const fmat_t *s) { 71 71 return s->data; 72 72 } … … 74 74 /* helper functions */ 75 75 76 void fmat_print( fmat_t *s) {76 void fmat_print(const fmat_t *s) { 77 77 uint_t i,j; 78 78 for (i=0; i< s->height; i++) { … … 117 117 } 118 118 119 void fmat_weight(fmat_t *s, fmat_t *weight) {119 void fmat_weight(fmat_t *s, const fmat_t *weight) { 120 120 uint_t i,j; 121 121 uint_t length = MIN(s->length, weight->length); … … 127 127 } 128 128 129 void fmat_copy( fmat_t *s, fmat_t *t) {129 void fmat_copy(const fmat_t *s, fmat_t *t) { 130 130 uint_t i; 131 131 #if !HAVE_MEMCPY_HACKS … … 155 155 } 156 156 157 void fmat_vecmul( fmat_t *s,fvec_t *scale, fvec_t *output) {157 void fmat_vecmul(const fmat_t *s, const fvec_t *scale, fvec_t *output) { 158 158 uint_t k; 159 159 #if 0 -
src/fmat.h
rc4d251c r1120f86 66 66 67 67 */ 68 smpl_t fmat_get_sample( fmat_t *s, uint_t channel, uint_t position);68 smpl_t fmat_get_sample(const fmat_t *s, uint_t channel, uint_t position); 69 69 70 70 /** write sample value in a buffer … … 85 85 86 86 */ 87 void fmat_get_channel ( fmat_t *s, uint_t channel, fvec_t *output);87 void fmat_get_channel (const fmat_t *s, uint_t channel, fvec_t *output); 88 88 89 89 /** get vector buffer from an fmat data … … 93 93 94 94 */ 95 smpl_t * fmat_get_channel_data ( fmat_t *s, uint_t channel);95 smpl_t * fmat_get_channel_data (const fmat_t *s, uint_t channel); 96 96 97 97 /** read data from a buffer … … 100 100 101 101 */ 102 smpl_t ** fmat_get_data( fmat_t *s);102 smpl_t ** fmat_get_data(const fmat_t *s); 103 103 104 104 /** print out fmat data … … 107 107 108 108 */ 109 void fmat_print( fmat_t *s);109 void fmat_print(const fmat_t *s); 110 110 111 111 /** set all elements to a given value … … 147 147 148 148 */ 149 void fmat_weight(fmat_t *s, fmat_t *weight);149 void fmat_weight(fmat_t *s, const fmat_t *weight); 150 150 151 151 /** make a copy of a matrix … … 155 155 156 156 */ 157 void fmat_copy( fmat_t *s, fmat_t *t);157 void fmat_copy(const fmat_t *s, fmat_t *t); 158 158 159 159 /* compute the product of a matrix by a vector … … 164 164 165 165 */ 166 void fmat_vecmul( fmat_t *s,fvec_t *scale, fvec_t *output);166 void fmat_vecmul(const fmat_t *s, const fvec_t *scale, fvec_t *output); 167 167 168 168 #ifdef __cplusplus -
src/fvec.c
rc4d251c r1120f86 22 22 #include "fvec.h" 23 23 24 fvec_t * new_fvec( 24 fvec_t * new_fvec(uint_t length) { 25 25 fvec_t * s; 26 26 if ((sint_t)length <= 0) { … … 42 42 } 43 43 44 smpl_t fvec_get_sample( fvec_t *s, uint_t position) {44 smpl_t fvec_get_sample(const fvec_t *s, uint_t position) { 45 45 return s->data[position]; 46 46 } 47 47 48 smpl_t * fvec_get_data( fvec_t *s) {48 smpl_t * fvec_get_data(const fvec_t *s) { 49 49 return s->data; 50 50 } … … 52 52 /* helper functions */ 53 53 54 void fvec_print( fvec_t *s) {54 void fvec_print(const fvec_t *s) { 55 55 uint_t j; 56 56 for (j=0; j< s->length; j++) { … … 96 96 } 97 97 98 void fvec_weight(fvec_t *s, fvec_t *weight) {98 void fvec_weight(fvec_t *s, const fvec_t *weight) { 99 99 #ifndef HAVE_ACCELERATE 100 100 uint_t j; … … 108 108 } 109 109 110 void fvec_weighted_copy( fvec_t *in,fvec_t *weight, fvec_t *out) {110 void fvec_weighted_copy(const fvec_t *in, const fvec_t *weight, fvec_t *out) { 111 111 #ifndef HAVE_ACCELERATE 112 112 uint_t j; … … 120 120 } 121 121 122 void fvec_copy( fvec_t *s, fvec_t *t) {122 void fvec_copy(const fvec_t *s, fvec_t *t) { 123 123 if (s->length != t->length) { 124 124 AUBIO_ERR("trying to copy %d elements to %d elements \n", -
src/fvec.h
rc4d251c r1120f86 90 90 91 91 */ 92 smpl_t fvec_get_sample( fvec_t *s, uint_t position);92 smpl_t fvec_get_sample(const fvec_t *s, uint_t position); 93 93 94 94 /** write sample value in a buffer … … 106 106 107 107 */ 108 smpl_t * fvec_get_data( fvec_t *s);108 smpl_t * fvec_get_data(const fvec_t *s); 109 109 110 110 /** print out fvec data … … 113 113 114 114 */ 115 void fvec_print( fvec_t *s);115 void fvec_print(const fvec_t *s); 116 116 117 117 /** set all elements to a given value … … 153 153 154 154 */ 155 void fvec_weight(fvec_t *s, fvec_t *weight);155 void fvec_weight(fvec_t *s, const fvec_t *weight); 156 156 157 157 /** make a copy of a vector … … 161 161 162 162 */ 163 void fvec_copy( fvec_t *s, fvec_t *t);163 void fvec_copy(const fvec_t *s, fvec_t *t); 164 164 165 165 /** make a copy of a vector, applying weights to each element … … 170 170 171 171 */ 172 void fvec_weighted_copy( fvec_t *in,fvec_t *weight, fvec_t *out);172 void fvec_weighted_copy(const fvec_t *in, const fvec_t *weight, fvec_t *out); 173 173 174 174 #ifdef __cplusplus -
src/lvec.c
rc4d251c r1120f86 22 22 #include "lvec.h" 23 23 24 lvec_t * new_lvec( 24 lvec_t * new_lvec(uint_t length) { 25 25 lvec_t * s; 26 26 if ((sint_t)length <= 0) { … … 46 46 } 47 47 48 lsmp_t * lvec_get_data( lvec_t *s) {48 lsmp_t * lvec_get_data(const lvec_t *s) { 49 49 return s->data; 50 50 } … … 52 52 /* helper functions */ 53 53 54 void lvec_print( lvec_t *s) {54 void lvec_print(const lvec_t *s) { 55 55 uint_t j; 56 56 for (j=0; j< s->length; j++) { -
src/lvec.h
rc4d251c r1120f86 81 81 82 82 */ 83 lsmp_t * lvec_get_data( lvec_t *s);83 lsmp_t * lvec_get_data(const lvec_t *s); 84 84 85 85 /** print out lvec data … … 88 88 89 89 */ 90 void lvec_print( lvec_t *s);90 void lvec_print(const lvec_t *s); 91 91 92 92 /** set all elements to a given value
Note: See TracChangeset
for help on using the changeset viewer.