Brickwall Limiter
Tier: Primitives | ComponentType: 11 | Params: 2
64-sample lookahead peak limiter that guarantees no output exceeds the ceiling.
Overview
BrickwallLimiter uses a 64-sample lookahead buffer to detect peaks before they reach the output. This allows instant attack — gain is reduced before the peak arrives, so the output never exceeds the ceiling. Release smoothing prevents pumping artifacts as gain recovers.
Used as a safety limiter at the end of signal chains to prevent clipping, and can double as a transparent brickwall limiter for mastering-style peak control.
File Locations
| Path | |
|---|---|
| Header | Sources/FolioDSP/include/FolioDSP/Primitives/BrickwallLimiter.h |
| Implementation | Sources/FolioDSP/src/Primitives/BrickwallLimiter.cpp |
| Tests | Tests/FolioDSPTests/BrickwallLimiterTests.swift |
| Bridge | Sources/FolioDSPBridge/src/FolioDSPBridge.mm (BrickwallLimiterBridge) |
Parameters
| Index | Name | Description | Min | Max | Default Min | Default Max | Default | Unit |
|---|---|---|---|---|---|---|---|---|
| 0 | Ceiling | Maximum output level | -24.0 | 0.0 | -3.0 | 0.0 | 0.0 | dB |
| 1 | Release | Time for gain to recover after limiting | 1.0 | 500.0 | 10.0 | 100.0 | 50.0 | ms |
Processing Algorithm
1. Lookahead Buffer
Input is written to a 64-sample circular buffer. The delayed sample (64 samples ago) is read for output.
2. Peak Detection
The peak absolute value across all 64 lookahead samples is found.
3. Target Gain
4. Gain Smoothing
- Attack: Instant (gain drops immediately to target)
- Release: Smoothed recovery:
5. Apply
6. Gain Reduction Tracking
Snapshot Fields
| Field | Type | Range | Unit | Description |
|---|---|---|---|---|
| Ceiling | Float | -24–0 | dB | Current ceiling |
| Gain Reduction | Float | 0–24 | dB | Amount of gain reduction |
Implementation Notes
- 64-sample lookahead = 1.45 ms latency at 44.1 kHz
- Instant attack guarantees no clipping on transients
- Default ceiling 0 dB = unity pass-through (no limiting)
- Used as safety limiter in the TestHarness chain builder
Equation Summary
gain = min(1, ceiling/peak_lookahead)