Digitizing Sound

Class Notes for High School Students

1. What Does “Digitizing Sound” Mean?

Digitizing sound means converting real-world sound into digital data that a computer can store, edit, send, and play back.

Real sound is analog. This means it changes smoothly and continuously. Computers, however, store information using numbers. To save sound on a computer, the sound must be converted into digital numbers.

Examples of digital sound include:

2. Analog Sound vs. Digital Sound

Analog Sound

Analog sound is continuous. It can have an unlimited number of possible values as it changes over time.

Examples of analog sound include:

Digital Sound

Digital sound is stored as a list of numbers. Each number represents part of the sound wave at a specific moment.

Examples of digital sound include:

Type Description Example
Analog Sound Smooth and continuous Live voice
Digital Sound Stored as numbers MP3 song
Analog Device Works with continuous signals Microphone
Digital Device Works with numbers and binary data Computer

3. How a Computer Records Sound

To record sound, a computer uses a device such as a microphone.

The basic process is:

  1. A sound wave reaches the microphone.
  2. The microphone detects changes in air pressure.
  3. The microphone changes the sound wave into an electrical signal.
  4. An analog-to-digital converter measures the signal many times per second.
  5. Each measurement is stored as a number.
  6. The numbers are saved as a digital audio file.
This process is called analog-to-digital conversion, or ADC.

4. Sampling

Sampling means measuring the sound wave at regular time intervals.

A computer cannot store every single point of a real sound wave. Instead, it takes many snapshots of the sound wave. Each snapshot is called a sample.

Think of sampling like a video.
A video does not record every moment continuously. It records many still images per second. When played quickly, those images look like motion. Sound works in a similar way.

5. Sampling Rate

The sampling rate is how many samples are taken each second. Sampling rate is measured in hertz, or Hz.

A sampling rate of 44,100 Hz means the computer records 44,100 samples every second.
Sampling Rate Meaning Common Use
8,000 Hz 8,000 samples per second Telephone-quality voice
22,050 Hz 22,050 samples per second Lower-quality audio
44,100 Hz 44,100 samples per second CD-quality audio
48,000 Hz 48,000 samples per second Video and film audio
96,000 Hz 96,000 samples per second Professional audio

Higher Sampling Rate

A higher sampling rate can capture higher frequencies and more detail.

Lower Sampling Rate

A lower sampling rate uses less storage but may sound less clear.

6. Nyquist Theorem

The Nyquist Theorem explains how fast sound must be sampled to accurately record a frequency.

A sound must be sampled at least twice as fast as the highest frequency being recorded.

Minimum Sampling Rate = 2 × Highest Frequency
Humans can usually hear up to about 20,000 Hz.

To record sounds up to 20,000 Hz:
2 × 20,000 = 40,000 Hz

This is why CD audio uses 44,100 Hz. It is slightly higher than 40,000 Hz.

7. Bit Depth

Bit depth controls how accurately each sample can represent the loudness of a sound.

Each sample is stored as a number. Bit depth determines how many possible values that number can have.

Bit Depth Number of Possible Values Common Use
8-bit 256 values Simple or low-quality audio
16-bit 65,536 values CD-quality audio
24-bit 16,777,216 values Professional audio

Higher Bit Depth

A higher bit depth can store more volume detail and usually sounds cleaner.

Lower Bit Depth

A lower bit depth stores less detail and can make audio sound noisy or rough.

8. Quantization

Quantization is the process of rounding each sound sample to the nearest digital value.

Since a real sound wave can have unlimited possible values, the computer must round the measurement to a value it can store.

Example:
If the real sound level is 8.7, but the computer can only store whole numbers, it may store 9.

That small difference is called quantization error.

9. File Size of Digital Audio

Digital audio files can become large because they store many samples per second.

The size of an uncompressed audio file depends on:

File Size in Bits = Sampling Rate × Bit Depth × Channels × Time in Seconds
Example:
A 10-second mono recording uses: 44,100 × 16 × 1 × 10 = 7,056,000 bits

