<p>To compute a Fourier transform in NumPy or SciPy, use <code>fft</code>:</p>
<p>To compute a Fourier transform in NumPy or SciPy, use <a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.fftpack.fft.html#scipy.fftpack.fft"><code>scipy.fft</code></a>:</p>
<p>Musical signals are highly non-stationary, i.e., their statistics change over time. It would be rather meaningless to compute a spectrum over an entire 10-minute song.</p>
<p>Instead, we compute a spectrum for small frames of the audio signal. The resulting sequence of spectra is called a <code>spectrogram</code>.</p>
<p>Instead, we compute a spectrum for small frames of the audio signal. The resulting sequence of spectra is called a <a href="https://en.wikipedia.org/wiki/Spectrogram"><em>spectrogram</em></a>.</p>
<p>Matplotlib has <code>specgram</code> which computes and displays a spectrogram:</p>
<p>Matplotlib has <a href="http://matplotlib.org/api/mlab_api.html#matplotlib.mlab.specgram"><code>specgram</code></a> which computes and displays a spectrogram:</p>
<p><code>librosa</code> has some outstanding spectral representations, including <a href="http://bmcfee.github.io/librosa/librosa.html#librosa.feature.melspectrogram"><code>librosa.feature.melspectrogram</code></a>:</p>
<p><code>librosa</code> has some outstanding spectral representations, including <a href="http://bmcfee.github.io/librosa/generated/librosa.feature.melspectrogram.html#librosa.feature.melspectrogram"><code>librosa.feature.melspectrogram</code></a>:</p>