Welcome back to our series on the journey from sound waves to software. We’ve already explored Sampling (how we capture time) and Quantization (how we capture amplitude). Now, it’s time for the final piece of the puzzle: Encoding.
Encoding
If sampling and quantization are the process of taking measurements, encoding is the process of translating those measurements into a language a computer actually understands: binary (ones and zeroes).

This is a crucial step in the analog to digital transformation, where quantized values are converted into binary code that form the digital representation of the original signal.
This process prepares the data for storage, transmission, or further processing, ensuring compatibility with computational systems and efficient handling of information. By bridging the gap between continuous analog signals and discrete digital formats, encoding preserves the integrity of the data while optimizing it for use in modern applications. In this chapter, we explore how encoding transforms raw quantized values into structured digital formats, laying the foundation for everything from audio and video processing to communication systems and machine learning.
Pulse-Code Modulation (PCM)
This is the next step after sampling and quantization, where the quantized values are encoded into binary code — sequences of 0s and 1s — that form the digital representation of the original analog signal. PCM is an uncompressed encoding method that preserves the integrity of the audio data, making it suitable for high-fidelity applications.

How does it work?
In PCM, the quantized amplitude values obtained from the previous steps are converted into binary numbers. Each value is encoded based on the chosen bit depth (e.g., 16-bit or 24-bit), which determines the resolution of the audio. The resulting binary sequence represents the sampled signal in a format that computers can store, process, or transmit.
Applications of PCM.
- Computer audio: WAV and AIFF Files: These file formats use PCM to store uncompressed audio.
- DAWs
- Audio CDs
- Digital Video (DVDs, Blue-Ray disc, Laserdisc)
- Broadcasting and Telephony: PCM ensures reliable audio transmission in professional and communication systems.
Example: Let’s calculate the bitrate of the file created with PCM at 44.1 kHz with 16-bit depth for high-quality stereo sound.
Bitrate (bps) = Sample Rate (Hz) × Bit Depth (bits) × Number of Channels Bitrate = 44100 x 16 x 2 = 1,411,200 bps = 1,411.2kbps.
Now let’s calculate the CD size of 10 songs, each 5 minutes long.
Size (bits)=Bitrate × Duration (seconds).
Size (bits)=1,411,200bps×300=423,360,000bits.
Size (bytes)= 423,360,000/8 = 52,920,000bytes
Size (MB) =52,920,000 / 1,048,576 ≈ 50.46MB.
Conclusion
PCM bridges the gap between quantization and digital storage or processing by encoding quantized values into binary form. Its uncompressed nature ensures maximum fidelity, making it a cornerstone of digital audio systems used in professional recording, broadcasting, and archival applications. The disadvantage is the large space or bandwidth needed for the file storage or transmission of the stream.
Lossless compression
Formats, such as FLAC and ALAC, reduce file size without sacrificing quality, appealing to audiophiles and storage-conscious users. While FLAC remains the most popular due to its open-source nature and broad compatibility, other formats like ALAC cater to specific ecosystems such as Apple devices. Each format serves distinct use cases depending on compatibility, efficiency, and hardware requirements.
Lossy compression
Formats, including MP3 and AAC, achieve significant file size reduction by discarding less perceptible audio data, making them perfect for streaming and casual listening. Each encoding type serves different needs, balancing quality, efficiency, and practicality.

MP3 (MPEG-1 Audio Layer III) is a widely used lossy audio compression format that revolutionized digital music by significantly reducing file sizes — up to 90% smaller than uncompressed formats like WAV — while maintaining reasonable sound quality. It achieves this through psychoacoustic principles, discarding inaudible or masked sounds, and using techniques like Fourier transforms for spectral analysis and Huffman coding for efficient data storage.

Psychoacoustics
With customizable bitrates ranging from 128 kbps (standard quality) to 320 kbps (near-CD quality), MP3 balances fidelity and storage efficiency, making it ideal for music distribution, streaming, and portable devices. Despite sacrificing audio quality permanently during compression and being surpassed by modern codecs like AAC, MP3 remains a cornerstone of digital audio history due to its universal compatibility, transformative impact, and widespread adoption.

Storage and Transmission
Once digital audio data is encoded, it enters the realms of storage and transmission. For storage, various container or wrapper formats like WAV and AIFF are commonly used to hold the raw or compressed digital audio along with metadata. These formats ensure compatibility with different audio software and hardware.
For transmission, digital audio is the backbone of modern audio delivery. It is streamed over networks using protocols such as Dante, particularly in professional audio and broadcasting environments, leveraging IP networks for low-latency, high-quality transport. Furthermore, digital audio is the core component of podcasts, where encoded audio files are stored on servers and distributed to listeners on demand via the internet. Similarly, digital radio platforms utilize digital transmission methods to broadcast audio content to a wider audience, often offering higher fidelity and more features than traditional analog radio. Digital audio also plays a fundamental role as the voice component in call establishment and media exchange within IMS (IP Multimedia Subsystem) services, enabling voice calls over IP networks. A significant advantage of digital transmission is its ability to maintain minimal signal degradation over long distances. This ensures that the audio quality remains high from source to destination. Moreover, digital formats allow for efficient routing and scalability, which are crucial for broadcasting applications, managing large-scale live sound events, and distributing content to numerous podcast listeners or digital radio users simultaneously. We will delve deeper into the intricacies of these storage formats, transmission protocols, and their specific applications, including podcasting and digital radio, in subsequent chapters.




