I need to find or create a tool that analyzes the audio spectrum of a sound file (like a .wav or .mp3). I need to output the "volume" or power of x number of frequency bands and output the data as text. This will be used to produce a visualization, a graphic equalizer like you'd see on a stereo.

I am currently looking at python to do it. My question is are there some tools out there that would do this (signal processing), like math works or others? I don't have any experience with them so any advice would be appreciated.

  • Start with an Internet Search for "Audio spectral analysis python". – Robert Harvey Dec 16 '12 at 6:51

Similar to Robert Harvey's comment, you'll want to look for a Fast Fourier Transform with python.

There is an SO question that discusses the output from one of the algorithms and how to interpret it.

Here's the numpy module which came up second in my search. So it looks like you shouldn't need to do much coding at all.

This link will point you to some other implementations.

And here's a wordpress blog that provides some background on the FFT as well as using the numpy module.

And as jk points out: "you may need a Window Function as well to smooth out spectral leakage."

| improve this answer | |
  • 1
    you may need a en.wikipedia.org/wiki/Window_function as well to smooth out spectral leakage – jk. Dec 17 '12 at 14:56
  • @jk. - good point, and I've updated my answer accordingly. Thanks! – user53019 Dec 17 '12 at 15:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.