Time Domain Audio Processing
Open in the Padhaiko app2.1 Discrete time audio signal, basic signal operations, system in time domain
When analog sound is sampled at rate (with period ), it becomes a discrete-time audio signal , defined only at integer sample indices . Every digital audio effect, synthesizer, and analyzer begins by manipulating sequences of samples directly in the time domain.
Elementary Discrete-Time Signals
Three canonical sequences serve as building blocks in discrete-time audio analysis:
- Unit Impulse (Kronecker Delta) :
Any arbitrary signal can be decomposed as a weighted sum of shifted impulses: .
- Unit Step :
- Discrete-Time Sinusoid:
where is the normalized digital angular frequency (with corresponding to the Nyquist frequency ).
Basic Signal Operations in Audio
Let , , and be discrete-time audio signals:
| Operation | Mathematical Form | Audio / DSP Interpretation |
|---|---|---|
| Gain (Scaling) | Volume control; . If , polarity inversion ( phase flip) | |
| Mixing (Addition) | Summing tracks on a mixer bus or adding dry and wet signals | |
| Modulation (Multiplication) | Amplitude / Ring modulation (creates sum and difference sidebands) and windowing | |
| Time Shifting (Delay) | () | Pure delay of samples ( seconds); building block of echo, chorus, and FIR filters |
| Time Reversal | Playing a sample backward (reverse reverb / tape reverse effect) | |
| Time Scaling (Resampling) | or | Downsampling by (speed-up / requires anti-aliasing) or upsampling by (interpolation) |
Systems in the Time Domain
A discrete-time system maps an input sequence to an output sequence . Five structural properties govern how audio systems behave:
Core Properties of Discrete-Time Systems
- Linearity: A system satisfies superposition (additivity + homogeneity) if for all inputs and constants :
Note: Non-linear audio processors (distortion, hard clippers, compressors) violate linearity and introduce new harmonics.
- Time-Invariance: Shifting the input by samples produces the exact same output shifted by :
Note: Time-varying effects like flangers, phasers, or LFO-modulated filters are time-variant.
- Causality: Output at sample depends only on present and past inputs for (never future samples ). Real-time audio systems must be causal; offline mastering limiters can use look-ahead (non-causal relative to a delay buffer).
- Memoryless vs. With Memory: Memoryless systems depend only on (e.g., pure gain ); filters, delays, and reverbs require memory buffers.
- BIBO Stability: Every bounded input () guarantees a bounded output ().
A system that is both Linear and Time-Invariant is an LTI system—the foundation of digital filtering, equalization, and convolution reverb.
2.2 Convolution and impulse response
An LTI system is completely characterized in the time domain by its impulse response , defined as the system's output when excited by a unit impulse :
Discrete-Time Linear Convolution
Because any input is , linearity and time-invariance immediately yield the convolution sum:
For a causal finite-length input of length (indices ) and causal impulse response of length (indices ), the output sequence has length:
Furthermore, an LTI system is BIBO stable if and only if its impulse response is absolutely summable:
Algebraic Properties and System Connections
- Commutativity: (input and system impulse response can swap roles).
- Associativity (Cascaded Systems): Two LTI systems in series with and act as a single system with .
- Distributivity (Parallel Systems): Two LTI systems in parallel sum to .
Audio Application: Room Impulse Response (RIR) and Convolution Reverb
In acoustic engineering, a physical concert hall, church, or guitar speaker cabinet acts closely like an LTI system. Capturing its Room Impulse Response (RIR) —either by firing a short broadband impulse (starter pistol / balloon pop) or deconvolving a logarithmic sine sweep—records the direct sound, early reflections, and late diffuse reverberation tail. Convolving a dry studio vocal or instrument recording with reproduces how that dry audio would sound inside the measured space.
2.3 Analog and digital filters in audio systems
Audio filters selectively attenuate or boost specific frequency bands—performing equalization (EQ), loudspeaker crossovers (splitting bass, midrange, and treble), DC removal, anti-aliasing, and tone shaping.
| Aspect | Analog Audio Filters | Digital Audio Filters |
|---|---|---|
| Physical Implementation | Resistors, capacitors, inductors, operational amplifiers | Arithmetic logic (multipliers, adders, delay registers ) in DSP/CPU |
| Precision & Drift | Subject to component tolerances (), temperature drift, and aging | Exact, repeatable mathematical coefficients; zero thermal drift |
| Linear Phase | True constant group delay (linear phase) is impossible in causal passive filters | Exact linear phase easily achieved via symmetric FIR coefficients |
| Dynamic Reconfiguration | Changing cutoff/Q requires potentiometers, switches, or VCAs | Trivial real-time coefficient updates (automated parametric EQ sweeps) |
| Dynamic Range / Noise | Limited by thermal Johnson noise and op-amp headroom; continuous bandwidth | Limited by ADC/DAC quantization noise and Nyquist ceiling |
General Difference Equation: FIR vs. IIR Filters
A causal LTI digital filter is governed by a constant-coefficient linear difference equation:
Depending on whether feedback coefficients exist, digital filters divide into two classes:
| Aspect | FIR (Finite Impulse Response) | IIR (Infinite Impulse Response) |
|---|---|---|
| Equation | (non-recursive; feed-forward only) | (recursive feedback) |
| Impulse Response | Finite duration ( taps: ) | Infinite duration (decays asymptotically toward zero if stable) |
| Stability | Always BIBO stable (no feedback poles) | Stable only if all poles lie strictly inside the unit circle () |
| Phase Response | Can be exact linear phase if (zero phase distortion) | Always non-linear phase (approximates analog Butterworth, Chebyshev, Bessel) |
| Computational Cost | High order required for steep cutoffs (hundreds of taps for bass EQ) | Very efficient: a single biquad () gives resonant LPF/HPF/peaking EQ |
Common Audio Filter Types
- Low-Pass Filter (LPF) & High-Pass Filter (HPF): Pass frequencies below or above a cutoff ( point). HPFs at remove stage rumble and DC offset; LPFs remove harsh ultrasonic hiss and provide anti-aliasing.
- Band-Pass (BPF) & Notch (Band-Stop) Filters: Isolate a frequency band (telephone effect, wah-wah) or surgically remove narrow hums ( mains hum or acoustic feedback ringing).
- Shelving Filters (Low/High Shelf): Boost or cut all frequencies below or above a corner frequency by a fixed dB gain (classic bass/treble tone controls).
- Peaking (Parametric EQ) Filter: Boosts or attenuates a bell-shaped region around center frequency with adjustable Gain () and Quality Factor () controlling bandwidth. Usually implemented with a -pole, -zero digital biquad section.
2.4 Temporal feature extraction
Before transforming audio into the frequency domain, many audio analysis systems extract temporal (time-domain) features directly from short overlapping frames of length samples (typically , where the signal is assumed quasi-stationary).
Core Time-Domain Audio Features
For a discrete audio frame :
- Short-Time Energy () and RMS Amplitude ():
Captures instantaneous signal loudness; used for silence detection, Voice Activity Detection (VAD), and onset detection.
- Zero-Crossing Rate (ZCR): The normalized rate at which the waveform changes sign across zero within the frame:
where for and for (so each sign flip adds inside , and dividing by normalizes ). Alternatively expressed in crossings per second as .
- High ZCR: Unvoiced fricative speech (
/s/,/f/), hi-hats, cymbals, white noise. - Low ZCR: Voiced vowels, bass guitar, kick drums, pure low-frequency tones.
- Short-Time Autocorrelation (): Measures self-similarity of a frame with a copy of itself delayed by lag samples:
At lag , (maximum energy). If is periodic with period seconds, exhibits a strong secondary peak at lag , yielding fundamental pitch estimate .
- Amplitude Envelope & Temporal Centroid: Smoothing (via peak-hold or leaky integrator) traces the Attack–Decay–Sustain–Release shape. Percussive instruments (snare, claves) have sharp attacks and low temporal centroids, whereas bowed strings have slow attacks and high temporal centroids.
Worked Examples
2.1
Consider the discrete-time audio echo system defined by the difference equation:
- Determine whether the system is linear, time-invariant, causal, and memoryless.
- Find its impulse response and verify BIBO stability.
- If the sampling rate is , what physical delay time (in ) does the first echo tap represent?
Testing system properties:
- Linear: Let . Then
Hence the system is linear.
- Time-Invariant: Replacing by gives . Hence time-invariant.
- Causal: depends only on , , and (present and past indices ). Hence causal.
- Memoryless: Because it uses delayed samples and , it has memory (not memoryless).
Impulse response and BIBO stability: Setting yields:
Summing the absolute values of :
Since the impulse response is absolutely summable (indeed finite-length FIR), the system is BIBO stable.
Physical delay of the first echo tap at :
- The system is linear, time-invariant, causal, and with memory (an LTI FIR system).
- , and , so it is BIBO stable.
- First echo tap delay ().
2.2
An audio frame () is passed through a short FIR filter with impulse response (). Compute the output sequence by linear convolution.
Determining output length: With and , the linear convolution has length:
Evaluating the convolution sum :
2.3
Given a short discrete audio frame of samples:
Calculate:
- The Short-Time Energy () and RMS amplitude ().
- The normalized Zero-Crossing Rate ().
- The Short-Time Autocorrelation values and .
Short-Time Energy and RMS amplitude:
Normalized Zero-Crossing Rate: Inspect consecutive sign transitions across the adjacent sample pairs:
- : sign change ()
- : sign change ()
- : same sign ()
- : sign change ()
- : same sign ()
Counting sign changes across transitions gives:
Autocorrelation and :
- ,
- ( crossings in transitions)
- ,
Exercises
Practice Exercises — Time Domain Audio Processing
Test the discrete-time audio system for linearity, time-invariance, causality, and memory. Explain why non-linear audio effects cannot be represented by an impulse response .
Linearity check: For , the output is:
Because , superposition fails. Thus the system is non-linear.
Time-invariance, causality, and memory:
- Time-Invariant: Delaying input to yields .
- Causal: depends only on and (no future indices).
- With Memory: Depends on the past sample .
Why impulse response does not characterize non-linear systems: Convolution relies on decomposing into scaled impulses and invoking linearity (superposition). Since a non-linear system violates superposition and generates new intermodulation/harmonic frequencies, its impulse response alone cannot predict its output for general inputs.
The system is non-linear, time-invariant, causal, and with memory. Because convolution requires superposition (linearity), an impulse response cannot fully characterize a non-linear system.
An audio filter has impulse response for and elsewhere.
- Compute the output when the input is for .
- Verify whether the filter is BIBO stable.
Listing and finding output length: (), and (). Output length is ().
Computing the convolution sum :
BIBO stability check:
Thus the filter is BIBO stable.
- for .
- Since , the filter is BIBO stable.
Compare FIR and IIR digital audio filters across impulse response, feedback structure, stability, phase linearity, and computational order. Give one practical audio application suited to each filter type.
Core structural differences:
- FIR (Finite Impulse Response): Non-recursive (); finite impulse response of samples; unconditionally BIBO stable; supports exact linear phase when ; requires higher filter order for sharp magnitude transitions.
- IIR (Infinite Impulse Response): Recursive feedback (); infinite impulse response; BIBO stable only when all poles satisfy ; non-linear phase; achieves steep cutoffs at very low order (e.g., -pole biquad).
Practical audio applications:
- FIR: Linear-phase mastering equalizers, loudspeaker crossover networks where preserving transient waveform shape is critical, and convolution reverb (modeling long Room Impulse Responses).
- IIR: Real-time parametric EQs (biquads), subsonic high-pass filters, and synthesizer resonant filters where low CPU usage and minimal latency matter most.
FIR filters are feed-forward, always stable, and capable of exact linear phase at the cost of higher order; IIR filters use recursive feedback for sharp responses at low computational order, with non-linear phase and unit-circle pole stability constraints. FIR excels in linear-phase mastering EQ and convolution reverb, whereas IIR biquads dominate real-time parametric EQ and synth filters.
A simple first-order IIR smoothing (leaky-integrator low-pass) filter used for audio envelope smoothing is defined by:
Compute the first four step-response output samples for unit step input . State whether the filter is BIBO stable.
Evaluating the difference equation recursively for ():
Stability check: Its impulse response is , corresponding to a single pole at . Since (and ), the filter is BIBO stable.
, , , . Because its pole is at (), the filter is BIBO stable.
- An audio speech analyzer runs at . In a voiced frame, the short-time autocorrelation exhibits a strong non-zero peak at lag samples. Estimate the speaker's fundamental frequency in .
- For a short -sample frame , compute its Short-Time Energy () and normalized Zero-Crossing Rate ().
Estimating fundamental pitch from autocorrelation peak: Lag samples corresponds to fundamental period , so:
Computing Short-Time Energy and normalized ZCR:
Across the consecutive sample pairs:
- (), (), (), (), ().
Thus there are zero crossings across transitions:
- Fundamental frequency .
- Short-Time Energy ; normalized .