Computer-Music.com contains articles and product reviews related to making music using computers and creating 3D computer animation in sync with music. Computer-Music.com is also the home page of  Donald S. Griffin, an experienced professional composer, sound effects designer and audio consultant with an emphasis on computer games,  video games and internet music and sound effects. For pricing and contract availability send email to: DGriffin (@) Computer-Music (.) com

Computer-Music.com  contains articles and product reviews related to making music using computers and creating 3D computer animation in sync with music.
Computer-Music.com is also the home page of  Donald S. Griffin, an experienced professional composer, sound effects designer and audio consultant with an emphasis on computer games,  video games and internet music and sound effects. For pricing and contract availability send email to: DGriffin (@) Computer-Music (.) com



 

<< to previous page <<

to this article's front page

>> to next page >>

Understanding Digital Audio

To understand digital audio it helps to understand the difference between analog and digital as it refers to sound recording. Analog sound recordings are continuous representations of the changes in sound pressure (air pressure) to the diaphragm of the microphone that recorded them. How the sound gets from the microphone to an analog recording medium like a vinyl record or a cassette tape is not important here just that it is a continuous, unbroken stream. If an analog recording was to be represented by a graph you would have to put the pencil down and draw a smooth curving line without lifting your pencil. The actual recording has theoretically infinite detail since you can pick any two points on the line, no matter how close together and find a new point between them. This is not to say that analog recordings are of infinite quality. In practice every step along the recording chain is flawed so not every detail of the sound is accurately recorded.

Digital recording is not perfect either, just different. The key word in understanding digital versus analog is the word digit. Whereas an analog recording is stored on a medium that allows a continuous curve of changing sound pressure values a digital recording does not. Digital recordings are a series of snap shots of the sound pressure at a precise instant stored as a number, as digits in a computer. In a digital recording you can find two points right next to each other for which there is no value between them. A digital recording would be best graphed as a series of stair steps since it is not known what the values are between the points where the sound pressure was actually measured. If you measure the sound pressure often enough and accurately enough you can see a graph where the stair steps are so small they are almost invisible and the graph SEEMS to be of an analog recording. If you add to that the fact that the equipment that plays back digital recordings does some guess work to recreate the missing points in between each actually measured point you can get a pretty detailed picture of the sound with digital recording even though you didn't actually constantly measure the changes in sound pressure the way you would in analog recording.

Digital recording has several major advantages over analog recording. Digital recordings are numbers which means they can be manipulated by computers. They can be stored as a list of numbers which will stay the same quality from copy to copy so long as nobody changes the numbers. Analog recordings lose some detail and gain some inaccuracies with each subsequent copy. With our present technology we are able to make and play back more accurate recordings using digital technology than analog.

In digital recording there are some decisions to be made that don't apply to analog. You have to choose how often you will record each sound pressure value and how big is the possible range of values you will allow for each measurement. If you are recording using an 8 bit number to represent each sound pressure measurement you can only have 256 possible values so you have to divide all possible sound pressure levels into 256 ranges. If a level falls between two of these possible values it has to be rounded off. This rounding off adds to the stair step effect and the sound can not be reproduced as accurately as if there were more possible values. This results in the recording sounding scratchy when played back and a loss of high pitches. The other common vertical resolution or bit depth or amplitude range is 16 bit recording. 16 bits offers a vast increase of sound pressure ranges from 256 to 65,536 which is what music CDs use. How often you record each measurement is called the sample rate or sample frequency. This is not the same as the sound frequency but they are related. The Nyquist theorem (pardon any misspelling) essentially says that the highest sound frequency that can be reconstructed from digital sound data is half the sampling frequency. Essentially that highest frequency is being graphed with only two points per cycle. If you want to reproduce sounds up to 22.05 kilohertz (22,050 cycles per second) you have to use a sample frequency of 44.1 kilohertz (44,100 samples per second.) This also points out the fact that the higher the sound frequency that is being recorded, the more vulnerable digital technology is to misrepresenting it during playback. In the above example (which is used in audio CDs) a sound at 22.050 Kilohertz would be reproduced by the computer producing only two points per cycle and the playback hardware would have to guess what the exact curve looked like when it was recorded. Because of the way that guessing works a flat horizontal line is often interpreted as a series of different frequencies at different amplitudes which would add together to produce something like that flat line if recorded at an inadequate resolution. The result is that any sound recorded without enough detail (without a high enough sample rate or enough bits for accurate values) tends to be reproduced as a terrible scratchy noise including high pitched sounds that were not in the original sound at all.

