Skip to content

Instantly share code, notes, and snippets.

@stesh
Created April 4, 2011 11:59
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 stesh/901524 to your computer and use it in GitHub Desktop.
Save stesh/901524 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
def mel(f)
include Math
(1000.quo(Math.log(2))) * Math.log(1 + (f.quo(1000)))
end
1.upto(1000) do |f|
puts "#{f} Hz --> #{mel(f).round(1)} mel"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment