9

I am looking for a Python package to perform an efficient Constant Q Transform (ie using an FFT to speed up the process). I found a toolbox named CQ-NSGT/sliCQ Toolbox, but I get the following error:

File "build\bdist.win32\egg\nsgt\__init__.py", line 37, in <module>
File "build\bdist.win32\egg\nsgt\audio.py", line 7, in <module>
File "C:\Python27\lib\site-packages\scikits\audiolab\__init__.py", line 25, in <module>
    from pysndfile import formatinfo, sndfile
File "C:\Python27\lib\site-packages\scikits\audiolab\pysndfile\__init__.py", line 1, in <module>
    from _sndfile import Sndfile, Format, available_file_formats, \
File "numpy.pxd", line 30, in scikits.audiolab.pysndfile._sndfile (scikits\audiolab\pysndfile\_sndfile.c:9632)
ValueError: numpy.dtype does not appear to be the correct type object

There seems to be a problem either with Numpy (which I doubt) or more likely with scikit audiolab. Do you know where the problem comes from?

askewchan
  • 45,161
  • 17
  • 118
  • 134
Flavian Hautbois
  • 2,940
  • 6
  • 28
  • 45
  • Is this error while you are trying to build the package? If so I can confirm that it builds and installs fine on XP with Python 2.7 – theta Apr 11 '13 at 19:44
  • The error occurs when I try the command 'import nsgt' or 'from nsgt import *'... – Flavian Hautbois Apr 11 '13 at 22:10
  • How did you install audiolab? I don't have any problems here: http://i.imgur.com/gems9V6.png – theta Apr 12 '13 at 09:25
  • 1
    I used this one: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikits.audiolab – Flavian Hautbois Apr 13 '13 at 11:22
  • Christoph's packages are God given, but not all are 100% portable across systems. I'd suggest you build stable `libsndfile` with MinGW and then build `audiolab` (from pypi). – theta Apr 13 '13 at 15:52
  • Additionally, as `audolab` is used just for reading data, maybe you can tweak `nsgt` source, to read just wav with `scipy.io` or similar, but I have no idea if this is more then trivial – theta Apr 13 '13 at 15:55
  • I'd check out compatibility of the versions of numpy, python and your library - I had similar messages when using obsolete numpy. For my audio tasks I just used FFT right from numpy and, but I had a very basic task. – Boris Burkov Jul 02 '13 at 20:32

3 Answers3

1

I use the CQT tools in yaafe: http://perso.telecom-paristech.fr/~essid/tp-yaafe-extension/features.html

John Seales
  • 424
  • 3
  • 11
0

Check out PYO, a C-implemented DSP module for python. Has mathematical operations on signals, should include Fourier transforms.

http://code.google.com/p/pyo/

Nayeem Zen
  • 2,569
  • 1
  • 17
  • 16
0

PyMIR has implementations of some audio and music processing routines, such as applying the FFT from NumPy to wav or mp3 data, or applying the CQT (Constant Q transform) or DCT (Discrete Cosine Transform, built using NumPy) to the same kind of audio data:

PyMIR is MIT licensed.

Jared Updike
  • 7,165
  • 8
  • 46
  • 72
  • I just saw the cqt implementation in PyMIT, and it is really not optimised (https://github.com/jsawruk/pymir/blob/master/pymir/Transforms.py#L56) – Labo Oct 15 '16 at 07:00