SS Notes
Complete guide to audio signal processing — sampling, filtering, effects, compression, and real-time implementation.
Introduction
Audio signal processing is one of the most fascinating and tangible applications of signals and systems theory. Every time you listen to music on your phone, make a voice call, use noise-canceling headphones, or record a podcast, you are experiencing the results of sophisticated signal processing algorithms working behind the scenes. For us engineers, understanding audio DSP brings together sampling theory, filter design, spectral analysis, and real-time system implementation into a single, rewarding domain.
Sound itself is a continuous-time pressure wave propagating through air. When a microphone captures this wave, it converts pressure variations into an analog electrical signal. The journey from that analog signal to the processed digital audio you hear involves every concept we study in signals and systems.
The Audio Processing Chain
The typical audio processing pipeline follows this flow:
Acoustic Source → Microphone → Preamplifier → Anti-Aliasing Filter → ADC → Digital Processing → DAC → Reconstruction Filter → Amplifier → Speaker
Each stage involves specific signal processing concepts. The anti-aliasing filter is a low-pass filter that prevents frequencies above the Nyquist limit from causing aliasing. The ADC performs sampling and quantization. The digital processing stage is where the real magic happens — filtering, effects, compression, analysis, and synthesis all occur in the discrete-time domain.
Sampling and Quantization for Audio
Human hearing spans approximately 20 Hz to 20 kHz. According to the Nyquist-Shannon sampling theorem, we must sample at a rate greater than twice the highest frequency present:
$$f_s > 2 \times f_{max} = 2 \times 20{,}000 = 40{,}000 \text{ Hz}$$
Standard sampling rates in the industry include:
- 44.1 kHz: The CD standard, derived from early digital recording equipment linked to video frame rates
- 48 kHz: Professional audio and video production standard
- 96 kHz and 192 kHz: High-resolution audio formats used in mastering studios
For bit depth, which determines the dynamic range and quantization noise floor:
$$\text{Dynamic Range (dB)} = 6.02 \times N + 1.76$$
where $N$ is the number of bits. So 16-bit audio gives approximately 96 dB dynamic range, 24-bit gives about 144 dB, and 32-bit floating point provides essentially unlimited headroom for internal processing.
The quantization signal-to-noise ratio for uniform quantization is:
$$\text{SNR}_{q} = 6.02N + 1.76 \text{ dB}$$
Filtering in Audio Applications
Equalization (EQ)
Equalization is perhaps the most ubiquitous audio processing operation. A parametric equalizer uses second-order IIR filters (biquad filters) with three adjustable parameters: center frequency $f_0$, gain $G$ in dB, and quality factor $Q$ (which controls bandwidth).
The transfer function of a second-order peaking EQ filter is:
$$H(z) = \frac{1 + \alpha A \cdot z^{-1} + (1-\alpha) z^{-2}}{1 + \alpha/A \cdot z^{-1} + (1-\alpha) z^{-2}}$$
where $A = 10^{G/40}$ and $\alpha = \sin(\omega_0)/(2Q)$ with $\omega_0 = 2\pi f_0/f_s$.
Crossover Networks
Multi-way speaker systems require crossover filters to split audio into frequency bands — low frequencies for the woofer, midrange for the mid driver, and high frequencies for the tweeter. Butterworth or Linkwitz-Riley filter designs are common, and linear-phase FIR implementations are preferred to avoid phase distortion at crossover frequencies.
De-essing and Noise Reduction
De-essing applies frequency-selective compression to sibilant frequencies (typically 4–8 kHz) to reduce harsh "s" and "sh" sounds in vocal recordings. Spectral subtraction is a noise reduction technique where:
$$\hat{X}(\omega) = X(\omega) - \alpha \cdot N(\omega)$$
Here, $N(\omega)$ is the estimated noise spectrum (captured during silence), and $\alpha$ is an oversubtraction factor.
Audio Effects: Time-Domain Processing
Delay and Echo
The simplest audio effect is delay, implemented using a circular buffer:
$$y[n] = x[n] + g \cdot x[n - D]$$
where $D$ is the delay in samples and $g$ is the feedback gain. For a delay time of $T$ seconds at sample rate $f_s$, we need $D = T \cdot f_s$ samples.
Reverberation
Reverb simulates room acoustics. A convolution reverb computes:
$$y[n] = \sum_{k=0}^{N-1} h[k] \cdot x[n-k]$$
where $h[n]$ is a measured room impulse response (RIR), often containing 50,000 to 200,000 samples. This is computationally expensive, so the FFT is used for fast convolution — the signal and impulse response are transformed, multiplied in the frequency domain, and inverse-transformed.
Chorus and Flanger
These effects use modulated delay lines where the delay time varies sinusoidally:
$$y[n] = x[n] + g \cdot x[n - D(n)]$$
$$D(n) = D_0 + A \sin(2\pi f_{mod} \cdot n / f_s)$$
Flanger uses short delays (1–10 ms) creating a sweeping comb-filter effect. Chorus uses longer delays (20–50 ms) simulating multiple slightly detuned voices.
Dynamic Range Processing
Compression
A compressor reduces the dynamic range by applying gain reduction when the signal exceeds a threshold:
$$G_{dB} = \begin{cases} 0 & \text{if } x_{dB} < T \\ (1 - 1/R)(T - x_{dB}) & \text{if } x_{dB} \geq T \end{cases}$$
where $T$ is the threshold in dB and $R$ is the compression ratio. Attack and release times control how quickly the gain adapts, implemented as a first-order IIR smoothing filter on the gain signal.
Limiting and Noise Gating
A limiter is a compressor with an infinite ratio — it absolutely prevents the output from exceeding a ceiling level. A noise gate is the inverse: it attenuates the signal when it falls below a threshold, useful for removing background noise during silent passages.
Lossy Audio Compression (Perceptual Coding)
MP3 and AAC codecs exploit psychoacoustic masking — the phenomenon where loud sounds make nearby quieter sounds inaudible. The encoding process involves:
- Divide audio into frames of 576–1024 samples
- Apply the Modified Discrete Cosine Transform (MDCT) to convert to frequency domain
- Use a psychoacoustic model to calculate the masking threshold at each frequency
- Quantize frequency coefficients, allocating more bits to audible components
- Apply entropy coding (Huffman) for further compression
The result: CD audio at 1.41 Mbps is compressed to 128–320 kbps with minimal perceptible quality loss. The MDCT is related to the standard DCT and provides critical sampling (no redundancy) with perfect reconstruction.
Real-Time Constraints and Implementation
Audio DSP must operate in real-time. If the buffer size is $B$ samples at sample rate $f_s$, all processing must complete within:
$$T_{buffer} = B / f_s$$
For a typical buffer of 256 samples at 48 kHz, that gives approximately 5.3 milliseconds. This constraint drives the choice of algorithms — IIR filters are preferred over long FIR filters when latency is critical, and look-ahead techniques must be carefully balanced against delay.
Key Takeaways
- Audio DSP operates at 44.1–192 kHz sample rates with 16–32 bit depth, dictated by human hearing limits and the Nyquist theorem
- Equalization uses cascaded biquad IIR filters with adjustable frequency, gain, and Q
- Time-domain effects like delay and reverb use circular buffers and convolution
- Dynamic processors (compressor, limiter, gate) control gain based on signal level envelope
- Lossy compression uses psychoacoustic masking and the MDCT to discard imperceptible spectral data
- All processing must complete within one buffer period for real-time operation
- The FFT enables efficient convolution for long impulse responses (convolution reverb)
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Audio Signal Processing.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Signals & Systems topic.
Search Terms
signal-systems, signals & systems, signal, systems, applications, audio, processing, audio signal processing
Related Signals & Systems Topics