The Mel Scale

The mel scale is an object from psychoacoustics. I only know about it from a short and unclear wikipedia article. It's supposed to have uniformly spaced intervals.

We start with the mel formula.

    mels = 2595 * log_10(1 + (frequency / 700))

Mels seem to be additive: 100 to 150 mels should be the same interval as 150 to 200 mels.

I'm used to using cents in a similar way.

    cents = 1200 * log_2(frequency ratio)

Cents aren't defined over a single frequency, only a ratio of frequencies. But the mel formula seems to be based in some way on 1000 hertz, so maybe that gives us some way to make a comparison. At least, the scale is designed so that 1000 hz is 1000 mels.

Anyway, there's a sound clip on the wikipedia page purporting to demonstrate a mel scale from 200 up to mel 1500, by increments of 50. We can figure that out. For mels in [200, 250, 300, 350, ..., 1500], we want to know the associated frequencies. For this, we just need to invert the mel formula:

    frequency = 700 * (10^(mels / 2595) - 1) 

and play a tone at the frequency corresponding to each mel in the list. Here are the first few, with frequencies and cents rounded to integers:

200 mels : 135 hz @ 0 cents over 200 mels

250 mels : 173 hz @ 426 cents over 200 mels

300 mels : 213 hz @ 782 cents over 200 mels

350 mels : 254 hz @ 1089 cents over 200 mels

400 mels : 298 hz @ 1360 cents over 200 mels

450 mels : 343 hz @ 1605 cents over 200 mels

500 mels : 390 hz @ 1829 cents over 200 mels

550 mels : 440 hz @ 2035 cents over 200 mels

600 mels : 492 hz @ 2227 cents over 200 mels

650 mels : 546 hz @ 2408 cents over 200 mels

700 mels : 602 hz @ 2578 cents over 200 mels

I confess that this has a compelling kind of equi-distance to it, which is why I'm trying to understand it better. You can see that this doesn't reach the octave, but it gets quite close to two octaves one line before where I cut it off. So 200 mels to 650 mels is close to two octaves.

This scale included 400 mels, and mels and frequiences are in 1 to 1 correspondence, so if we start a new scale at 400 mels and move up by units of 50 mels again, we get the same upper frequencies:

400 mels : 298 hz @ 0 cents over 400 mels

450 mels : 343 hz @ 245 cents over 400 mels

500 mels : 390 hz @ 468 cents over 400 mels

550 mels : 440 hz @ 675 cents over 400 mels

600 mels : 492 hz @ 867 cents over 400 mels

650 mels : 546 hz @ 1047 cents over 400 mels

700 mels : 602 hz @ 1218 cents over 400 mels

But now we do almost get an octave: 700 mels is a slightly wide octave over 450 mels.

Depending on which mel you start on, you'll get different frequency ratios as options: your scale might have the octave, or octaves, or maybe both or neither.

Now, I don't actually see any description of the one true mel scale on the page. It's not clear to me that you have to start any where or move by any given increment. For example, a chart lists frequences for mels from 0 mels to 3250 mels, by units of 250 mels. Okay.

Let's pretend, until someone tells us otherwise, that any sequence of mels that moves by a consistent amount is a mel scale - any arithmetic progression is fine. Given this loose definition, I think we can find multiple mel scales which hit the octave exactly from any given starting point. Let's try 440 hertz as a starting point.

Using the original mel formula, we can find mels for 440 hz and 880 hz

    549.6386753811498 mels = 440 hz
    917.4857268097301 mels = 880 hz

and now we decide on our number of divisions. How about 12? Let's see what a mel chromatic scale looks like. Our step size will be

    (917.4857268097301 mels - 549.6386753811498 mels) / 12 = 30.653920952381686 mels

Fine. I did the calculation with lots of decimal places, but here it is printed with mels and hz rounded to integers for readability:

550 mels = 440 hz
580 mels = 471 hz
611 mels = 504 hz
642 mels = 537 hz
672 mels = 571 hz
703 mels = 606 hz
734 mels = 642 hz
764 mels = 679 hz
795 mels = 717 hz
826 mels = 756 hz
856 mels = 796 hz
887 mels = 838 hz
917 mels = 880 hz

Let's ignore the mels for a minute and examine the cents for the frequency ratios of this scale.

440 hz @ 0 c
471 hz @ 119 c
504 hz @ 234 c
537 hz @ 345 c
571 hz @ 451 c
606 hz @ 554 c
642 hz @ 654 c
679 hz @ 751 c
717 hz @ 846 c
756 hz @ 938 c
796 hz @ 1027 c
838 hz @ 1115 c
880 hz @ 1200 c

All of these cents are calculated for frequency ratios over 440 hz of course.

This scale is crazy! Almost everything is 30 to 50 cents off from 12 tone equal temperament, but it still sounds fairly normal!

Let's find a just intonation scale that matches this kind of closely. This is pretty close:

    [P1, SpA1, SpM2, AsGrm3, Sb4, As4, Sb5, Sp5, AsGrm6, AsM6, PrGrm7, SpGrM7, P8] # [1/1, 15/14, 8/7, 11/9, 35/27, 11/8, 35/24, 54/35, 44/27, 55/32, 65/36, 40/21, 2/1]

...