You might conclude from the above paragraph that you should always record digital audio at the very highest resolution possible but each sample has to be stored and takes valuable time from the computer to play back. For a typical CD recording at 16 bits and 44.1 Kilohertz the cost in disk space is just over 10 megabytes per minute if the recording is stereo. This is how a large capacity CD gives you 65 minutes of music. This is fine for a CD player since its computer is designed just for this task and has nothing better to do with its time but in computer applications and especially over the Internet the size of sound files and the time it takes to send them and the effort it takes for the computer feed them to the sound card for playback really matters. In 1995 I downloaded a 10.5 megabyte file from the Internet using a dedicated Internet server (which is almost twice as fast as a service like Prodigy or America Online) and using a 28.8 modem connection it took just under 68 minutes. This means to hear a one minute sample of music over the Internet would have taken me over an hour! Later I changed to a 56k modem, then to a pair of them working together on separate phone lines, then, very recently, to a Cable modem. I found it depended a lot on the time of day and traffic to the web site in question but generally I found that under ideal conditions that 10.5 meg file would take me more than 60 minutes on a 56k modem; more than 30 minutes on a dual 56k modem setup, and as little as a minute on a cable modem. Incidentally that implies I could stream this CD audio just in time to keep up with the music on my Cable modem but that file would also take up 10.5 meg on somebody's web site and only for a single minute of music. A typical radio-length song is more than 3 minutes or 30 meg! These numbers also point out that an hour worth of CD level sound for a computer game can easily take over the whole CD ROM! (Which I would gladly do if they would ever let me.) MP3 files are all the rage today for sharing music via the internet. MP3 stands for MPEG (Motion Picture Experts Group) Layer 3. It is a way of encoding sound to take up much less space. The sound is first broken up into different bands, parts of the audio at different ranges of pitch, low to high. Then each band is compressed in differing amounts to suit the needs of human audio perception. This produces the maximum compression with the least lost of perceived audio quality. MP3 compression allows for many different settings but the one most commonly used on the internet produces approximately a 10:1 compression so that the file size is now only one tenth of the original. That 10.5 megabyte, one minute, sound file would turn into a 1.05 megabyte MP3 file. However, MP3s are quite noticeably lower quality than CD recordings. Anyone who even marginally cares how good their music sounds will spend the money to buy a CD of any music they really care about. The MP3 distortion effect, sounds to me like increased reverb (echo chamber) accompanied with a sort of garbled sound like a million aliens talking just out of ear shot. That 1.05 meg MP3 file would still take at least 6 minutes on a 56k modem and 3+ meg is still a lot of space on a web site for a single song.

What are you supposed to have learned from all this tech talk? Digital recording is good stuff but it has its limitations. Carefully consider what kind of sound you are recording and how good you want it to reproduce versus the needs of your situation for speed and files sizes. One tip is to always record at the maximum possible resolution then try different settings for reducing the file size by reducing either the bits to 8 or the sampling frequency to 22.050 (kHz) or 11.025 or less until you get the right balance of quality and size. As you reduce the resolution you will lose higher frequencies but not low frequencies leading to an overall dull and bass-ey sound and adding hiss and noise. There are numerous tools that will allow you to reduce digital recordings as much as possible with the least lost of sound quality. Often how you reduce the resolution is as important as amount of reduction you choose. If you will be converting to MP3 then do NOT first reduce below CD quality, it will drastically reduce the quality of your resulting MP3 file while gaining you NO additional size reduction. I also recommend trying to maintain 16 bit reducing to 22.050 or 11.025 first before resorting to 8 bit. With MP3 and other technologies like RealAudio compression and Windows Media compression, you will, hopefully, never have to worry about reducing your files to 8 bit ever again.

Since I wrote this article in 1995 the average hard disc has grown dramatically in size and dropped in cost. RAM (memory) has done the same. This means space on your hard disc for recording digital audio is not the difficult situation it once was. writeable and rewriteable CDROM drives are becoming the most common form of backup and both types of media have become very affordable so backing up a 650 megabyte project will only cost you a dollar or two.

Since I wrote this article in 1995 the new top level of music studio audio resolution has become 24 bit (versus the 16 bit on a CD) and 96 kilohertz (versus the 44.1 kilohertz on a CD). The final mix still has to be reduced to 44.1 16 at the very last step but doing the recording, processing and mixing at greater resolutions helps to reduce peaking errors and audio quantization errors that tend to introduce noise and distortion into recordings. Supposedly engineers hear a greater quality in a 44.1 16 CD produced at a higher resolution than one that was not. I have not done this comparison myself. You might consider these new resolutions because some day there will probably be consumer gear that will allow consumers to listen to audio at these greater resolutions and your music will already be ready for this. However, working with greater resolutions puts commensurately greater demand on your hard disc space and computer power so keep this in mind.

<< to previous page <<

to this article's front page

>> to next page >>

 

 

For questions or comments contact the webmaster at
(you will have to remove the parentheses and  spaces; sorry but spam is a problem)
 dgriffin (@) computer-music (.) com
Copyright 1996-2004 Donald S. Griffin - Computer Music Consulting. All rights reserved.
Revised: February 04, 2004.
Privacy Policy