Fundamentals of data representation: Sampled sound
So we should know by now that sound waves are continuous and computers can only store discrete data. How exactly does an Analogue to Digital Converter convert a continuous sound wave into discrete digital data? To do this we need to look at how computers sample sound.
Sampling rate
[edit | edit source]To create digital music that sounds close to the real thing you need to look at the analogue sound waves and try to represent them digitally. This requires you to try to replicate the analogue (and continuous) waves as discrete values. The first step in doing this is deciding how often you should sample the sound wave, if you do it too little, the sample stored on a computer will sound very distant from the one being recorded. Sample too often and sound stored will resemble that being recorded but having to store each of the samples means you'll get very large file sizes. To decide how often you are going to sample the analogue signal is called the sampling rate. Take a look at the following example:
To create digital sound as close to the real thing as possible you need to take as many samples per second as you can. When recording MP3s you'll normally use a sampling rate between 32,000, 44,100 and 48,000 Hz (samples per second). That means that for a sampling rate of 44,100, sound waves will have been sampled 44,100 times per second! Recording the human voice requires a lower sampling rate, around 8,000 Hz. If you speak to someone on the phone it may sound perfectly acceptable, but try playing music down a telephone wire and see how bad it sounds.

Sampling resolution
[edit | edit source]As you saw earlier, different sounds can have different volumes. The sampling resolution allows you to set the range of volumes storable for each sample. If you have a low sampling resolution then the range of volumes will be very limited, if you have a high sampling resolution then the file size may become unfeasible. The sampling resolution for a CD is 16 bits used per sample.
File sizes
[edit | edit source]To work out the size of a sound sample requires the following equation:
File Size = Sample Rate * Sample Resolution * Length of sound
This is the same as saying:
File Size = Bit Rate * Length of sound
Let's look at an example:
Example: Sound File Sizes If you wanted to record a 30-second voice message on your mobile phone you would use the following: Sample Rate = 8,000 Hz Sample Resolution = 16 bit Length of Sound = 30 seconds Therefore, the total file size would be: 8,000 * 16 * 30 = 3 840 000 Bits = 480 000 Bytes |
Extension: Sound Editing If you are interested in sound editing you can start editing your own music using a program called Audacity. Using Audacity you can create your own sound samples with different sample rates and sample resolutions, listening to the difference between them and noting the different file sizes. Check out the following sound files recorded at different sampling rates:
|