What is Compression in Digital Audio?
In the days of analog audio recording and playback, audio information had quite a different form factor from what we see now. Music was stored as physically cut grooves on vinyl, or as magnetized dust on a cassette player.
These days, audio information is stored and conveyed like everything else in our digital lives: in binary, with 1’s and 0’s. Putting the nostalgia some may feel for the old analog aside, it’s likely an understatement to say that the digitization of audio has led to increased flexibility and versatility in how we can record, store, transmit, and listen to music.
In this article, we’re going to narrow our focus down to one revolutionary facet of digital audio that makes it entirely distinct from analog formats: compression. Let’s take a look at what digital audio compression is, how it works, and the role it plays in our everyday streaming and Bluetooth audio experiences.
What is Compression?
Within the framework of audio codecs, compression refers to the algorithmic summarization of digital audio information. In other words, compressed audio is basically audio that has been reformatted from its original source (such as the uncompressed files created and used by a recording engineer) and put into a ZIP file-like container known as an audio codec. Compressed audio codecs result in much smaller file sizes and data packets.
It’s very important to note that this definition of compression is distinct from volume dynamics-oriented compression in analog audio contexts.
Types of Compression
There are three ways to classify an audio codec’s relationship with compression:
- Uncompressed lossless: Audio information is encoded exactly as it is found in an original digital source with no compression. No decoding is required. Codec Example: WAV files
- Compressed lossless: Audio information is encoded in an abbreviated form, but transmits the full scale of information from an original uncompressed digital source once decoded. Codec Example: FLAC files.
- Compressed lossy: The “unimportant” parts of audio information are discarded, and the remaining audio information is encoded in an abbreviated form. The full scale of audio information of an original digital source is not replicated once decoded, which results in a loss of audio information. However, it is more data efficient than uncompressed or compressed lossless audio. Codec Example: MP3’s, and all Bluetooth codecs currently in existence.
Let’s use an example of buying a couch from Ikea to illustrate the differences between these three compression classifications:
- Uncompressed lossless is like getting in-store assembly service, where you would need to strap the whole couch to the roof of your car to bring it home.
- Compressed lossless is like getting at-home assembly service, where the couch is transported as individual pieces but fully constructed once it arrives at your house.
- Compressed lossy is like ordering the couch disassembled, assembling it yourself at home, then finding 10 extra screws you were supposed to use despite the fact that you're now comfortably sitting on a functioning couch.
Well, let me add the addendum that lossy audio compression algorithms are more calculated than someone forgetting to use all the screws that Ikea gave them. They’re designed to use psychoacoustic concepts to determine which information will be imperceptible to a listener. For example, audio information that (ideally) falls above 20 kHz will be discarded in lossy compression, as 20 kHz is the upper threshold of human hearing.
Audio Compression in Music Streaming Services
Music streaming services have fully capitalized on the data efficiency offered in compressed audio.
It’s no exaggeration to say that every song in their libraries has been compressed in some form. The reason for this is that compressed lossless audio offers the same high-fidelity specs as uncompressed audio, but consumes far less bandwidth. Music streaming services that advertise “Lossless” quality in their catalog are in fact referring to lossless compression.
However, if you select a “data efficient” setting in your streaming service, or use Spotify, lossy compression codecs like AAC, OGG, or MP3 are used instead of lossless compression codecs like FLAC or ALAC. While this results in lower bitrates, and thus a loss of audio information, lossy compressed streams consume far less bandwidth on your data plan - and it takes a highly discerning ear to hear a difference anyway.
Bluetooth Audio Compression
Wireless earbud and headphone manufacturers (guilty as charged) also rely on lossy compression codecs in their Bluetooth products. Whether you’re using SBC, AAC, AptX Adaptive or LDAC codecs with your preferred wireless products, you’re listening to lossy compression.
To date, there is no lossless compression algorithm for Bluetooth audio. Lossy codecs are sent over Bluetooth by an audio source, then decoded by a soundcard in the wireless device, and converted into an analog audio signal.
Conclusion
Lossy and lossless digital compression algorithms are responsible for the modern audio conveniences that we often take for granted. They’re responsible for the music we stream, and the wireless ear gear we use.
If you’re interested in peeking deeper under the hood of digital audio, check out our article explaining bit depth and sample rate.