DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
dspark::DeEsser< T > Class Template Reference

Stereo-linked, CPU-optimized dynamic-EQ de-esser. More...

#include <DeEsser.h>

Public Types

enum class  DetectionMode { Bandpass , Derivative }
 

Public Member Functions

void prepare (const AudioSpec &spec)
 Prepares the de-esser state and filters.
 
void processBlock (AudioBufferView< T > buffer) noexcept
 Processes audio in-place. Stereo-linked to preserve imaging.
 
void reset () noexcept
 Resets internal DSP state.
 
void setAttack (T ms) noexcept
 Sets the detector attack, clamped to [0.1, 20] ms. Non-finite values are ignored.
 
void setRelease (T ms) noexcept
 Sets the detector release, clamped to [1, 500] ms. Non-finite values are ignored.
 
void setFrequency (T hz) noexcept
 Sets the sibilance centre frequency in Hz.
 
void setBandwidth (T octaves) noexcept
 Sets the detection/cut bandwidth in octaves (floored at 0.1). Non-finite values are ignored.
 
void setThreshold (T db) noexcept
 Sets the detection threshold in dBFS. Non-finite values are ignored.
 
void setReduction (T db) noexcept
 Sets the maximum gain reduction in dB (sign is ignored). Non-finite values are ignored.
 
void setDetectionMode (DetectionMode mode) noexcept
 Sets the detection mode. Out-of-range values are clamped so the getter stays honest.
 
getGainReductionDb () const noexcept
 
getFrequency () const noexcept
 
getThreshold () const noexcept
 
DetectionMode getDetectionMode () const noexcept
 
getAttack () const noexcept
 
getRelease () const noexcept
 
getBandwidth () const noexcept
 
getReduction () const noexcept
 
std::vector< uint8_t > getState () const
 Serializes the parameter state (setup/UI threads; allocates).
 
bool setState (const uint8_t *data, size_t size)
 Restores parameters from a blob (tolerant; rejects foreign ids).
 

Detailed Description

template<FloatType T>
class dspark::DeEsser< T >

Stereo-linked, CPU-optimized dynamic-EQ de-esser.

Detection is stereo-linked (one shared envelope) to preserve imaging. Channels beyond the first two are left untouched (pass-through), as is the whole buffer before prepare().

Template Parameters
TSample type (float or double).

Definition at line 64 of file DeEsser.h.

Member Enumeration Documentation

◆ DetectionMode

template<FloatType T>
enum class dspark::DeEsser::DetectionMode
strong
Enumerator
Bandpass 

Standard bandpass filter detection.

Derivative 

Sum of absolute derivatives. Sensitive to sustained high frequencies.

Definition at line 67 of file DeEsser.h.

Member Function Documentation

◆ getAttack()

template<FloatType T>
T dspark::DeEsser< T >::getAttack ( ) const
inlinenoexcept

Definition at line 216 of file DeEsser.h.

◆ getBandwidth()

template<FloatType T>
T dspark::DeEsser< T >::getBandwidth ( ) const
inlinenoexcept
Returns
The detection/cut bandwidth in octaves (inverse of the stored Q).

Definition at line 220 of file DeEsser.h.

◆ getDetectionMode()

template<FloatType T>
DetectionMode dspark::DeEsser< T >::getDetectionMode ( ) const
inlinenoexcept

Definition at line 215 of file DeEsser.h.

◆ getFrequency()

template<FloatType T>
T dspark::DeEsser< T >::getFrequency ( ) const
inlinenoexcept

Definition at line 213 of file DeEsser.h.

◆ getGainReductionDb()

template<FloatType T>
T dspark::DeEsser< T >::getGainReductionDb ( ) const
inlinenoexcept

Definition at line 212 of file DeEsser.h.

◆ getReduction()

template<FloatType T>
T dspark::DeEsser< T >::getReduction ( ) const
inlinenoexcept
Returns
The maximum gain reduction in dB (positive).

Definition at line 227 of file DeEsser.h.

◆ getRelease()

template<FloatType T>
T dspark::DeEsser< T >::getRelease ( ) const
inlinenoexcept

Definition at line 217 of file DeEsser.h.

◆ getState()

template<FloatType T>
std::vector< uint8_t > dspark::DeEsser< T >::getState ( ) const
inline

Serializes the parameter state (setup/UI threads; allocates).

Definition at line 230 of file DeEsser.h.

◆ getThreshold()

template<FloatType T>
T dspark::DeEsser< T >::getThreshold ( ) const
inlinenoexcept

Definition at line 214 of file DeEsser.h.

◆ prepare()

template<FloatType T>
void dspark::DeEsser< T >::prepare ( const AudioSpec spec)
inline

Prepares the de-esser state and filters.

An invalid spec (non-positive or non-finite fields) is a no-op that keeps the previous state.

Parameters
specAudio environment specification.

Definition at line 81 of file DeEsser.h.

◆ processBlock()

template<FloatType T>
void dspark::DeEsser< T >::processBlock ( AudioBufferView< T >  buffer)
inlinenoexcept

Processes audio in-place. Stereo-linked to preserve imaging.

Parameters
bufferAudio data.

Definition at line 101 of file DeEsser.h.

◆ reset()

template<FloatType T>
void dspark::DeEsser< T >::reset ( )
inlinenoexcept

Resets internal DSP state.

Definition at line 134 of file DeEsser.h.

◆ setAttack()

template<FloatType T>
void dspark::DeEsser< T >::setAttack ( ms)
inlinenoexcept

Sets the detector attack, clamped to [0.1, 20] ms. Non-finite values are ignored.

Definition at line 150 of file DeEsser.h.

◆ setBandwidth()

template<FloatType T>
void dspark::DeEsser< T >::setBandwidth ( octaves)
inlinenoexcept

Sets the detection/cut bandwidth in octaves (floored at 0.1). Non-finite values are ignored.

Definition at line 179 of file DeEsser.h.

◆ setDetectionMode()

template<FloatType T>
void dspark::DeEsser< T >::setDetectionMode ( DetectionMode  mode)
inlinenoexcept

Sets the detection mode. Out-of-range values are clamped so the getter stays honest.

Definition at line 203 of file DeEsser.h.

◆ setFrequency()

template<FloatType T>
void dspark::DeEsser< T >::setFrequency ( hz)
inlinenoexcept

Sets the sibilance centre frequency in Hz.

Clamped against the prepared sample rate when the filters rebuild (effective range [1, 0.499 * fs]). Non-finite values are ignored.

Definition at line 171 of file DeEsser.h.

◆ setReduction()

template<FloatType T>
void dspark::DeEsser< T >::setReduction ( db)
inlinenoexcept

Sets the maximum gain reduction in dB (sign is ignored). Non-finite values are ignored.

Definition at line 196 of file DeEsser.h.

◆ setRelease()

template<FloatType T>
void dspark::DeEsser< T >::setRelease ( ms)
inlinenoexcept

Sets the detector release, clamped to [1, 500] ms. Non-finite values are ignored.

Definition at line 158 of file DeEsser.h.

◆ setState()

template<FloatType T>
bool dspark::DeEsser< T >::setState ( const uint8_t *  data,
size_t  size 
)
inline

Restores parameters from a blob (tolerant; rejects foreign ids).

Definition at line 247 of file DeEsser.h.

◆ setThreshold()

template<FloatType T>
void dspark::DeEsser< T >::setThreshold ( db)
inlinenoexcept

Sets the detection threshold in dBFS. Non-finite values are ignored.

Definition at line 189 of file DeEsser.h.


The documentation for this class was generated from the following file: