Changeset 965b302


Ignore:
Timestamp:
Dec 25, 2009, 4:40:41 AM (14 years ago)
Author:
Paul Brossier <piem@piem.org>
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
Message:

py-fft.c: use new proxy functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • interfaces/python/py-fft.c

    r0178c65 r965b302  
    5050{
    5151  PyObject *input;
    52   Py_fvec *vec;
    53   Py_cvec *output;
     52  fvec_t *vec;
     53  cvec_t *output;
    5454
    5555  if (!PyArg_ParseTuple (args, "O", &input)) {
     
    5757  }
    5858
    59   vec = PyAubio_ArrayToFvec (input);
     59  vec = PyAubio_ArrayToCFvec (input);
    6060
    6161  if (vec == NULL) {
     
    6363  }
    6464
    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);
    6866
    6967  // 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);
    7470}
    7571
     
    8076
    8177static PyObject *
    82 Py_fft_rdo(PyObject * self, PyObject * args)
     78Py_fft_rdo(Py_fft * self, PyObject * args)
    8379{
    8480  PyObject *input;
    85   Py_cvec *vec;
    86   Py_fvec *output;
     81  cvec_t *vec;
     82  fvec_t *output;
    8783
    8884  if (!PyArg_ParseTuple (args, "O", &input)) {
     
    9086  }
    9187
    92   vec = PyAubio_ArrayToCvec (input);
     88  vec = PyAubio_ArrayToCCvec (input);
    9389
    9490  if (vec == NULL) {
     
    9692  }
    9793
    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);
    10195
    10296  // 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);
    10599}
    106100
Note: See TracChangeset for help on using the changeset viewer.