DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
SpectralDenoiser.h File Reference

Spectral gating denoiser with a learnable noise profile. More...

#include "../Core/AudioBuffer.h"
#include "../Core/AudioSpec.h"
#include "../Core/DspMath.h"
#include "../Core/SpectralProcessor.h"
#include "../Core/StateBlob.h"
#include <algorithm>
#include <atomic>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <vector>
Include dependency graph for SpectralDenoiser.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  dspark::SpectralDenoiser< T >
 Learn-a-profile spectral gate (hiss/hum/room-tone reduction). More...
 

Namespaces

namespace  dspark
 Main namespace for the DSPark framework.
 

Detailed Description

Spectral gating denoiser with a learnable noise profile.

Classic broadcast noise reduction on the SpectralProcessor STFT pipeline:

  1. Learn: while learning is enabled, the per-bin magnitude of the incoming signal (noise only - e.g. a second of room tone) accumulates into a noise profile (running maximum with a soft average).
  2. Gate: each bin whose magnitude falls below threshold * profile is attenuated by up to reduction dB. Gains are smoothed over time per bin (fast attack, slow release) and across frequency (3-bin averaging), the standard defenses against musical noise.

Latency is the STFT's (fftSize samples). All per-bin state is per channel. The temporal release coefficient is per STFT hop, so the release time in milliseconds scales with fftSize/sampleRate (about 70 ms at the 2048 default and 48 kHz).

Threading model: parameter setters/getters are std::atomic based and safe from any thread (non-finite values are ignored). prepare() is setup-thread only (allocates; invalid specs are ignored and an unprepared instance passes audio through). reset() and clearProfile() belong to the stream owner (the profile is written by the audio thread while learning). getState()/setState() are setup/UI threads. Channels beyond the prepared count pass through dry (SpectralProcessor behaviour).

Dependencies: Core/SpectralProcessor.h, Core/AudioSpec.h, Core/AudioBuffer.h, Core/DspMath.h, Core/StateBlob.h.

Definition in file SpectralDenoiser.h.