10
Digital Audio to Sound Waves A description of sound’s journey from computer code to your ears Austin Goewert 3/27/2014

Technical Writing Definition

Embed Size (px)

Citation preview

Page 1: Technical Writing Definition

Digital Audioto Sound Waves

A description of sound’s journey from computer code to your ears

Audience and ScopeAustin Goewert 3/27/2014

Page 2: Technical Writing Definition

The purpose of this document is to describe the process of digital audio playback (i.e. how music travels from your iPod to your ears). Digital music storage has revolutionized music listening. Almost everyone today listens to digital music in some form, ranging from the radio in Walmart to their iPod headphones. It is my belief that a great number of these listeners do not understand the science behind this process.

The following document will provide the reader with a physical understanding of digital music playback. This process references various scientific concepts including computer code, electricity, and magnetism. This document could be used by individuals with a relevant scientific background as a starting point for further research. Additionally, this document could be used to satisfy the curiosity of anyone who listens to digital music; no scientific background is necessary.

Introduction

The digital age revolutionized music listening. The simple language of computer code combined with mass storage technology enables thousands of songs to be stored on an mp3 player or streamed online through websites such as SoundCloud and Pandora. The process by which this music reaches the ears of listeners can be broken up into three stages:

1. Digital audio code is transformed into an electric current.2. Changing electric current induces a force between two magnets. This force vibrates the

cone of a speaker.3. The vibrating speaker cone creates a pressure difference in the air. The human ear

observes this pressure difference as sound.

Terminology

Page 3: Technical Writing Definition

- Sample: A sample is a slice of audio. Digital audio uses very small samples to describe continuous sound waves in binary code. This concept is similar to that of a mathematical integral describing the area under a curve. (See Figure 1)

- Sample Rate Sample rate is the frequency of bars in an audio file. A typical audio file has a sample rate of 44.1 kHz (44,100 bars per second). Higher sample rates result in a more accurate description of the audio; however they require more processing power.

- Bit Rate Bit rate is the number of possible outputs at each sample. Higher bitrates produce a more accurate description of the sound waves.

o i.e. higher bit rate is higher resolution

- Bit Depth: Conventional means of expressing bit rate. Bit rate = 2bit depth o i.e. an audio file with a bit depth of 4 has 24=16 bits per sample.

- Binary code is a series of off (0) and on (1) messages by which all digital audio files are expressed. Higher bit rates/sample rates require more code.

o i.e. An 16 bit sample contains 16 on/off messages ( 0110001001001000) while a 4 bit sample contains four (0110)

- Channel: A stream of audio. Most audio files have two channels: a right and a left routed to the right and left speakers. Surround sound systems make use of up to 6 channels.

Figure 1: A sine wave described by 4bit digital code

From Digital to Current

Page 4: Technical Writing Definition

A digital to analog converter (DAC) is a series of resistors which translate binary code into electric voltage. A DAC contains multiple inputs corresponding to the bit depth of audio it was designed for. (i.e. A 4bit DAC has 4 inputs as seen in Figure 2). For simplicity, a 4bit DAC is described below. Higher bit DACs follow the same procedure, however the electronics involved are much more complex.

1. A four bit digital audio sample is fed into a DAC. One on/off message is delivered to each of the four resistors.

2. The resistors given an on message (1) produce a current proportional to that of their voltage. The resistors given an off message (0) do not produce current.

-The resistances are scaled so that every possible amplitude can be expressed (see Figure 2).

3. The four currents are summed to produce a current proportional to the amplitude of the digital sample.

4. Steps 1 through 3 are repeated at the interval determined by the sample rate of the audio file.1

Figure 2: A 4 bit DAC producing an example voltage

From Current to Vibration

Page 5: Technical Writing Definition

Figure 3: A simple speaker diagram

The current produced by the DAC travels through a wire to the speaker. As shown in Figure 3, a speaker consists of a cone (1), a coiled magnet (2), and a stationary magnet (3). The cone is attached to the body of the speaker by a flexible mounting. The coiled magnet is attached to the speaker cone. A magnetic field is present between the coil and the stationary magnet.

