Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Boomin' Systems


Jan03: Embedded Space

Ed is an EE, PE, and author in Poughkeepsie, New York. You can contact him at [email protected].


Surely you remember those important yet incomprehensible announcements over your high-school's PA system? Once upon a time, a friend and his stage-crew buddies decided, with the pristine logic of adolescent males, to Do Something. They reasoned that if the speakers failed, replacements would surely appear.

Late one evening, they unhooked the main speaker feed from the back of the audio distribution amplifier, wire-nutted the leads to a widow-maker extension cord, and plugged the school's speakers directly into a convenient AC outlet. A shatteringly loud bass MMMMMMM!! instantly filled the building.

After about a minute, the jittery miscreants returned the wiring to its original state and crept out of the room into a dust-hazed corridor. Piles of fuzz, pencil erasers, dead insects, paper clips, chewing-gum wads, and similar detritus lay heaped below each PA speaker.

Much to everyone's surprise, the next morning's announcements were perfectly clear and easily understood. The would-be wrecking crew accepted the miracle as granted and did not confess their (mis)deeds.

They didn't know that the school used a constant-voltage sound distribution system with a line level of 70.7 V at rated output. Their 120 VAC pure sine-wave audio signal, a mere 5 dB above 71 V, simply drove the voice coils and speaker cones through their full range of motion, probably for the first time since they were manufactured. That vigorous exercise dislodged decades of accumulated junk and returned those speakers to like-new condition!

The consequences of loud sound aren't always so beneficial. Let's review some basic physiology and physics to set the stage for a considerably less amusing story. If you're designing audio output circuitry or firmware, these earbuds are for you.

Audio Intro

Hearing, as with so many things, is all in your head. Three tiny bones in each ear act as impedance transformers that convert air pressure variations at the eardrum into fluid motion in the cochlea. Minute hair cells convert that fluid motion into electrical impulses in the auditory nerves, which, processed through the magic of the brain, become music and speech and all the sounds of daily life.

The malleus bone presses against the eardrum and begins the conversion of sound into hearing. A small muscle called the "tensor tympani" pulls the malleus away from the eardrum in response to loud external sounds and accounts for that cringing sensation inside your ear during a fireworks display.

The incus acts as a pivoting lever that both transfers motion from the malleus and increases its leverage on the stapes.

The stapes—the smallest bone in your body—presses against the fluid-filled cochlea. The stapedius, a tiny muscle attached to the stapes, also reduces the sensitivity of the ear by pulling the stapes away from the cochlea. In fact, a neural reflex contracts the stapedius just before you chew or speak to prevent damage from those extremely loud internal sounds.

The air pressures involved in normal hearing span an amazing range. On the low end, a pressure variation of 20 Pa at the eardrum causes the softest sound you can hear. Well, that a normal, undamaged ear can hear: Your mileage may vary. Normal atmospheric pressure is about 100 kPa, so a variation of 0.2 parts per billion can be clearly audible. If your ears were only slightly more sensitive, you'd also hear the random noise of air molecules bouncing off your eardrums.

The high end of normal hearing occurs at a pressure of 20 to 30 Pa, about one million times the lower limit and only 0.03 percent of the static air pressure. Sounds louder than that actually hurt, as distinct from the aesthetic pain caused by some performances regardless of volume.

To review the terminology, the unit of pressure called a "pascal" is equivalent to 1.0 newton per square meter. Normal atmospheric pressure, the familiar 14.7 pounds per square inch, ranges from 95 to 105 kPa, and high-pressure bicycle tires hit 700 kPa.

Given the wide range of numbers and the fact that hearing response tends to be logarithmic, you'll generally see sounds represented in decibels, abbreviated dB. The Sound Pressure Level scale uses the lower limit of hearing as its reference:

SPL=20 log (pressure/20 Pa)

Therefore, 0 dB represents the softest sound at 20 mPa, and 120 dB occurs at the 20 Pa threshold of pain. Regardless of the actual pressures, the minimum discernible difference between two sounds is about 1 dB—a 12 percent pressure change.

You might wonder at the factor of 20 in that equation. Decibels are defined as the ratio of an energy (or, equivalently, a power) to a reference energy (or power):

dB=10 log (energy/energyref)

Energy and power are proportional to the square of the pressure, so the equation becomes:

SPL=10 log (pressure2/(20 Pa)2)

Whereupon some high-school math-fu converts the exponent into a factor.

Ah, but how does all this relate to embedded systems design? Let's turn to the electronic end of the biz.

Audio Output

Audio systems convert electrical signals into sound using loudspeakers or, simply, speakers. Audio magazines reveal speaker designs from the sublime to the ridiculous, but the key effect involves moving air, usually with a diaphragm attached to a coil of wire in a magnetic field.

The force exerted on the diaphragm is proportional to the current in the wire and thus, assuming that the coil's electrical impedance remains roughly constant, to the applied voltage. This relationship is surprisingly linear throughout the coil's normal excursion and explains why even mediocre loudspeakers sound good enough for most people.

A speaker's sensitivity measures the SPL produced at a specific distance for a specific input power: Typical speaker sensitivity ranges from 80 to 110 dB at 1 meter per input watt. Over a considerable power range, doubling the electrical power doubles the audio power and, thus, increases the pressure by a factor of 1.4. In decibels, everything increases by 3 dB.

Pop quiz: Work it out.

For example, a 100 dB/W speaker produces 100 dB SPL with a 1 W input signal. Driven at 100 W, it produces 120 dB because 100 W is 20 dB above 1 W. You'd need 1 kW to reach 130 dB and 10 kW to hit 140 dB. Although 10 kW may seem unreasonable, large-venue sound systems cook at that level, albeit driving multiple speakers in parallel rather than one Brobdingnagian cone.

Embedded systems folks don't work with high-powered speakers. Instead, you might create a battery-powered MP3 player or a voice recorder with a headphone jack. Headphone (or earbud) sensitivity uses a different scale, with the SPL measured inside the ear canal of a dummy (that's plastic, not IQ) head with 1 mW applied to the coil. Surprisingly, the sensitivities are numerically the same, about 80-110 dB/mW, but keep in mind that the power units are now milliwatts.

That's why it's difficult to use earphones plugged into a PC's speaker jack—the volume is 30 dB too high. Similarly, speakers plugged into a headphone jack produce an exceedingly soft sound. You may also find impedance matching issues, although they're of secondary importance.

In any event, a 100 dB/mW headphone produces 120 dB at 100 mW, an electrical power level roughly equal to one trendy blue indicator LED and well below that of most embedded processors.

Pump up the volume, right?

Damage Control

Normal hearing copes with a 1012 range of power delivered to the ear, roughly equal to the ratio between a single flashlight and the aggregate U.S. electrical generation capacity. I suspect you'd be hard-pressed to design a single system with that capability.

Despite the best efforts of the tensor tympani and stapedius, exposure to high sound levels causes progressive hearing deterioration in excess of the normal hearing loss due to aging. The threshold seems to be a Sound Pressure Level of about 85 dB and, as you'd expect, the damage depends on both the SPL and the exposure time.

A typical noisy office or restaurant is about 80 dB and a large truck might generate 90 dB. A nearby automobile horn blasts just below the 120 dB pain threshold and a jackhammer rattles just above it at 130 dB. Rock concerts can expose the audience to 115 dB and performers gyrating closer to the speakers may endure 130 dB.

You've probably noticed that you're a little deaf after a live concert, which shows how those tiny muscles protect the ear from prolonged exposure. Your hearing will return to nearly its previous level as they relax over the next few hours. Unfortunately, if you think you're "getting used to loud sounds," you are: Your hearing has suffered permanent damage.

OSHA, the U.S. government agency responsible for job safety, limits the maximum exposure time for various SPLs, decreasing from eight hours at 90 dB to 15 minutes at 115 dB. In round numbers, the exposure time drops by half for each 3 dB increase in SPL above 85 dB. Above 120 dB, you must wear hearing protection because damage can occur instantaneously. Below that level OSHA recommends hearing protection to reduce the effective SPL to 82 dB.

Although the auditory reflex can protect your hearing from loud sounds, those small ear muscles require perhaps 50 ms to contract. Impulse noise, such as gunfire and sharp electronic sounds, causes damage before the muscles can react. Depending on the intensity, one blast will suffice.

So driving headphones with a mere 100 mW can cause auditory damage within a few minutes under normal use with ordinary audio signals.

But you'd never do that, would you?

Snap, Crackle, Pop

After reading the July column on how an HP2000 printer could make perfectly good cartridges unusable, Kári Hararson sent a note describing his experience with hardware damage of a quite different sort.

He is one of the many PC users who enjoys listening to music while working. His preference involved MP3 tunes, WinAmp, and headphones plugged into his PC's Line Output jack.

