|
DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
|
Brickwall lookahead limiter with optional ISP (true-peak) detection and adaptive release for mastering. More...
#include "../Core/DspMath.h"#include "../Core/AudioSpec.h"#include "../Core/AudioBuffer.h"#include "../Core/RingBuffer.h"#include "../Core/SmoothedValue.h"#include "../Core/DenormalGuard.h"#include "../Core/TruePeakDetector.h"#include "../Core/StateBlob.h"#include <algorithm>#include <atomic>#include <cmath>#include <cstddef>#include <cstdint>#include <vector>

Go to the source code of this file.
Classes | |
| class | dspark::Limiter< T > |
| High-performance brickwall lookahead limiter. More... | |
Namespaces | |
| namespace | dspark |
| Main namespace for the DSPark framework. | |
Brickwall lookahead limiter with optional ISP (true-peak) detection and adaptive release for mastering.
A peak limiter that prevents audio from exceeding a configurable ceiling. It uses a lookahead delay line with a peak hold over the lookahead window and a smoothed attack envelope, so transients are turned down transparently instead of being clipped. Optional ISP (Inter-Sample Peak) detection feeds the sidechain with the ITU-R BS.1770 4x oversampled true-peak estimate, which greatly reduces inter-sample overs. The exact brickwall guarantee is in the sample domain (a final clamp at the ceiling); true-peak levels after that clamp are reduced but not mathematically bounded.
Features:
Threading: prepare() belongs to the setup thread (allocates; never call it concurrently with processing). processBlock(), processSample() and reset() belong to the audio thread. All setters are lock-free atomic publications, safe from any thread; changes are consumed at the next block (or the next channel-0 sample). Non-finite setter arguments are ignored. getLatency() derives from the published lookahead parameter, so a host reads the correct value immediately after setLookahead(). getGainReductionDb() is metering: an unsynchronized cross-thread read of the live envelope (approximate).
Dependencies: DspMath.h, AudioSpec.h, AudioBuffer.h, RingBuffer.h, SmoothedValue.h, DenormalGuard.h, TruePeakDetector.h, StateBlob.h.
Definition in file Limiter.h.