Changeset 965b302 for interfaces
- Timestamp:
- Dec 25, 2009, 4:40:41 AM (15 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:
- c04d250
- Parents:
- 0178c65
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
interfaces/python/py-fft.c
r0178c65 r965b302 50 50 { 51 51 PyObject *input; 52 Py_fvec*vec;53 Py_cvec*output;52 fvec_t *vec; 53 cvec_t *output; 54 54 55 55 if (!PyArg_ParseTuple (args, "O", &input)) { … … 57 57 } 58 58 59 vec = PyAubio_ArrayTo Fvec (input);59 vec = PyAubio_ArrayToCFvec (input); 60 60 61 61 if (vec == NULL) { … … 63 63 } 64 64 65 output = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType); 66 output->length = ((Py_fft *) self)->win_s; 67 output->o = new_cvec(((Py_fft *) self)->win_s); 65 output = new_cvec(((Py_fft *) self)->win_s); 68 66 69 67 // compute the function 70 aubio_fft_do (((Py_fft *)self)->o, vec->o, output->o); 71 Py_INCREF(output); 72 return (PyObject *)output; 73 //return (PyObject *)PyAubio_CvecToArray(output); 68 aubio_fft_do (((Py_fft *)self)->o, vec, output); 69 return (PyObject *)PyAubio_CCvecToPyCvec(output); 74 70 } 75 71 … … 80 76 81 77 static PyObject * 82 Py_fft_rdo(Py Object * self, PyObject * args)78 Py_fft_rdo(Py_fft * self, PyObject * args) 83 79 { 84 80 PyObject *input; 85 Py_cvec*vec;86 Py_fvec*output;81 cvec_t *vec; 82 fvec_t *output; 87 83 88 84 if (!PyArg_ParseTuple (args, "O", &input)) { … … 90 86 } 91 87 92 vec = PyAubio_ArrayToC vec (input);88 vec = PyAubio_ArrayToCCvec (input); 93 89 94 90 if (vec == NULL) { … … 96 92 } 97 93 98 output = (Py_fvec*) PyObject_New (Py_fvec, &Py_fvecType); 99 output->length = ((Py_fft *) self)->win_s; 100 output->o = new_fvec(output->length); 94 output = new_fvec(self->win_s); 101 95 102 96 // compute the function 103 aubio_fft_rdo (((Py_fft *)self)->o, vec ->o, output->o);104 return (PyObject *)PyAubio_ FvecToArray(output);97 aubio_fft_rdo (((Py_fft *)self)->o, vec, output); 98 return (PyObject *)PyAubio_CFvecToArray(output); 105 99 } 106 100
Note: See TracChangeset
for help on using the changeset viewer.