FFT for Spectrograms in Python

Loading WAV files is easy using audiolab:

from audiolab import wavread
signal, fs, enc = wavread('test.wav')

or for reading any general audio format and converting to WAV:

from audiolab import Sndfile
sound_file = Sndfile('test.w64', 'r')
signal = wave_file.read_frames(wave_file.nframes)

The spectrogram is built into PyLab:

from pylab import *
specgram(signal)

Specifically, it's part of matplotlib. Here's a better example.


Python's wave library will let you import the audio. After that, you can use numpy to take an FFT of the audio.

Then, matplotlib makes very nice charts and graphs - absolutely comparable to MATLAB.

It's old as dirt, but this article would probably get you started on almost exactly the problem you're describing (article in Python of course).