He wrote "One day, I got an e-mail with an attached media file of type .AVI. It opened in a new (to me at the time) program, Windows Media Player. WinAmp stores the default volume level somewhere else than Windows Media Player. I got the initial volume from Media Player in my headphones, which was apparently set to 'full blast'."

"I ripped the headphones off but too late. I got instant hearing loss and a condition in both ears called 'Tinnitus,' which is basically a screeching tone from the damaged auditory nerves that never goes away..."

Ouch!

Let's run the numbers to see what happened. He wore Sony MDR-V600 monitor headphones plugged into the Line Out jack of a stock HP Vectra VLi8 PC. That PC uses a Cirrus Logic CS4297 AC'97 audio codec and a Philips TDA1308 headphone driver. All these items are fairly generic, as most recent PCs comply with Microsoft's AC'97 spec.

The CS4297 produces a maximum 1 V output signal from its internal DAC. The reference design circuit configures the TDA1308 driver with a voltage gain of 1.44 and a 10- output resistor to protect against short circuits. The TDA1308 produces a maximum of 60 mW into a 32- load, which is precisely the 1 V output from the CS4297 times a gain of 1.4.

MDR-V600 headphones have a sensitivity of 106 dB/mW and a 45- impedance. In the reference design the TDA1308 will drive them at 30 mW for a 121 dB SPL. Amazing how that works out, isn't it?

Kári inadvertently discovered that volume control has become a distributed thing. The MP3 decoding process includes a coefficient that sets the maximum value of its output numbers sent to the CS4297's digital-to-analog converter. Windows then applies an analog attenuator to the resulting voltage.

You can verify this by firing up both your favorite media player and the Windows Volume Control (double-click on the Volume icon in the Task Bar). If you adjust the media player volume and none of the mixer's sliders move, it's a coefficient.

We can assume Kári's PC had its analog mixer controls all the way up for minimum attenuation and the WinAmp volume control set to a reasonable level. WinAmp, therefore, produced relatively small digital values that passed through the analog chain without further attenuation.

The final piece of the puzzle comes from Microsoft's e-mail clients, which can open attachments using the appropriate program. Kári selected that fateful e-mail attachment and Windows Media Player opened the AVI file. A sound that would otherwise be startling became devastating at full volume.

Now for some embedded systems questions. You desktop app developers might ponder these, too.

What's the correct default-volume control setting? The minimum will produce no sound, just tech-support calls from people saying their PC audio isn't working. Midrange may be too soft, particularly with speakers plugged into the Line Out jack. At maximum, well, users can always turn it down.

When should applications start and with what settings? This can be a convenience or disaster, depending on what the programs do. Microsoft has recently throttled back their e-mail clients to the extent that they're actually pretty well behaved and no longer autorun most Trojans, but Kári manually activated the attachment.

Although, we should be circumspect about running unknown attachments, Windows tends to hide the file extensions that identify which program to run. Even given that information, what harm can come from playing an audio or video clip?

What should you assume about external equipment? HP's manuals warn you to remove your headphones and adjust the volume before donning them. I'm sure you could find a similar paragraph in your PC's manual, too...if you could find your manual, that is. But would you think to remove your headphones before reading your mail?

What settings make sense? Kári used headphones, I have a full-bore audio system with big speakers, and your mileage may vary. Levels appropriate for your system may implant my speaker cones in the back of my monitors.

The next time you select defaults, think about the worst case situation. As we've seen in the last year or so, the worst case can be unexpectedly bad.

Reentry Checklist

Nowadays, my friend and his buds would get expelled so hard they'd bounce on the way out. He went on to become the best analog designer I've ever met, which may be a nearly perfect example of nature's compensatory process in action.

A picture of a noise-damaged cochlea at http://www.ama-assn.org/sci-pubs/msjama/articles/vol_281/no_17/noise1.htm should get your attention. Googling the obvious keywords nets enough reading material to keep you busy for days.

Many thanks to Kári Hararson for standing on his head behind his desk while tracking down his system's chip numbers. Tape his name to your multimedia keyboard next to those volume control buttons.

The datasheets are at http://www .support.vectra.hp.com/vectrasupport/ indexes/Manual401.html, http://www .intel.com/labs/media/audio/index.htm, http://www.cirruslogic.com (look under Products), http://www.semiconductors.philips.com/, and http://www.sonystyle.com/home/ (search for MDR-V600).

You'll find a denatured version of L.L. Cool J's "The Boomin' System" on his Mama Said Knock You Out album. Two key lines vanished from the original college-radio single and you will not find them anywhere on the Web. Self censorship didn't start with the DMCA.

DDJ


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.