How to extract frequency information from an input audio stream (using PortAudio)?

后端 未结 2 604
慢半拍i
慢半拍i 2021-02-04 22:42

I want to record sound (voice) using PortAudio (PyAudio) and output the corresponding sound wave on the screen. Hopeless as I am, I am unable to extract the frequency informatio

相关标签:
2条回答
  • 2021-02-04 23:15

    What you want is probably the Fourier transform of the audio data. There is several packages that can calculate that for you. scipy and numpy is two of them. It is often named "Fast Fourier Transform" (FFT), but that is just the name of the algorithm.

    Here is an example of it's usage: https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/advanced/spectrum.py

    0 讨论(0)
  • 2021-02-04 23:19

    The Fourier Transform will not help you a lot if you want the analysis to be conducted in both the frequency and time domain. You might want to have a look at "Wavelet Transforms". There is a package called pywavelets... http://www.pybytes.com/pywavelets/#discrete-wavelet-transform-dwt

    0 讨论(0)
提交回复
热议问题