Skip to content

Instantly share code, notes, and snippets.

@dmastropole
Created October 14, 2019 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmastropole/816afeba659e81c70143afc3460b484e to your computer and use it in GitHub Desktop.
Save dmastropole/816afeba659e81c70143afc3460b484e to your computer and use it in GitHub Desktop.
Mel Scale
# Define function for computing mels
def mel_formula(f):
return 2595 * np.log(1 + f/700)
# Frequency range
f_low = 40
f_high = 44100 / 2 # Nyquist frequency
f = np.linspace(f_low, f_high)
# Plot relationship between frequency and mels
plt.plot(f, mel_formula(f))
plt.title('Mel vs. Frequency')
plt.xlabel('Frequency (Hz)')
plt.ylabel('Mel Scale')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment