|
DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
|
Automatic gain compensation for honest A/B comparison. More...
#include "../Core/AudioBuffer.h"#include "../Core/AudioSpec.h"#include "../Core/DspMath.h"#include "../Core/SimdOps.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::AutoGain< T > |
| Block-adaptive automatic gain compensation with SIMD-friendly linear interpolation. More... | |
Namespaces | |
| namespace | dspark |
| Main namespace for the DSPark framework. | |
Automatic gain compensation for honest A/B comparison.
Measures the input level before processing and adjusts the output level after processing to match. This eliminates the loudness bias that makes louder signals sound "better", enabling honest A/B testing.
Usage pattern (sandwich):
Threading: prepare() belongs to the setup thread; pushReference(), compensate() and reset() belong to the audio thread. Setters are lock-free atomic publications, safe from any thread, consumed at the next compensate(). Non-finite setter arguments are ignored. getCompensationDb() may be read from any thread for metering (approximate: the value is written unsynchronised by the audio thread).
Dependencies: DspMath.h, SimdOps.h, AudioSpec.h, AudioBuffer.h, StateBlob.h.
Definition in file AutoGain.h.