1. Current passes through the center of the coiled magnet.2. Changing current produces a magnetic force according to Faraday’s law of induction.3. This force pushes and pulls the coiled magnet in relation to the stationary magnet,

causing the coiled magnet to vibrate. 4. Since the coiled magnet is attached to the speaker cone, it also vibrates in relation to

the changing current.2

From Vibration to Sound

Page 6: Technical Writing Definition

Figure 4: Sound waves produced by a vibrating speaker cone

As a speaker cone moves forward, it compresses the surrounding air, creating compressions. As it moves back the air expands, creating rarefactions. These vibrations are detected by the human eardrum and perceived as sound. The two characteristics of sound waves are frequency and amplitude.

- Amplitude determines the volume of a sound. The distance the speaker cone moves sets the volume of the sound.

-Frequency determines the pitch of a sound. The speed at which the speaker cone moves back and forth sets this frequency.3

Figure 5: Amplitude and frequency

Page 7: Technical Writing Definition

Additional Information

Common Digital File Formats

- .wav/.aif- Called “lossless”, .wav (Windows) and .aif (Mac) are the highest quality form of digital audio. The sample rate can range from 1Hz to 4.3 GHz. They can be up to 4 gigabytes in size, which equates to about 6.8 hours of CD quality audio. Up to 65535 audio channels are possible. Typical CD quality audio contains two channels (mono and stereo), a sample rate of 44.1kHz, and a bit depth of 16.4

- .mp3- Called “lossy”, an mp3 uses an algorithm based on the limitations of the human ear to compress .wav/.aif files. A quality assessment between .wav and .mp3 is referenced in the recommended materials section below. Mp3’s are also typically two channels, 44.1 kHz, and 16 bits.5

- DVD-A: The conventional audio file for DVDs, DVD audio contains up to 6 channels, a sample rate of 48, 96, or 192 kHz, and a bit rate of 16, 20, or 24 bits.6

Recommended Materials

- 8 bit vs 16 bit- The song Idioteque by Radiohead is available on YouTube in 8 bit and 16 bit. The different quality versions of this recording highlight the differences between the two file types.

o 16 bit (normal) idioteque https://www.youtube.com/watch?v=DNqv3nHyteM o 8 bit idioteque https://www.youtube.com/watch?v=evK3Quoq4mY

- .wav vs .mp3- Music producers on the forum gearslutz.com conducted a study to test whether the human ear can tell the difference between a .wav and .mp3 file.

o http://www.gearslutz.com/board/mastering-forum/402758-wav-vs-mp3.html

- Collin’s Lab: Digital to Analog Converter- This video uses a visual approach to describe the function of a DAC.

o https://www.youtube.com/watch?v=b-vUg7h0lpE

Page 8: Technical Writing Definition

References

Cover Photo 1 http://transmissionsmedia.com/spy-agency-asio-wants-powers-to-hack-into-personal-

computers/206868-binary-code-hacking/Cover Photo 2 http://www.bhmpics.com/view-abstract_sound_waves-wide.htmlFigure 1 http://www.surroundsoundmusic.com/blog/2012/05/16/surround-sound-music-audio-

codecs/Figure 2 http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/dac.html Figure 3http://www.physics.org/article-questions.asp?id=54Figure 4http://stahlysoundwaves.weebly.com/how-sound-is-made.htmlFigure 5 http://stahlysoundwaves.weebly.com/how-sound-is-made.html1. http://provideyourown.com/2011/analogwrite-convert-pwm-to-voltage/2. http://hyperphysics.phy-astr.gsu.edu/hbase/audio/spk.html3. http://stahlysoundwaves.weebly.com/how-sound-is-made.html 4.http://www-mmsp.ece.mcgill.ca/documents/AudioFormats/WAVE/WAVE.html5.http://www.mp3-tech.org/6.http://dvddemystified.com/dvdfaq.html#3.6.1