#include "aubio-types.h"
-static char Py_fft_doc[] = "fft object";
+static char Py_fft_doc[] = ""
+"fft(size=1024)\n"
+"\n"
+"Compute Fast Fourier Transorms.\n"
+"\n"
+"Parameters\n"
+"----------\n"
+"size : int\n"
+" size of the FFT to compute\n"
+"\n"
+"Example\n"
+"-------\n"
+">>> x = aubio.fvec(512)\n"
+">>> f = aubio.fft(512)\n"
+">>> c = f(x); c\n"
+"aubio cvec of 257 elements\n"
+">>> x2 = f.rdo(c); x2.shape\n"
+"(512,)\n"
+"";
typedef struct
{
{
self->o = new_aubio_fft (self->win_s);
if (self->o == NULL) {
- PyErr_Format(PyExc_RuntimeError,
- "error creating fft with win_s=%d "
- "(should be a power of 2 greater than 1; "
- "try recompiling aubio with --enable-fftw3)",
- self->win_s);
+ // PyErr_Format(PyExc_RuntimeError, ...) was set above by new_ which called
+ // AUBIO_ERR when failing
return -1;
}
Py_fft_do(Py_fft * self, PyObject * args)
{
PyObject *input;
+ cvec_t c_out;
if (!PyArg_ParseTuple (args, "O", &input)) {
return NULL;
return NULL;
}
- cvec_t c_out;
Py_INCREF(self->doout);
if (!PyAubio_PyCvecToCCvec(self->doout, &c_out)) {
return NULL;
Py_fft_rdo(Py_fft * self, PyObject * args)
{
PyObject *input;
+ fvec_t out;
if (!PyArg_ParseTuple (args, "O", &input)) {
return NULL;
return NULL;
}
- fvec_t out;
Py_INCREF(self->rdoout);
if (!PyAubio_ArrayToCFvec(self->rdoout, &out) ) {
return NULL;
(initproc) Py_fft_init,
0,
Py_fft_new,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
};