|
DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
|
Learn-a-profile spectral gate (hiss/hum/room-tone reduction). More...
#include <SpectralDenoiser.h>
Public Member Functions | |
| void | prepare (const AudioSpec &spec, int fftSize=2048) |
| Prepares the STFT pipeline and the per-channel bin state. | |
| void | reset () noexcept |
| Clears signal state and per-bin gain memories (keeps profile). | |
| void | clearProfile () noexcept |
| Forgets the learned noise profile (stream-owner thread). | |
| void | setLearning (bool learning) noexcept |
| While true, incoming audio trains the noise profile. | |
| void | setReduction (T db) noexcept |
| Maximum attenuation of gated bins in dB [0, 40] (default 18). Non-finite values are ignored. | |
| void | setThreshold (T factor) noexcept |
| Gate threshold over the learned profile [1, 8] (default 2). Non-finite values are ignored. | |
| bool | getLearning () const noexcept |
| T | getReduction () const noexcept |
| T | getThreshold () const noexcept |
| int | getLatency () const noexcept |
| Latency in samples (the STFT pipeline's). | |
| std::vector< uint8_t > | getState () const |
| Serializes the parameter state (the learned profile is material- dependent content, not a preset, and is intentionally not included). | |
| bool | setState (const uint8_t *data, size_t size) |
| Restores parameters from a blob (tolerant; rejects foreign ids). | |
| void | processBlock (AudioBufferView< T > buffer) noexcept |
| Processes a block in-place. Pass-through until prepare() succeeds. | |
Learn-a-profile spectral gate (hiss/hum/room-tone reduction).
| T | Sample type (float or double). |
Definition at line 59 of file SpectralDenoiser.h.
|
inlinenoexcept |
Forgets the learned noise profile (stream-owner thread).
Definition at line 103 of file SpectralDenoiser.h.
|
inlinenoexcept |
Latency in samples (the STFT pipeline's).
Definition at line 137 of file SpectralDenoiser.h.
|
inlinenoexcept |
Definition at line 132 of file SpectralDenoiser.h.
|
inlinenoexcept |
Definition at line 133 of file SpectralDenoiser.h.
|
inline |
Serializes the parameter state (the learned profile is material- dependent content, not a preset, and is intentionally not included).
Definition at line 141 of file SpectralDenoiser.h.
|
inlinenoexcept |
Definition at line 134 of file SpectralDenoiser.h.
|
inline |
Prepares the STFT pipeline and the per-channel bin state.
Invalid specs (non-positive/non-finite rate, block size or channel count) are ignored: the previous state is kept and an unprepared instance stays pass-through. fftSize is sanitized by the STFT engine (power of two in [4, 1 << 20]).
| spec | Audio environment specification. |
| fftSize | STFT size (default 2048; larger = finer hum notching). |
Definition at line 75 of file SpectralDenoiser.h.
|
inlinenoexcept |
Processes a block in-place. Pass-through until prepare() succeeds.
Definition at line 164 of file SpectralDenoiser.h.
|
inlinenoexcept |
Clears signal state and per-bin gain memories (keeps profile).
Definition at line 93 of file SpectralDenoiser.h.
|
inlinenoexcept |
While true, incoming audio trains the noise profile.
Definition at line 111 of file SpectralDenoiser.h.
|
inlinenoexcept |
Maximum attenuation of gated bins in dB [0, 40] (default 18). Non-finite values are ignored.
Definition at line 118 of file SpectralDenoiser.h.
|
inline |
Restores parameters from a blob (tolerant; rejects foreign ids).
Definition at line 152 of file SpectralDenoiser.h.
|
inlinenoexcept |
Gate threshold over the learned profile [1, 8] (default 2). Non-finite values are ignored.
Definition at line 126 of file SpectralDenoiser.h.