Changeset 1da7e08 for src/cvec.c
- Timestamp:
- Nov 2, 2007, 12:25:42 PM (17 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:
- c721874
- Parents:
- 97525e4 (diff), 100f950 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/cvec.c
r97525e4 r1da7e08 1 1 /* 2 Copyright (C) 2003 Paul Brossier2 Copyright (C) 2003-2007 Paul Brossier <piem@piem.org> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 19 19 20 20 #include "aubio_priv.h" 21 #include "sample.h" 22 23 fvec_t * new_fvec( uint_t length, uint_t channels) { 24 fvec_t * s = AUBIO_NEW(fvec_t); 25 uint_t i,j; 26 s->channels = channels; 27 s->length = length; 28 s->data = AUBIO_ARRAY(smpl_t*,s->channels); 29 for (i=0; i< s->channels; i++) { 30 s->data[i] = AUBIO_ARRAY(smpl_t, s->length); 31 for (j=0; j< s->length; j++) { 32 s->data[i][j]=0.; 33 } 34 } 35 return s; 36 } 37 38 void del_fvec(fvec_t *s) { 39 uint_t i; 40 for (i=0; i<s->channels; i++) { 41 AUBIO_FREE(s->data[i]); 42 } 43 AUBIO_FREE(s->data); 44 AUBIO_FREE(s); 45 } 46 47 void fvec_write_sample(fvec_t *s, smpl_t data, uint_t channel, uint_t position) { 48 s->data[channel][position] = data; 49 } 50 smpl_t fvec_read_sample(fvec_t *s, uint_t channel, uint_t position) { 51 return s->data[channel][position]; 52 } 53 void fvec_put_channel(fvec_t *s, smpl_t * data, uint_t channel) { 54 s->data[channel] = data; 55 } 56 smpl_t * fvec_get_channel(fvec_t *s, uint_t channel) { 57 return s->data[channel]; 58 } 59 60 smpl_t ** fvec_get_data(fvec_t *s) { 61 return s->data; 62 } 21 #include "cvec.h" 63 22 64 23 cvec_t * new_cvec( uint_t length, uint_t channels) { … … 121 80 return s->phas; 122 81 } 82
Note: See TracChangeset
for help on using the changeset viewer.