|
DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
|
Noise gate with hysteresis, hold time, and duck mode. More...
#include "../Core/DspMath.h"#include "../Core/AudioSpec.h"#include "../Core/AudioBuffer.h"#include "../Core/DenormalGuard.h"#include "../Core/StateBlob.h"#include <algorithm>#include <array>#include <atomic>#include <cmath>#include <cstddef>#include <cstdint>#include <numbers>#include <utility>#include <vector>

Go to the source code of this file.
Classes | |
| class | dspark::NoiseGate< T > |
| High-performance noise gate with state machine, hysteresis, and zero-allocation processing. More... | |
Namespaces | |
| namespace | dspark |
| Main namespace for the DSPark framework. | |
Noise gate with hysteresis, hold time, and duck mode.
A professional noise gate that attenuates audio below a threshold. Uses a state machine (Open/Hold/Close) with hysteresis to prevent chattering. Includes an internal peak envelope detector for distortion-free low-frequency tracking. Thresholds are precomputed in the linear domain, so the per-sample path is branch-light and free of log/pow calls (the envelope recursion itself is serial and does not vectorize).
Features:
Threading: prepare() belongs to the setup thread; processBlock(), processSample() and reset() belong to the audio thread. All setters are lock-free atomic publications, safe from any thread; they are consumed at the start of the next block (or the next processSample() call). Non-finite setter arguments are ignored.
Dependencies: DspMath.h, AudioSpec.h, AudioBuffer.h, DenormalGuard.h, StateBlob.h.
Definition in file NoiseGate.h.