mel scale converter
Mel Scale Converter guide
The mel scale gives a frequency coordinate used in speech and audio analysis. Select the conversion direction before entering a value. This calculator uses the HTK logarithmic definition throughout the range and also reports the frequency difference corresponding to the next hundred mel above the selected point.
Play the instrument ↑- Default result
- 999.98554 mel
Calculation and units
For a frequency f in hertz, divide by 700, add one and take the base-ten logarithm. Multiply by 2595 to obtain mel. Going back, raise ten to the mel value divided by 2595, subtract one and multiply by 700. The additional interval comes from converting the current coordinate and the coordinate one hundred mel higher back to hertz.
Worked examples
Select a named case in the Worked example control to load these values. You can then edit any input to compare the result.
One kilohertz anchor
Conversion = Hertz to mel · Input value = 1000.
999.98554 mel. HTK logarithmic scale. 1000 Hz corresponds to 999.98554 mel. The next 100 mel span 157.73844 Hz from this point.
The familiar anchor is approximate with these rounded constants. Keep the calculated value if testing a numerical round trip.
Zero frequency
Conversion = Hertz to mel · Input value = 0.
0 mel. HTK logarithmic scale. 0 Hz corresponds to 0 mel. The next 100 mel span 64.95112 Hz from this point.
The origin maps to zero on both scales. The next hundred mel still have a finite frequency span at the bottom of the scale.
Concert reference
Conversion = Hertz to mel · Input value = 440.
549.63868 mel. HTK logarithmic scale. 440 Hz corresponds to 549.63868 mel. The next 100 mel span 105.77754 Hz from this point.
A familiar musical reference helps locate the lower part of the scale. Mel spacing follows a different rule from equal-tempered note spacing.
Higher audio frequency
Conversion = Hertz to mel · Input value = 8000.
2840.02305 mel. HTK logarithmic scale. 8000 Hz corresponds to 2840.02305 mel. The next 100 mel span 807.24965 Hz from this point.
Compare the additional hertz required for the next hundred mel here with the one-kilohertz example.
Invert one thousand mel
Conversion = Mel to hertz · Input value = 1000.
1000.02182 Hz. HTK logarithmic scale. 1000.02182 Hz corresponds to 1000 mel. The next 100 mel span 157.74046 Hz from this point.
The returned frequency is very close to one kilohertz. A small difference follows from rounding the forward calibration constants.
Logarithmic checkpoint
Conversion = Mel to hertz · Input value = 2595.
6300 Hz. HTK logarithmic scale. 6300 Hz corresponds to 2595 mel. The next 100 mel span 649.51121 Hz from this point.
The base-ten exponent becomes exactly one. Subtract one from ten and multiply by seven hundred to check the returned frequency by hand.
Interpreting the result
To lay out points for a mel filter bank, convert your lowest and highest physical frequencies first. Divide the mel difference into equal steps and convert each point back to hertz. The steps widen in physical frequency as you move up the scale. If working with an FFT, compare those frequencies with the available bin centers before rounding.
For an independent check, use the two-point example of 0 and 6300 Hz. Their coordinates are 0 and 2595 mel. The halfway coordinate converts to about 1514 Hz, well below the arithmetic midpoint of the two frequencies. This illustrates why equally spaced mel filters concentrate more densely in the lower part of the spectrum.
Measurement and model limits
Audio libraries may use a piecewise linear and logarithmic convention with a different numerical scale. Check the library setting before exchanging values. A mel coordinate alone is independent of sample rate. When designing a digital filter bank, the upper physical frequency still needs to remain within the recorded bandwidth.
Music theory tools → · ERB Bandwidth Calculator → · librosa frequency conversion conventions →
Answers before you play
Common questions
Why is one kilohertz only approximately one thousand mel?
The familiar constants in this formula are rounded. Substituting one thousand hertz gives a value just below one thousand mel.
Can I convert a difference in mel directly?
Convert both endpoints and subtract their frequencies. The same mel difference spans different numbers of hertz at different starting points.
Does this generate MFCCs?
Frequency conversion supplies coordinates for a possible filter bank. Computing coefficients also requires spectral data, filtering, logarithmic energies and a further transform.
Can a negative frequency be entered?
This implementation works with nonnegative frequency coordinates for audio analysis. Use the positive-frequency side of a real spectrum when designing a conventional mel grid.