Skip to content

Instantly share code, notes, and snippets.

@dmastropole
Last active October 16, 2019 23:50
Show Gist options
  • Save dmastropole/5710d24eb2828b25bfb27070099f24f7 to your computer and use it in GitHub Desktop.
Save dmastropole/5710d24eb2828b25bfb27070099f24f7 to your computer and use it in GitHub Desktop.
Power Spectrum
from essentia.standard import Windowing, PowerSpectrum
# Compute the spectrum of a frame
w = Windowing(type='hann')
spectrum = PowerSpectrum(size=1024)
frame = audio[0:1024]
spec = spectrum(w(frame))
# Plot the spectrum of a frame
plt.plot(spec)
plt.title("Spectrum")
plt.xlabel("Frequency (Hz)")
plt.ylabel("Power")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment