knowledge-kitchen

Digital Audio - How Your Computer Interprets Sound

recording and emitting sounds that someone might want to listen to

  1. Overview
  2. Analog vs. Digital
  3. Audacity
  4. Conclusions

Overview

Concept

We will take a look at the nature of sound, how it exists in the physical world, and how it is recorded and emitted by contemporary computers.

What Is Sound

Sound is the perceptible sensation that animals have in response to cyclical vibrations of the air or other medium surrounding them.

If a tree falls in a forest and no one is around to hear it, does it make a sound?

-paraphrased from George Berkeley’s Treatise Concerning Human Knowledge, 1710

Good vibrations

The vibration of air (or other transmission medium) radiates outward from the source, creating waves of changes to the pressure and density of air particles.

Spherical compression of sound

Perception

In humans and other tetrapods, the vibrating air waves are channeled into the inner parts of the ear, where they cause a vibration of the eardrum, a.k.a. tympanic membrane, which in turn causes the vibration of the cochlea.

Fennec fox

Frequency and pitch

Different parts of the tympanic membrane vibrate in response to different frequencies of air vibration.

The limits of perception

The average human is capable of hearing frequencies betweeen 20Hz and 20,000Hz.

Analog vs. Digital

Analog

If one were to map the pressure variations in air of a single frequency of sound over time, it might look something like this:

Analog wave

Digital

A computer or other digital device has finite memory and storage, and can only do so many operations per second.

ADC and DAC

The conversion of an analog to digital signal is termed ADC, while the reverse is DAC.

Fidelity (lo-fi)

A low sample rate in ADC leads to a poor quality representation of the original waveform.

Digital wave

Fidelity (medium-fi)

A medium sample rate leads to an ok, but not great, quality representation of the original waveform.

Digital wave

Fidelity (hi-fi)

A high sample rate leads to a good quality representation of the original waveform.

Digital wave

Nyquist Shannon Theorum

Engineers named Harry Nyquist and Claude Shannon theorized and proved in 1928 and 1949, respectively, that in order to faithful reproduce a waveform, it had to be sampled at a rate at least twice its frequency.

Bit depth

In addition to sample rate, another factor in the faithful reproduction of an analog audio signal is the bit depth.

Bit depth (continued)

Fitting the amplitude of the analog signal into the available bit depth of a sample is termed quantization.

Bit depth

Audacity

Audio recording software

Audacity is a free, cross-platform, open source multi-track audio recording software.

The lame MP3 format

While editing audio tracks, Audacity and other multi-track audio tools, will save in their own proprietary “layered” formats.

MacOS Catalina (10.15) problems

Audacity currently will not be able to record audio if run on Mac’s Catalina OS (OSX 10.15). Fortunately, there is an easy workaround.

#!/usr/bin/env bash

# open Audacity from bash... otherwise it doesn't work on Mac Catalina
open /Applications/Audacity.app/Contents/MacOS/Audacity
chmod a+x audacity.command

Conclusions

We have now seen some of the conceptual details of how audio is stored and manipulated in a contemporary computer.