**Logs and music
**Bruno A. Olshausen

Psych 129 - Sensory processes

Logarithmic scales provide a useful way to describe many types of natural phenomena. In the study of audition, logarithmic scales are used to describe sound intensity and frequency. This handout describes what a logrithm is, and why it appears so often in the study of audition.

**The exponential function
**

To understand logarithms, you first need to understand exponential relationships. An integer exponent specifies how many times to multiply a number by itself. For example, means , and means . If the exponent is negative, then this means the number is inverted and then multiplied by itself. For example, . Exponents can also be non-integer numbers. Here, the relationship is somewhat less intuitive--e.g., means “multiply 3 by itself 1.57 times,” so you get a number somewhere between 3 and 9 (more precisely, 5.6115). If the exponent is one divided by some integer

An exponential function is of the form . This is plotted in figure 1 when

Now we are in a situation to understand what a logarithm is. A logarithm is basically the inverse of the exponential function. Thus, means, “the exponent to which you should raise

Figure 2: the logarithm function

One of the nice properties of the log function is that multiplication turns into addition, and division turns into subtraction. That is, if and , then

and

You should be able to prove these relationships for yourself given the relationship between the log and exponential functions. In the days before calculators, slide rules made mutiplication and division easy by using a logarithmic scale to represent numbers, and then sliding one scale against the other to add or subtract the logarithms, thus mutiplying or dividing, respectively, the numbers. It turns out that this property of the logarithm is also what makes it useful in describing sound intensity and frequency.

Alexander Graham Bell, the inventor of the telephone, observed that the difference in sound intensity that was needed to produce a perceptible change in the loudness of two tones increases proportional to the absolute intensity of the reference tone. That is, if you are comparing two very soft tones, then only a small change in intensity is need to perceive a difference. But if you are comparing two loud tones, then a larger change in intensity is needed to perceive the difference. Importantly, he found that the

The ‘bel’ scale was named in Bell’s honor. It is just the base 10 logarithm of the ratio of intensity (power) of two sounds:

difference in

where is the intensity of one sound and is the intensity of the other. Thus, a difference of 5 bels means that the ratio of sound intensities is 100,000. A ‘decibel’ is simply of a bel, and is denoted

difference in

where is the amplitude of one sound and is the amplitude of the other.

As we learned in class, the basilar membrane has been constructed such that it resonates to different frequencies in different places. The representation of frequency along the basilar membrane is

Frequency intervals are typically measured in terms of

difference in octaves = .

Thus, we can see that octaves are to frequency what decibels are to intensity. Equal frequency ratios translate into equal differences in terms of octaves.

When you pluck a string, it vibrates at a certain frequency according to its length and tension, and these vibrations are sensed by the ear and relayed to the brain. If you pluck a bunch of strings together, it can either sound nice or downright awful, depending upon the frequency relationships among the strings. The modern piano has been designed to have an equally-tempered scale, meaning that the ratio between the frequencies of any two adjacent notes--for example, C to C#--is (approximately) the same no matter where you go on the keyboard. Thus, musical instruments have been designed around the logarithmic representation of frequency in the nervous system.

Two adjacent notes are referred to as a half-step, or semitone, and 12 half-steps make up an octave, or a doubling in frequency. (On the keyboard, an octave is when you go from one note to another that looks just like it above or below--see figure 3). Since the ratio between the frequencies of all half-steps are the same, then each adjacent pair will be separated by -octave, so the ratio between frequencies for each semitone is , or a 6% increase. Each time you raise a half-step, you multiply the frequency by about 1.06 to get the next note, and after you have done this 12 times you have multiplied by a factor of two. A full piano keyboard has 88 keys, and thus 7 octaves, ranging from 27.5 Hz at the lowest A to 4186 Hz at the highest C.

Figure 3: the piano keyboard

Perhaps one of the most interesting questions about music perception is why some intervals sound pleasing (consonant) and others sound harsh or difficult to bear (dissonant). A table of consonant intervals is shown below:

Interestingly, the consonant intervals all have integer-fraction frequency ratios. The consequence of this is that their harmonics will tend to either align or else produce other consonant frequency ratios. For example, the second harmonic of G will be times the fundamental of C; thus, the second harmonic of G exactly aligns with the third harmonic of C. But this still doesn’t answer all of our questions. What if we were to just play two pure tones that don’t have any harmonics. We still get dissonance when they are next to each other in frequency. Why? The answer seems to be that it has something to do with

Figure 4: relation between consonance, dissonance and critical bandwidth

If you are interested further in this topic, I recommend reading “The Science of Musical Sound,” by John R. Pierce (W.H. Freeman & Co.).