Comb Filtering in Ecasound for Acoustic Simulation
Comb filtering in Ecasound is implemented through delay-line signal processing architectures that recreate the constructive and destructive acoustic interference caused by physical boundary reflections. By utilizing native delay and feedback operators, Ecasound models the frequency-dependent coloration and resonance patterns typical of enclosed spaces, serving as a fundamental building block for custom digital reverberation and spatial sound design.
Acoustic Principles of Comb Filtering
In physical acoustics, comb filtering occurs when an original sound wave combines with a time-delayed replica of itself—typically reflected from a wall, ceiling, or floor. Because sound travels at a finite speed, the phase relationship between the direct signal and the reflected signal varies across frequencies. Frequencies whose phase shifts result in identical alignment reinforce each other, while frequencies that arrive 180 degrees out of phase cancel each other out, creating a periodic frequency response that resembles the teeth of a comb.
Ecasound’s Internal Implementation
Ecasound realizes comb filtering through discrete digital delay lines and buffer management programmed within its C++ audio engine. The implementation relies on circular buffers where incoming audio frames are stored and read back after a designated delay interval.
Ecasound supports both primary types of comb filters:
Feedforward Comb Filters (FIR): In a feedforward topology, the current dry input sample is summed with a delayed version of the input scaled by an attenuation coefficient: \[y[n] = x[n] + b \cdot x[n - M]\] where \(x[n]\) is the input signal, \(M\) is the delay time in samples, and \(b\) represents the surface reflection coefficient (absorption). Ecasound creates this behavior using multiple chain routing or delay modules (
-etd), simulating single discrete reflections.Feedback Comb Filters (IIR): To simulate continuous reflections between parallel surfaces, feedback comb filters route the delayed output back into the delay line: \[y[n] = x[n] + g \cdot y[n - M]\] where \(g\) represents the feedback gain (\(0 < g < 1\)). Ecasound natively provides feedback delay mechanisms through the
-efboperator (-efb:delay_time_ms,feedback_percent), which continuously recycles energy through the buffer to model decay over time.
Parameter Mapping for Physical Spaces
To simulate specific acoustic environments using Ecasound, physical room characteristics must be translated into DSP parameters:
- Delay Time (\(M\)): Calculated directly from the distance between virtual acoustic boundaries using the speed of sound (\(343\text{ m/s}\) at room temperature). The delay time in milliseconds dictates the fundamental resonance frequency and the spacing between the peaks of the comb filter (\(f_0 = 1 / \text{delay time}\)).
- Feedback Gain / Attenuation (\(g\)): Represents the absorption coefficient of the simulated boundary materials. Highly reflective surfaces (such as concrete or tile) require high feedback values (e.g., 70–90%), while absorbent materials (such as heavy drapery or acoustic foam) require significantly lower values.
Modular Acoustic Simulation Networks
Ecasound is designed as an open, chain-based routing system.
Individual comb filters inherently suffer from excessive metallic
resonance when used in isolation. To mitigate this and simulate
realistic room impulse responses, Ecasound allows users to construct
Schroeder-style reverberation networks by running multiple feedback comb
filters in parallel across parallel audio chains
(-a:1,2,3,4), each set with mutually prime delay times to
avoid resonant build-up. The combined output of these comb filters is
then routed into series all-pass filters (-ea) to increase
echo density without altering the simulated room's frequency
balance.