To convert bits to bytes:
7,056,000 ÷ 8 = 882,000 bytes

So the file is about 882,000 bytes, or about 882 KB.

10. Mono and Stereo Sound

Mono

Mono sound uses one audio channel. A mono recording sends the same sound to all speakers or headphones.

Examples of mono audio include:

Stereo

Stereo sound uses two audio channels: left and right. Stereo can make sound feel like it is coming from different directions.

Examples of stereo audio include:

Audio Type Channels Description
Mono 1 One channel
Stereo 2 Left and right channels
Stereo files usually require about twice as much storage as mono files if all other settings are the same.

11. Digital-to-Analog Conversion

When a computer plays sound, it must turn digital numbers back into an analog signal. This process is called digital-to-analog conversion, or DAC.

The process is:

  1. The computer reads the digital audio file.
  2. The digital numbers are sent to a digital-to-analog converter.
  3. The converter changes the numbers into an electrical signal.
  4. A speaker or headphones use the signal to vibrate.
  5. The vibrations create sound waves in the air.

12. Audio Compression

Audio compression reduces the size of an audio file.

There are two main types of audio compression:

13. Lossless Compression

Lossless compression reduces file size without permanently removing audio information. When the file is opened or played, the original audio data can be restored.

Examples of lossless formats include:

Advantages

Disadvantages

14. Lossy Compression

Lossy compression reduces file size by permanently removing some audio information. It tries to remove sounds that people are less likely to notice.

Examples of lossy formats include:

Advantages

Disadvantages

15. Common Audio File Formats

Format Compression Type Common Use
WAV Usually uncompressed High-quality recording and editing
AIFF Usually uncompressed Apple professional audio
FLAC Lossless compressed High-quality music storage
MP3 Lossy compressed Music and podcasts
AAC Lossy compressed Streaming, phones, videos
OGG Lossy compressed Games and open-source projects

16. Bit Rate

Bit rate measures how much data is used each second of audio. Bit rate is usually measured in kilobits per second, or kbps.

Bit Rate Common Quality
64 kbps Low-quality voice
128 kbps Acceptable music quality
192 kbps Good music quality
320 kbps High-quality MP3 audio

17. Digital Sound in Games and Apps

Digital sound is important in computer science, games, and app development.

Games use digital audio for:

Examples:

18. Problems in Digital Audio

Clipping

Clipping happens when a sound is too loud for the system to record or store correctly. The top or bottom of the wave gets cut off. Clipping usually sounds distorted or harsh.

Noise

Noise is unwanted sound in a recording.

Examples of noise include:

Aliasing

Aliasing happens when the sampling rate is too low to correctly represent a sound frequency. This can cause false or incorrect sounds in the recording.

Aliasing can be reduced by using a higher sampling rate or filtering out frequencies that are too high.

19. Why Digitizing Sound Matters

Digitizing sound allows people to:

20. Key Vocabulary

Term Meaning
Analog Sound Sound that changes smoothly and continuously
Digital Sound Sound stored as numbers
Digitizing Converting analog information into digital data
Microphone Device that detects sound vibrations
ADC Analog-to-digital converter
DAC Digital-to-analog converter
Sample One measurement of a sound wave
Sampling Measuring a sound wave at regular intervals
Sampling Rate Number of samples taken per second
Hertz Unit that means cycles or samples per second
Bit Depth Number of bits used to store each sample
Quantization Rounding analog values to digital values
Quantization Error Small difference caused by rounding
Channel One stream of audio data
Mono Audio with one channel
Stereo Audio with two channels
Compression Reducing file size
Lossless Compression Compression that keeps all original data
Lossy Compression Compression that permanently removes some data
Bit Rate Amount of audio data used per second
Clipping Distortion caused by audio being too loud
Aliasing Error caused by sampling too slowly

21. Main Ideas to Remember