FFT for Spectrograms in Python

Eugene Bulkin picture Eugene Bulkin · Aug 20, 2009 · Viewed 34.2k times · Source

How would I go about using Python to read the frequency peaks from a WAV PCM file and then be able to generate an image of it, for spectogram analysis?

I'm trying to make a program that allows you to read any audio file, converting it to WAV PCM, and then finding the peaks and frequency cutoffs.

Answer

Mark Rushakoff picture Mark Rushakoff · Aug 20, 2009

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).