Changeset 569b363 for python/ext/py-fft.c
- Timestamp:
- Apr 24, 2016, 6:23:14 PM (8 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:
- 51b9c83
- Parents:
- a35db12
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/py-fft.c
ra35db12 r569b363 8 8 aubio_fft_t * o; 9 9 uint_t win_s; 10 fvec_t *vecin; 10 // do / rdo input vectors 11 fvec_t vecin; 12 cvec_t cvecin; 13 // do / rdo output results 11 14 cvec_t *out; 15 fvec_t *rout; 16 // bridge for cvec output 12 17 Py_cvec *py_out; 13 cvec_t *cvecin;14 fvec_t *rout;15 18 } Py_fft; 16 19 … … 57 60 } 58 61 59 self->cvecin = (cvec_t *)malloc(sizeof(cvec_t));60 self->vecin = (fvec_t *)malloc(sizeof(fvec_t));61 62 62 self->out = new_cvec(self->win_s); 63 63 self->py_out = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType); … … 75 75 del_cvec(self->out); 76 76 del_fvec(self->rout); 77 free(self->cvecin);78 free(self->vecin);79 77 Py_TYPE(self)->tp_free((PyObject *) self); 80 78 } … … 89 87 } 90 88 91 if (!PyAubio_ArrayToCFvec(input, self->vecin)) {89 if (!PyAubio_ArrayToCFvec(input, &(self->vecin))) { 92 90 return NULL; 93 91 } 94 92 95 93 // compute the function 96 aubio_fft_do (((Py_fft *)self)->o, self->vecin, self->out);94 aubio_fft_do (((Py_fft *)self)->o, &(self->vecin), self->out); 97 95 #if 0 98 96 Py_cvec * py_out = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType); … … 120 118 } 121 119 122 if (!PyAubio_ArrayToCCvec (input, self->cvecin) ) {120 if (!PyAubio_ArrayToCCvec (input, &(self->cvecin)) ) { 123 121 return NULL; 124 122 } 125 123 126 124 // compute the function 127 aubio_fft_rdo (self->o, self->cvecin, self->rout);125 aubio_fft_rdo (self->o, &(self->cvecin), self->rout); 128 126 return PyAubio_CFvecToArray(self->rout); 129 127 }
Note: See TracChangeset
for help on using the changeset viewer.