PadhaikoAll subjects

Time Domain Audio Processing

Audio Processing (ENCT 389)

Open in the Padhaiko app

2.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.

Definition

Elementary Discrete-Time Signals

Three canonical sequences serve as building blocks in discrete-time audio analysis:

  1. Unit Impulse (Kronecker Delta) :

Any arbitrary signal can be decomposed as a weighted sum of shifted impulses: .

  1. Unit Step :
  1. 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:

Fundamental Time-Domain Audio Signal Operations
OperationMathematical FormAudio / 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 ReversalPlaying 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:

Definition

Core Properties of Discrete-Time Systems

  1. 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.

  1. 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.

  1. 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).
  2. Memoryless vs. With Memory: Memoryless systems depend only on (e.g., pure gain ); filters, delays, and reverbs require memory buffers.
  3. 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 :

Theorem

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

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.

AspectAnalog Audio FiltersDigital Audio Filters
Physical ImplementationResistors, capacitors, inductors, operational amplifiersArithmetic logic (multipliers, adders, delay registers ) in DSP/CPU
Precision & DriftSubject to component tolerances (), temperature drift, and agingExact, repeatable mathematical coefficients; zero thermal drift
Linear PhaseTrue constant group delay (linear phase) is impossible in causal passive filtersExact linear phase easily achieved via symmetric FIR coefficients
Dynamic ReconfigurationChanging cutoff/Q requires potentiometers, switches, or VCAsTrivial real-time coefficient updates (automated parametric EQ sweeps)
Dynamic Range / NoiseLimited by thermal Johnson noise and op-amp headroom; continuous bandwidthLimited 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:

AspectFIR (Finite Impulse Response)IIR (Infinite Impulse Response)
Equation (non-recursive; feed-forward only) (recursive feedback)
Impulse ResponseFinite duration ( taps: )Infinite duration (decays asymptotically toward zero if stable)
StabilityAlways BIBO stable (no feedback poles)Stable only if all poles lie strictly inside the unit circle ()
Phase ResponseCan be exact linear phase if (zero phase distortion)Always non-linear phase (approximates analog Butterworth, Chebyshev, Bessel)
Computational CostHigh 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

  1. 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.
  2. 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).
  3. 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).
  4. 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).

Definition

Core Time-Domain Audio Features

For a discrete audio frame :

  1. Short-Time Energy () and RMS Amplitude ():

Captures instantaneous signal loudness; used for silence detection, Voice Activity Detection (VAD), and onset detection.

  1. 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 .

  1. 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 .

  1. 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

Example 2.1

2.1

Consider the discrete-time audio echo system defined by the difference equation:

  1. Determine whether the system is linear, time-invariant, causal, and memoryless.
  2. Find its impulse response and verify BIBO stability.
  3. 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 :

Answer:
  1. The system is linear, time-invariant, causal, and with memory (an LTI FIR system).
  2. , and , so it is BIBO stable.
  3. First echo tap delay ().
Example 2.2

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 :

Answer:
Example 2.3

2.3

Given a short discrete audio frame of samples:

Calculate:

  1. The Short-Time Energy () and RMS amplitude ().
  2. The normalized Zero-Crossing Rate ().
  3. 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 :

Answer:
  1. ,
  2. ( crossings in transitions)
  3. ,

Exercises

Practice Exercises — Time Domain Audio Processing

Question 1

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.

Answer:

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.

Question 2

An audio filter has impulse response for and elsewhere.

  1. Compute the output when the input is for .
  2. 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.

Answer:
  1. for .
  2. Since , the filter is BIBO stable.
Question 3

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.
Answer:

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.

Question 4

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.

Answer:

, , , . Because its pole is at (), the filter is BIBO stable.

Question 5
  1. 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 .
  2. 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:

Answer:
  1. Fundamental frequency .
  2. Short-Time Energy ; normalized .
← Fundamental of Sound and Audio SignalSpectral Representation →