import librosa import matplotlib.pyplot as plt import numpy as np
x, sr = librosa.load("rosie.mp3", sr=44100) S = librosa.stft(x) plt.imshow(np.abs(S)[::-1, :], aspect='auto', cmap='magma_r')
<matplotlib.image.AxesImage at 0x7fbd0a84de20>