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