No history yet

Transduction and Sampling

From Air to Wire

Sound is a physical phenomenon—a wave of pressure moving through a medium like air. For a computer to process sound, that physical wave must first be converted into an electrical signal. This crucial first step is called transduction.

A microphone is a transducer that performs this job. Inside a typical dynamic microphone, a diaphragm is attached to a coil of wire suspended in a magnetic field. When sound waves hit the diaphragm, it vibrates. This movement causes the coil to move back and forth within the magnetic field, which induces a small electrical current in the wire. The voltage of this current mirrors the pressure variations of the original sound wave. A loud sound creates a large voltage fluctuation, while a quiet sound creates a small one. The result is a continuous analog electrical signal—a faithful voltage-based replica of the sound wave.

The Digital Leap

This analog signal is continuous in both time and amplitude, but computers don't work with continuous information. They operate on discrete numbers: ones and zeros. To bridge this gap, the analog signal must be digitized by an Analog-to-Digital Converter, or ADC. An ADC performs two fundamental operations: sampling and quantization.

Sampling captures the signal's value at discrete moments in time, while quantization maps its continuous amplitude to a finite set of discrete values.

Catching the Wave

Sampling is like taking a series of snapshots of the analog waveform. The rate at which these snapshots are taken is called the sampling rate, measured in Hertz (Hz). For example, a common sampling rate for music is 44,100 Hz, meaning the ADC measures the voltage 44,100 times every second. But how do we know if that's fast enough?

The provides the mathematical answer. It states that to perfectly reconstruct a signal, the sampling rate (fsf_s) must be at least twice the highest frequency (fmaxf_{max}) present in the signal. Humans can hear frequencies up to about 20,000 Hz. Therefore, to capture the full range of human hearing, a sampling rate of at least 40,000 Hz is required.

fs2fmaxf_s \ge 2f_{max}

Failing to meet this condition causes a distortion known as aliasing. When the sampling rate is too low, high frequencies in the original signal get 'folded down' and impersonate lower frequencies in the digital version. The result is a strange, often dissonant artifact that wasn't present in the original sound.

Lesson image

To prevent this, ADCs use an anti-aliasing filter before sampling. This is a low-pass filter that simply removes any frequencies above the Nyquist frequency (half the sampling rate). This ensures that no frequencies exist in the signal that are too high for the chosen sampling rate to capture correctly.

From Snapshots to Numbers

After sampling captures the voltage at a specific moment, quantization assigns a numerical value to that voltage. This process involves rounding the continuous amplitude of each sample to the nearest value on a predefined scale. The number of available values in this scale is determined by the bit depth. A 16-bit system, for example, has $2^{16}$ or 65,536 possible values. A 24-bit system has over 16 million.

The small difference between the actual sample's amplitude and its rounded, quantized value is called quantization error or quantization noise. A higher bit depth provides more quantization levels, resulting in smaller rounding errors and a more accurate representation of the original signal. This increased accuracy translates to a higher signal-to-noise ratio and a greater dynamic range.

The process of converting an analog signal to discrete in time signal is called as ‘sampling’ and the process of converting it to a discrete in amplitude signal is called ‘quantization’.

The final step is encoding. The sequence of quantized numerical values from each sample is represented as a stream of binary data. The most common method for this is Pulse-Code Modulation (PCM). In PCM, each sample's amplitude is simply stored as a binary number. This raw, uncompressed stream of data is what you find in file formats like .WAV or .AIFF. Every subsequent digital process, from equalization to reverb, operates on this stream of numbers that began as a simple vibration in the air.

Quiz Questions 1/6

What is the primary function of a microphone in the process of recording sound?

Quiz Questions 2/6

According to the Nyquist-Shannon sampling theorem, what is the minimum sampling rate required to accurately capture a signal that contains frequencies up to 15,000 Hz?