Home / Tech / Computer Hardware
Soundcards
Quantizing

 

Most people know that real-world sounds are analog--this means simply that they do not have discrete values, but rather are continuous in nature. When you hear someone blow a whistle, for example, the sound is continuous, and if they start blowing more strongly, the sound increases from quieter to louder in a gradual, smooth way. Computers are of course digital: they work with discrete values. Computerized sound therefore uses discrete approximations to represent the analog world of "real" audio.

Since analog information and digital information are certainly not the same, this raises an important question: how is the analog sound converted to digital form? The process used to do this conversion is called quantizing (sampling). When an analog signal is sampled, an electronic device measures the level of the signal periodically, and then records it in digital form. Then, by playing back the samples at the same rate, an approximation of the original signal is produced. This is in fact what happens with compact disk audio, with "wave" files in games, etc. Each sample represents the amplitude (loudness, in essence) of the signal at that moment in time.

A key defining characteristic of any digital audio signal is its sampling rate, usually just called the sample rate. This refers to how frequently the analog signal is measured during the sampling process. If you think about it, the reason why this is important is obvious: imagine that you had a recording of someone speaking, and you sampled the recording once per second. You'd end up with a lot of choppy noise. The more frequently the signal is sampled, the better the approximation to the original sound. However, the higher the sample rate the more memory is required to store the samples, so you don't want to sample more than is necessary either!

You can perform this simple experiment yourself to illustrate how sampling works, and why the sample rate is important:

  1. Get a piece of lined notebook paper (you can do it with unruled paper but it's much easier with the lines already on it).
  2. Turn the paper clockwise 90 degrees (landscape orientation) so that the lines run from top to bottom.
  3. Starting on the left side of the sheet somewhere towards the middle, draw a sine wave from left to right across the page. (If you have no idea what a sine wave is, well, it looks similar in shape to the tilde, which is "~".) When you draw the sine wave, go all the way to the top of the paper, all the way to the bottom, so that it totally covers the sheet of notebook paper (from left to right also).
  4. Take note of where the sine wave intersects the vertical lines on the paper.
  5. Now, take a piece of tracing paper and place it over the sheet containing your sine wave.
  6. Mark on the tracing paper with a pencil, each of the points where the sine wave intersects a vertical line.
  7. Now "connect the dots" by drawing a line between each pair of consecutive intersection points.
  8. Now remove the tracing paper from the notebook paper and look at it.

You'll notice that the connected dots on the tracing paper are a very good representation of the sine wave you initially drew. The number of lines on the paper represents the "sample rate" of your sampling effort. As you can readily imagine, the more vertical lines on the paper, the better the approximation, but also the more work for you to do!

A single sine wave has one peak and one valley: one cycle. If we imagine that that sine wave is a sound that occured in one second of time, then the frequency of that sine wave is one cycle per second; the unit of measure for frequencies is Hertz or Hz, so that sine wave is 1 Hz. All sounds are composed of mixtures of sine waves of different frequencies. High-pitched sounds have higher frequencies, and low-pitched sounds lower frequencies. The minimum sampling rate to reproduce a signal is twice the wave form's original frequency. Consider the experiment above, but pretend that instead of say, 30 lines on the sheet, there were only two. How good an approximation would you have made? Or consider instead of a single sine wave on the sheet, a series of sine waves going from left to right ("~~~~~~"). If you sampled that higher frequency signal with the same number of samples, the higher the frequency increases, the worse your approximation will be.

A 30 Hz sampling rate for a 1 Hz signal is awesome. The problem with audio is that the frequencies you are dealing with are much higher than what we have been discussing here. Human voice ranges from about 50 Hz up to about 4 kHz (4,000 Hz); thus it is not surprising that telephones, designed to carry human voice, were designed to cover up to 8 kHz. The range of some musical instruments can reach 20 kHz, which is generally accepted as the highest frequency that human ears can discern. Therefore, to be able to capture these highest frequencies accurately, one must sample at least at double that rate. Unsurprisingly, again, compact disks are recorded at a sampling rate of 44.1 kHz. However, taking our paper example we did with a sampling rate of twice the wave form's frequency, you can see that this is not really very good! But the human ear is pretty forgiving of this sort of error, though you do get those hardcore audiophiles complaining of the lack of audio quality in CDs at higher frequencies. Me personally, my ear isn't anywhere nearly as discriminating, so CD quality sounds good to me. :^)

Note that sample rate can also be seen in other media as well. When you watch television, you are viewing a representation of what was at one point fluid, real-time motion (analog) in a discrete form. Standard television is 30 frames per second (fps). That means every second you see 30 pictures (or snapshots if you will) of the original scene. For the most part consecutive pictures are the same, except for very small differences. A hand is moving, a racecar is coming down the track, a bullet is shooting out of a gun etc.. They are all single pictures put together end after end at a certain speed which the human eye perceives as fluid motion. Now contrast this with older computer generated video formats (for example AVI files). Generally they were recorded at 15 fps. Although this is fast enough to provide a reasonable semblance of motion, it doesn't compare to the 30 fps of your TV. Motion picture movies are actually recorded at only 24 fps.

 

Intro Resolution
leftbutt.gif (1704 bytes) ritebutt.gif (1709 bytes)

 

pcwizess.jpg (8520 bytes)

* PCWize Award Winners *
Click either button to see the winners of these awards.

pcwizeww.jpg (8540 bytes)
Copyright © 1997-2009 Leif Gregory. TB Community | privacy policy | home | write me | advertise | about