|
DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
|
Learn-a-profile spectral noise reduction (hiss/hum/room-tone). 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 noise bins in dB [0, 40] (default 18): the floor of the per-bin gain. Non-finite values are ignored. | |
| void | setThreshold (T factor) noexcept |
| Noise over-subtraction factor over the learned profile, in magnitude [1, 8] (default 2): the gain rule sees the learned noise scaled by it, so higher values remove more noise and more low-level signal. 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 noise reduction (hiss/hum/room-tone).
| T | Sample type (float or double). |
Definition at line 61 of file SpectralDenoiser.h.
|
inlinenoexcept |
Forgets the learned noise profile (stream-owner thread).
Definition at line 105 of file SpectralDenoiser.h.
|
inlinenoexcept |
Latency in samples (the STFT pipeline's).
Definition at line 142 of file SpectralDenoiser.h.
|
inlinenoexcept |
Definition at line 137 of file SpectralDenoiser.h.
|
inlinenoexcept |
Definition at line 138 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 146 of file SpectralDenoiser.h.
|
inlinenoexcept |
Definition at line 139 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 77 of file SpectralDenoiser.h.
|
inlinenoexcept |
Processes a block in-place. Pass-through until prepare() succeeds.
Definition at line 169 of file SpectralDenoiser.h.
|
inlinenoexcept |
Clears signal state and per-bin gain memories (keeps profile).
Definition at line 95 of file SpectralDenoiser.h.
|
inlinenoexcept |
While true, incoming audio trains the noise profile.
Definition at line 114 of file SpectralDenoiser.h.
|
inlinenoexcept |
Maximum attenuation of noise bins in dB [0, 40] (default 18): the floor of the per-bin gain. Non-finite values are ignored.
Definition at line 121 of file SpectralDenoiser.h.
|
inline |
Restores parameters from a blob (tolerant; rejects foreign ids).
Definition at line 157 of file SpectralDenoiser.h.
|
inlinenoexcept |
Noise over-subtraction factor over the learned profile, in magnitude [1, 8] (default 2): the gain rule sees the learned noise scaled by it, so higher values remove more noise and more low-level signal. Non-finite values are ignored.
Definition at line 131 of file SpectralDenoiser.h.