Ignore:
Timestamp:
Dec 5, 2009, 1:44:11 AM (15 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:
0f045b2
Parents:
7a7b00f
Message:

interfaces/python: towards mono

File:
1 edited

Legend:

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

    r7a7b00f r96fe713  
    33static char Py_fft_doc[] = "fft object";
    44
    5 AUBIO_DECLARE(fft, uint_t win_s; uint_t channels)
     5AUBIO_DECLARE(fft, uint_t win_s)
    66
    77//AUBIO_NEW(fft)
     
    99Py_fft_new (PyTypeObject * type, PyObject * args, PyObject * kwds)
    1010{
    11   int win_s = 0, channels = 0;
     11  int win_s = 0;
    1212  Py_fft *self;
    13   static char *kwlist[] = { "win_s", "channels", NULL };
     13  static char *kwlist[] = { "win_s", NULL };
    1414
    15   if (!PyArg_ParseTupleAndKeywords (args, kwds, "|II", kwlist,
    16           &win_s, &channels)) {
     15  if (!PyArg_ParseTupleAndKeywords (args, kwds, "|I", kwlist,
     16          &win_s)) {
    1717    return NULL;
    1818  }
     
    2525
    2626  self->win_s = Py_default_vector_length;
    27   self->channels = Py_default_vector_channels;
    2827
    2928  if (self == NULL) {
     
    3938  }
    4039
    41   if (channels > 0) {
    42     self->channels = channels;
    43   } else if (channels < 0) {
    44     PyErr_SetString (PyExc_ValueError,
    45         "can not use negative number of filters");
    46     return NULL;
    47   }
    48 
    4940  return (PyObject *) self;
    5041}
    5142
    5243
    53 AUBIO_INIT(fft, self->win_s, self->channels)
     44AUBIO_INIT(fft, self->win_s)
    5445
    5546AUBIO_DEL(fft)
     
    7364
    7465  output = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType);
    75   output->channels = vec->channels;
    7666  output->length = ((Py_fft *) self)->win_s;
    77   output->o = new_cvec(((Py_fft *) self)->win_s, vec->channels);
     67  output->o = new_cvec(((Py_fft *) self)->win_s);
    7868
    7969  // compute the function
     
    8777  {"win_s", T_INT, offsetof (Py_fft, win_s), READONLY,
    8878    "size of the window"},
    89   {"channels", T_INT, offsetof (Py_fft, channels), READONLY,
    90     "number of channels"},
    9179AUBIO_MEMBERS_STOP(fft)
    9280
     
    10997
    11098  output = (Py_fvec*) PyObject_New (Py_fvec, &Py_fvecType);
    111   output->channels = vec->channels;
    11299  output->length = ((Py_fft *) self)->win_s;
    113   output->o = new_fvec(output->length, output->channels);
     100  output->o = new_fvec(output->length);
    114101
    115102  // compute the function
Note: See TracChangeset for help on using the changeset viewer.