Digitized Sound
Digitized Sound: understanding samples, rates and digital audio is really pretty simple.
~ Aristotle Sabouni
Created: 2002-10-21 |
Pressure waves[edit | edit source]
In space (a vacuum) no one can hear you scream because there is no medium (matter) to transmit the vibrations/pressure. Underwater, sound (and sonar) travels much further and better, because there is more medium (matter) to transmit those vibrations and pressure.
Let's look at digitized sounds.
Digitization is another word for sampling[edit | edit source]
What computers (and CD's, telephones, record players, etc.) do, is capture those pressure waves. They use a microphone to convert pressure (sound waves) to electrical current, then sample that current level many times each second. This is called sampling. It is also converting a sound wave into first an analog signal, and then converting that into digital form -- so it is also called Digitization.
Once a sound is sampled (or digitized) we can then send those same voltages out, at the same rate as they were brought in, using a speaker to convert electricity back to pressure waves (which vibrates a cone to push air). Viola, the same sound that came in, is reproduced and sent back out. A speaker is just a device that uses an electric current (and a magnet) to move in and out based on the voltage. This pushes air (accurately) to recreate the pressure waves (sounds). An amplifier is just a device that can power a speaker.
Technically many non-computer devices (phone, radio, tape player, etc.) don't "sample" at discrete points -- they capture the entire wave using "analog" techniques and record that. But these devices aren't perfect, and a little noise (errors in the signal) get introduced each time. Each generation of copy (analog) loses a little bit more quality -- while digitizing can recreate the exact same level every time, so does not lost quality. |
A sound wave is drawn as a two dimensional wave -- with pressure (y axis) over time (x axis). The pressure vibrates quickly, and has little peaks and valleys. From one peak to the next peak is the frequency of those sound waves.
The two key parameters in sampling are Sample Rate and Sample Size (resolution).
Sample Rate[edit | edit source]
The faster a sound is sampled (and played back at the same rate), the better the quality of the reproduced sound. Since the ear can only hear certain frequencies, it only makes sense to sample to a certain point.
Humans can hear sound frequencies from around 16hz (a wave that vibrates about 16 times a second) up to around 20Khz (a wave that vibrates 20,000 times per second). Women can usually hear slightly higher pitched sounds than men, but all people have different hearing.
To be able to reproduce a sound wave, you must sample that sound at least twice as fast as the frequency you are reproducing (so that you will get both a high point, and a low point on that wave). Computers and CD's sample sound at about 44Khz, or a little more than 2 times 20Khz (the highest frequency we can hear). At this sample rate, the computer can reproduce about any sound the human can hear.
Phones sample sounds at around 8 KHz, and humans can easily recognize voices and music across a phone line; but humans can also tell that it doesnít sound very good (they can hear the distortion and that there are parts missing).
To be real pedantic, older phones don't technically "sample" sounds digitally -- but they do chop up the sound (multiplex) it -- which is the analog equivalent of sampling. Same effect, only the process is a little different. |
Sample Size[edit | edit source]
This is the quality of each sample we take. If each time we sample the sound we use 8 bits (256 levels), then that is pretty fine resolution -- but not enough for what we call "high fidelity". Compact Discs sample at 16 bits (65,536 levels) -- this is very good, and allows a sound wave to be a better reproduction.
Some PC cards use the term "32 bit sound card" -- they are NOT talking about the sample size, they are talking about the size of the path (I/O Bus) from the sound card to the rest of the computer. The sound quality is the exact same, it is just that the sound card can move the sound around faster, or with less overhead (time); leaving more for the game or other processing.
Sample Size not only affects the quality of the wave, it also determines the dynamic range of the recording; the difference between the quietest and the loudest sound. Eight bit sound provides approximately 48 decibels (dB) of dynamic range. Sixteen bit sound provides about 96 dB of dynamic range. Humans can hear up to 100 dB of dynamic range.
Conclusion[edit | edit source]
There is a lot of different factors in the quality of the sound created by computers. Sample Rate and Sample Size are important -- but the recreated wave can almost never be an exact duplicate of the original. Notice, that in the following drawing, the original wave is sampled at discrete points. When the sound is recreated (by connecting the dots between the samples) we get a wave that looks similar to, but is not exactly like, the original.
Fortunately most of this loss (error) is out of the range of human hearing. Most of the loss is at the higher frequencies, and very small differences -- and the real differences are not usually as large as my example.
Sample Rate and Sample Size are fairly standardized -- at 44KHz, 16 bit, stereo; two channels, one for the left and one for the right in order to give us a sense of direction as to where the sound is coming from. Most of the difference remaining between sound on various computers, is the quality of the components used. The amplifiers, speakers, and protection against interference (shielding from other electronic components) is what makes up most of the perceivable difference.
There really isnít that much to understanding the basics of sound. In concept, it is very simple stuff. The complexity is that to accurately recreate sound, there are many variables, and learning the voodoo between making music, and making noise, is where all the art and science is.
👁️ See also
- Anti-aliasing - What is Anti-Aliasing? It is using color to increase the percieved resolution on a display.
- Basics of BASIC - People ask me, "How do I get started programming?" Ther are a lot of choices, but BASIC is a pretty simple start.
- Big or Little Endian - What is Endian? How do you like your eggs (or counting systems)? Big or little end up?
- Command Line Interface - There is an ancient computer debate about command-lines versus a GUI (Graphical User Interfaces).
- Databases - What is a database? What are the kinds of databases? Why do you care?
- Digitized Sound - Digitized Sound: understanding samples, rates and digital audio is really pretty simple.
- Enterprise Tools - Enterprise, Opensource or Commercial tools, which is better and why? Of course the answer is, "it depends".
- FUD - FUD means "Fear, Uncertainty and Doubt", it was used by big companies to scare users away from small companies.
- Forward Compatibility - People talk about "Backwards" compatibility, but Forward Compatibility is often more important.
- Free Features - A free feature in software, is like a free lunch: and in case you don't know, there's no such thing as a free lunch.
- Hiring Programmers - Many Human Resources and Managers, don't know how to hire or utilize programmers; proven by their job reqs.
- History of Visual Basic - The History of Visual Basic is a bit of a history of early computers and Microsoft...
- How does compression work? - How does software Compression work? How do you make something smaller?
- MHz or GHz - MHz or GHz, what does it mean? It's just clock speed - but that doesn't mean what some people think.
- RISC or CISC - During the 80s and 90s there was a Computer Chip design war about RISC or CISC.
- Raster Images - What exactly does raster versus vector images mean? Here's the very basics of pictures or rasterized images.
- Software Consultants - I worked over a decade as a consultant, and used and managed them for a couple decades more.
- Software Development Life Cycle - There's a lot of variants of a Software Development Life Cycle.
- Synthesized Sound - Synthesized Sound is just making waves... sound waves.
- UNIX - UNIX is the old war-bird of Operating Systems -- which is ironic as it isn't an OS any more -- but more on that later.
- What is MP3? - What is MP3? It's just a compressed file format used for sound (that came from MPEG's version 3).
- What is a WebApp? - What is a Web Application, and how does it vary from a traditional website?
- Why is software so buggy? - Why are programs so buggy? They're not bugs, they're undocumented features... sorry, that's an old programmer joke.
🔗 More
| |
| |
Tags: Tech Programming