FFT的频谱图在Python
我怎么会去使用Python来读取从WAV PCM文件的频率峰值,然后才能产生它的一个形象,频谱图分析?
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?
我试图做一个程序,它可以读取任何音频文件,将其转换为WAV PCM,然后找到高峰和频率截止。
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.
Python的波库会让你进口音频。之后,你可以使用numpy的走音的FFT 。
Python's wave library will let you import the audio. After that, you can use numpy to take an FFT of the audio.
然后, matplotlib 使得非常漂亮的图表和图形 - 绝对媲美MATLAB
Then, matplotlib makes very nice charts and graphs - absolutely comparable to MATLAB.
这是旧如粪土,但这篇文章很可能让你开始几乎正是问题你所描述的(当然,在Python的文章)。
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).