Python and audio frequency analysis

M

manatlan

I'd like to make a kind of "spectrum analyzer" ...
Which should display "bars" according bands of frequencies ... in real
time...

Is anybody know an audio processing lib in python for that ?
 
P

Pierre-Alain Dorange

manatlan said:
I'd like to make a kind of "spectrum analyzer" ...
Which should display "bars" according bands of frequencies ... in real
time...

Is anybody know an audio processing lib in python for that ?

For the display module you can use pygame, pyglet or pyOpenGL, there are
fast.

For the audio analysis i thought the module must be written in C or
something very fast, because python, due to it's nature, would probably
not compute spectrum as fast as real time : 44100 samples per seconds is
a lot of work...
 
D

David Cournapeau

I'd like to make a kind of "spectrum analyzer" ...
Which should display "bars" according bands of frequencies ... in real
time...

Is anybody know an audio processing lib in python for that ?

Hi,

It is possible to use python for audio processing: I am doing in PhD
in audio signal processing, and I mostly use python for my research:
audio file IO, relatively advanced processing, display. You will need
scientific packages to do the processing: numpy at minimum, to give
you an array class ala matlab, for fast vector operations, and scipy
to give you more tools (filtering, multi-dimensional fft, etc...).

Now, it may not be usable depending on your application: if you know
matlab, and your application is doable in matlab, it is doable in
python + numpy/scipy. You can see an example of real-time spectrogram
with the whole scientific python stack here:

http://code.enthought.com/projects/chaco/gallery.php (last example at
the bottom)

But it may not work out depending on what you mean by real-time: if
you use the term precisely, in its computer-science meaning
(time-bound process), then it will be difficult if not impossible, by
the very nature of python. You need a very precise control of
resources in that context, which python does not give.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top