Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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