DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::NoiseGate< T > Class Template Reference

High-performance noise gate with state machine, hysteresis, and zero-allocation processing. More...

#include <NoiseGate.h>

Public Types

enum class  State { Closed , Open , Hold }
 Gate state machine phases. More...
 
enum class  GateMode { Amplitude , Frequency }
 Operating mode for the gate processing. More...
 

Public Member Functions

 ~NoiseGate ()=default
 
void prepare (double sampleRate, int numChannels=2) noexcept
 Prepares the noise gate for processing.
 
void prepare (const AudioSpec &spec) noexcept
 Prepares from AudioSpec (unified API).
 
void processBlock (AudioBufferView< T > buffer) noexcept
 Processes an AudioBufferView in-place.
 
void processBlock (AudioBufferView< T > audio, AudioBufferView< T > sidechain) noexcept
 Processes audio with an external sidechain signal.
 
void setThreshold (T dB) noexcept
 Sets the opening threshold.
 
void setHysteresis (T dB) noexcept
 Sets the hysteresis amount (gap between open and close thresholds).
 
void setAttack (T ms) noexcept
 Sets attack time in milliseconds. Non-finite values are ignored.
 
void setHold (T ms) noexcept
 Sets hold time in milliseconds. Non-finite values are ignored.
 
void setRelease (T ms) noexcept
 Sets release time in milliseconds. Non-finite values are ignored.
 
void setRange (T dB) noexcept
 Sets maximum attenuation range.
 
void setDuckMode (bool enabled) noexcept
 Toggles ducking mode (invert gate logic).
 
void setGateMode (GateMode mode) noexcept
 Selects the processing mode (Amplitude or Frequency; wild enum values clamp).
 
void setLookahead (T ms) noexcept
 Sets the lookahead: the audio is delayed so the gate opens (and closes) ahead of it. 0 (default) is latency-free.
 
T getLookahead () const noexcept
 Returns the lookahead in milliseconds.
 
int getLatency () const noexcept
 Latency in samples (the lookahead), correct right after setLookahead().
 
void setAdaptiveHold (bool enabled) noexcept
 Toggles adaptive hold based on zero-crossing rate.
 
void setSidechainHPF (bool enabled, double cutoffHz=80.0) noexcept
 Configures sidechain High-Pass filter.
 
T processSample (T input) noexcept
 Processes a single mono sample.
 
T processSampleWithSidechain (T input, T sidechain) noexcept
 Processes a mono sample using an external sidechain.
 
void reset () noexcept
 Resets DSP state (clears filters, sets state to Closed).
 
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).
 

Protected Member Functions

void syncParamsIfDirty () noexcept
 
void syncParams () noexcept
 
int lookaheadSamplesFor (T ms) const noexcept
 
T delayed (T x, int ch) noexcept
 
T computeEnvelopeFollower (T rawLevel) noexcept
 Updates envelope state to prevent intra-cycle chattering.
 
void updateStateMachine (T envelopeLinear) noexcept
 
void updateZeroCrossing (T sample) noexcept
 
T getCurrentGain () noexcept
 
T applyFrequencyGate (T input, int ch) noexcept
 
T applyScHpf (T input, int ch) noexcept
 Per-channel one-pole sidechain high-pass (unity gain at Nyquist).
 
T processSampleInternal (T input, T sidechain, int ch) noexcept
 

Protected Attributes

double sampleRate_ = 48000.0
 
std::atomic< T > threshold_ { T(-40) }
 
std::atomic< T > hysteresis_ { T(4) }
 
std::atomic< T > attackMs_ { T(0.5) }
 
std::atomic< T > holdMs_ { T(50) }
 
std::atomic< T > releaseMs_ { T(100) }
 
std::atomic< T > rangeDb_ { T(-80) }
 
std::atomic< bool > duckMode_ { false }
 
std::atomic< GateMode > gateMode_ { GateMode::Amplitude }
 
std::atomic< bool > adaptiveHold_ { false }
 
std::atomic< bool > paramsDirty_ { true }
 
std::atomic< bool > scHpfEnabled_ { false }
 
std::atomic< T > scHpfFreq_ { T(80) }
 
std::atomic< T > lookaheadMs_ { T(0) }
 
int lookaheadSamples_ = 0
 Audio-side value (consumed in syncParams()).
 
int maxLookaheadSamples_ = 0
 Allocated delay (0 before prepare()).
 
int lookaheadChannels_ = 0
 Channels with a prepared delay line.
 
std::array< RingBuffer< T >, kMaxLookaheadChannels > lookahead_ {}
 
T cachedThresholdLinear_ = T(0.01)
 
T cachedCloseThresholdLinear_ = T(0.0063)
 
T cachedRangeLinear_ = T(0.0001)
 
bool cachedDuck_ = false
 
GateMode cachedGateMode_ = GateMode::Amplitude
 
bool cachedAdaptiveHold_ = false
 
bool cachedScHpfEnabled_ = false
 
T cachedNyquist_ = T(24000)
 
T cachedFsInvPi2_ = T(0)
 
T scHpfCoeff_ = T(0.995)
 
T scHpfA0_ = T(0.9975)
 
std::array< T, kMaxScChannels > scHpfState_ {}
 
std::array< T, kMaxScChannels > scHpfPrev_ {}
 
T attackCoeff_ = T(0)
 
T releaseCoeff_ = T(0)
 
int holdSamples_ = 0
 
T envelopeState_ = T(0)
 
T detectorReleaseCoeff_ = T(0)
 
State state_ = State::Closed
 
T gateGain_ = T(0)
 
int holdCounter_ = 0
 
T freqSmoothCoeff_ = T(0)
 
std::array< T, kMaxChannels > freqLpState_ {}
 
std::array< T, kMaxChannels > freqHpState_ {}
 
std::array< T, kMaxChannels > freqHpPrev_ {}
 
std::array< T, kMaxChannels > freqLpFreq_ {}
 
std::array< T, kMaxChannels > freqHpFreq_ {}
 
int zeroCrossCount_ = 0
 
int zeroCrossSamples_ = 0
 
bool prevSign_ = false
 
int estimatedPeriod_ = 0
 

Static Protected Attributes

static constexpr int kMaxChannels = 2
 
static constexpr double kMaxLookaheadMs = 10.0
 
static constexpr int kMaxLookaheadChannels = 16
 
static constexpr int kMaxScChannels = 16
 
static constexpr int kZeroCrossWindow = 2048
 

Detailed Description

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

High-performance noise gate with state machine, hysteresis, and zero-allocation processing.

Template Parameters
TSample type (float or double).

Definition at line 81 of file NoiseGate.h.

Member Enumeration Documentation

◆ GateMode

template<FloatType T>
enum class dspark::NoiseGate::GateMode
strong

Operating mode for the gate processing.

Enumerator
Amplitude 

Standard amplitude gain reduction (default).

Frequency 

Gatelope-style: narrows bandpass dynamically instead of direct gain reduction.

Definition at line 95 of file NoiseGate.h.

◆ State

template<FloatType T>
enum class dspark::NoiseGate::State
strong

Gate state machine phases.

Enumerator
Closed 

Gate is fully closed (applying range attenuation).

Open 

Gate is fully open (passing audio).

Hold 

Gate is open but counting down hold time before closing.

Definition at line 87 of file NoiseGate.h.

Constructor & Destructor Documentation

◆ ~NoiseGate()

template<FloatType T>
dspark::NoiseGate< T >::~NoiseGate ( )
default

Member Function Documentation

◆ applyFrequencyGate()

template<FloatType T>
T dspark::NoiseGate< T >::applyFrequencyGate ( T  input,
int  ch 
)
inlineprotectednoexcept

Definition at line 638 of file NoiseGate.h.

◆ applyScHpf()

template<FloatType T>
T dspark::NoiseGate< T >::applyScHpf ( T  input,
int  ch 
)
inlineprotectednoexcept

Per-channel one-pole sidechain high-pass (unity gain at Nyquist).

Definition at line 662 of file NoiseGate.h.

◆ computeEnvelopeFollower()

template<FloatType T>
T dspark::NoiseGate< T >::computeEnvelopeFollower ( T  rawLevel)
inlineprotectednoexcept

Updates envelope state to prevent intra-cycle chattering.

Definition at line 555 of file NoiseGate.h.

◆ delayed()

template<FloatType T>
T dspark::NoiseGate< T >::delayed ( T  x,
int  ch 
)
inlineprotectednoexcept

The lookahead-delayed audio sample of a channel (pass-through when off or beyond the prepared channels).

Definition at line 544 of file NoiseGate.h.

◆ getCurrentGain()

template<FloatType T>
T dspark::NoiseGate< T >::getCurrentGain ( )
inlineprotectednoexcept

Definition at line 626 of file NoiseGate.h.

◆ getLatency()

template<FloatType T>
int dspark::NoiseGate< T >::getLatency ( ) const
inlinenoexcept

Latency in samples (the lookahead), correct right after setLookahead().

Definition at line 348 of file NoiseGate.h.

◆ getLookahead()

template<FloatType T>
T dspark::NoiseGate< T >::getLookahead ( ) const
inlinenoexcept

Returns the lookahead in milliseconds.

Definition at line 345 of file NoiseGate.h.

◆ getState()

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

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

Definition at line 437 of file NoiseGate.h.

◆ lookaheadSamplesFor()

template<FloatType T>
int dspark::NoiseGate< T >::lookaheadSamplesFor ( T  ms) const
inlineprotectednoexcept

Lookahead in samples for a ms value (shared by syncParams() and getLatency()).

Definition at line 536 of file NoiseGate.h.

◆ prepare() [1/2]

template<FloatType T>
void dspark::NoiseGate< T >::prepare ( const AudioSpec &  spec)
inlinenoexcept

Prepares from AudioSpec (unified API).

Parameters
specAudioSpec containing format details.

Definition at line 128 of file NoiseGate.h.

◆ prepare() [2/2]

template<FloatType T>
void dspark::NoiseGate< T >::prepare ( double  sampleRate,
int  numChannels = 2 
)
inlinenoexcept

Prepares the noise gate for processing.

Release-safe: a non-positive or non-finite sample rate makes this call a no-op (the previous state and rate are kept; +inf used to pass). Allocates the lookahead delay lines (setup thread only).

Parameters
sampleRateOperating sample rate in Hz (must be > 0).
numChannelsChannels that receive the lookahead delay (clamped to [1, 16]); further channels are gated undelayed.

Definition at line 112 of file NoiseGate.h.

◆ processBlock() [1/2]

template<FloatType T>
void dspark::NoiseGate< T >::processBlock ( AudioBufferView< T >  audio,
AudioBufferView< T >  sidechain 
)
inlinenoexcept

Processes audio with an external sidechain signal.

Detection (including the optional HPF, the adaptive-hold zero-crossing tracker and Frequency mode) behaves exactly like the internal-key path; only the level source changes to the sidechain buffer.

Parameters
audioAudio buffer to gate (modified in-place).
sidechainExternal sidechain signal (read-only).

Definition at line 197 of file NoiseGate.h.

◆ processBlock() [2/2]

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

Processes an AudioBufferView in-place.

Detection is linked across ALL channels (peak), so no channel is left ungated. In Frequency mode, channels beyond kMaxChannels fall back to amplitude gating (per-channel filter state is kept for the first two).

Parameters
bufferAudio buffer (mono or multi-channel).

Definition at line 139 of file NoiseGate.h.

◆ processSample()

template<FloatType T>
T dspark::NoiseGate< T >::processSample ( T  input)
inlinenoexcept

Processes a single mono sample.

Bit-identical to processBlock() for mono streams.

Note
No DenormalGuard here (per-sample hot path); per-sample callers are expected to guard their own processing loop.
Parameters
inputSource sample.
Returns
Gated output sample.

Definition at line 391 of file NoiseGate.h.

◆ processSampleInternal()

template<FloatType T>
T dspark::NoiseGate< T >::processSampleInternal ( T  input,
T  sidechain,
int  ch 
)
inlineprotectednoexcept

Definition at line 670 of file NoiseGate.h.

◆ processSampleWithSidechain()

template<FloatType T>
T dspark::NoiseGate< T >::processSampleWithSidechain ( T  input,
T  sidechain 
)
inlinenoexcept

Processes a mono sample using an external sidechain.

Parameters
inputSource sample.
sidechainKey/Sidechain sample.
Returns
Gated output sample.

Definition at line 403 of file NoiseGate.h.

◆ reset()

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

Resets DSP state (clears filters, sets state to Closed).

Definition at line 412 of file NoiseGate.h.

◆ setAdaptiveHold()

template<FloatType T>
void dspark::NoiseGate< T >::setAdaptiveHold ( bool  enabled)
inlinenoexcept

Toggles adaptive hold based on zero-crossing rate.

Definition at line 354 of file NoiseGate.h.

◆ setAttack()

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

Sets attack time in milliseconds. Non-finite values are ignored.

Definition at line 277 of file NoiseGate.h.

◆ setDuckMode()

template<FloatType T>
void dspark::NoiseGate< T >::setDuckMode ( bool  enabled)
inlinenoexcept

Toggles ducking mode (invert gate logic).

Definition at line 312 of file NoiseGate.h.

◆ setGateMode()

template<FloatType T>
void dspark::NoiseGate< T >::setGateMode ( GateMode  mode)
inlinenoexcept

Selects the processing mode (Amplitude or Frequency; wild enum values clamp).

Definition at line 319 of file NoiseGate.h.

◆ setHold()

template<FloatType T>
void dspark::NoiseGate< T >::setHold ( T  ms)
inlinenoexcept

Sets hold time in milliseconds. Non-finite values are ignored.

Definition at line 285 of file NoiseGate.h.

◆ setHysteresis()

template<FloatType T>
void dspark::NoiseGate< T >::setHysteresis ( T  dB)
inlinenoexcept

Sets the hysteresis amount (gap between open and close thresholds).

Parameters
dBHysteresis in decibels (floored to 0). Non-finite values are ignored.

Definition at line 269 of file NoiseGate.h.

◆ setLookahead()

template<FloatType T>
void dspark::NoiseGate< T >::setLookahead ( T  ms)
inlinenoexcept

Sets the lookahead: the audio is delayed so the gate opens (and closes) ahead of it. 0 (default) is latency-free.

RT-safe publication, consumed at the next block; change it while stopped (a live change jumps the delay and may click). Report getLatency() to the host for delay compensation.

Parameters
msLookahead in milliseconds, clamped to [0, 10]. Non-finite values are ignored.

Definition at line 337 of file NoiseGate.h.

◆ setRange()

template<FloatType T>
void dspark::NoiseGate< T >::setRange ( T  dB)
inlinenoexcept

Sets maximum attenuation range.

Parameters
dBRange in decibels (capped at 0). Non-finite values are ignored.

Definition at line 304 of file NoiseGate.h.

◆ setRelease()

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

Sets release time in milliseconds. Non-finite values are ignored.

Definition at line 293 of file NoiseGate.h.

◆ setSidechainHPF()

template<FloatType T>
void dspark::NoiseGate< T >::setSidechainHPF ( bool  enabled,
double  cutoffHz = 80.0 
)
inlinenoexcept

Configures sidechain High-Pass filter.

An invalid cutoff (non-finite or non-positive) keeps the previous frequency and only applies the toggle: a negative cutoff would make the one-pole coefficient exceed 1 (an unstable, runaway filter).

Parameters
enabledFilter active state.
cutoffHzFilter cutoff in Hz (clamped to [1, 0.45 * fs]).

Definition at line 370 of file NoiseGate.h.

◆ setState()

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

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

Definition at line 456 of file NoiseGate.h.

◆ setThreshold()

template<FloatType T>
void dspark::NoiseGate< T >::setThreshold ( T  dB)
inlinenoexcept

Sets the opening threshold.

Parameters
dBThreshold in decibels. Non-finite values are ignored.

Definition at line 258 of file NoiseGate.h.

◆ syncParams()

template<FloatType T>
void dspark::NoiseGate< T >::syncParams ( )
inlineprotectednoexcept

Definition at line 487 of file NoiseGate.h.

◆ syncParamsIfDirty()

template<FloatType T>
void dspark::NoiseGate< T >::syncParamsIfDirty ( )
inlineprotectednoexcept

Definition at line 478 of file NoiseGate.h.

◆ updateStateMachine()

template<FloatType T>
void dspark::NoiseGate< T >::updateStateMachine ( T  envelopeLinear)
inlineprotectednoexcept

Definition at line 565 of file NoiseGate.h.

◆ updateZeroCrossing()

template<FloatType T>
void dspark::NoiseGate< T >::updateZeroCrossing ( T  sample)
inlineprotectednoexcept

Definition at line 606 of file NoiseGate.h.

Member Data Documentation

◆ adaptiveHold_

template<FloatType T>
std::atomic<bool> dspark::NoiseGate< T >::adaptiveHold_ { false }
protected

Definition at line 703 of file NoiseGate.h.

◆ attackCoeff_

template<FloatType T>
T dspark::NoiseGate< T >::attackCoeff_ = T(0)
protected

Definition at line 735 of file NoiseGate.h.

◆ attackMs_

template<FloatType T>
std::atomic<T> dspark::NoiseGate< T >::attackMs_ { T(0.5) }
protected

Definition at line 697 of file NoiseGate.h.

◆ cachedAdaptiveHold_

template<FloatType T>
bool dspark::NoiseGate< T >::cachedAdaptiveHold_ = false
protected

Definition at line 724 of file NoiseGate.h.

◆ cachedCloseThresholdLinear_

template<FloatType T>
T dspark::NoiseGate< T >::cachedCloseThresholdLinear_ = T(0.0063)
protected

Definition at line 720 of file NoiseGate.h.

◆ cachedDuck_

template<FloatType T>
bool dspark::NoiseGate< T >::cachedDuck_ = false
protected

Definition at line 722 of file NoiseGate.h.

◆ cachedFsInvPi2_

template<FloatType T>
T dspark::NoiseGate< T >::cachedFsInvPi2_ = T(0)
protected

Definition at line 727 of file NoiseGate.h.

◆ cachedGateMode_

template<FloatType T>
GateMode dspark::NoiseGate< T >::cachedGateMode_ = GateMode::Amplitude
protected

Definition at line 723 of file NoiseGate.h.

◆ cachedNyquist_

template<FloatType T>
T dspark::NoiseGate< T >::cachedNyquist_ = T(24000)
protected

Definition at line 726 of file NoiseGate.h.

◆ cachedRangeLinear_

template<FloatType T>
T dspark::NoiseGate< T >::cachedRangeLinear_ = T(0.0001)
protected

Definition at line 721 of file NoiseGate.h.

◆ cachedScHpfEnabled_

template<FloatType T>
bool dspark::NoiseGate< T >::cachedScHpfEnabled_ = false
protected

Definition at line 725 of file NoiseGate.h.

◆ cachedThresholdLinear_

template<FloatType T>
T dspark::NoiseGate< T >::cachedThresholdLinear_ = T(0.01)
protected

Definition at line 719 of file NoiseGate.h.

◆ detectorReleaseCoeff_

template<FloatType T>
T dspark::NoiseGate< T >::detectorReleaseCoeff_ = T(0)
protected

Definition at line 741 of file NoiseGate.h.

◆ duckMode_

template<FloatType T>
std::atomic<bool> dspark::NoiseGate< T >::duckMode_ { false }
protected

Definition at line 701 of file NoiseGate.h.

◆ envelopeState_

template<FloatType T>
T dspark::NoiseGate< T >::envelopeState_ = T(0)
protected

Definition at line 740 of file NoiseGate.h.

◆ estimatedPeriod_

template<FloatType T>
int dspark::NoiseGate< T >::estimatedPeriod_ = 0
protected

Definition at line 758 of file NoiseGate.h.

◆ freqHpFreq_

template<FloatType T>
std::array<T, kMaxChannels> dspark::NoiseGate< T >::freqHpFreq_ {}
protected

Definition at line 752 of file NoiseGate.h.

◆ freqHpPrev_

template<FloatType T>
std::array<T, kMaxChannels> dspark::NoiseGate< T >::freqHpPrev_ {}
protected

Definition at line 750 of file NoiseGate.h.

◆ freqHpState_

template<FloatType T>
std::array<T, kMaxChannels> dspark::NoiseGate< T >::freqHpState_ {}
protected

Definition at line 749 of file NoiseGate.h.

◆ freqLpFreq_

template<FloatType T>
std::array<T, kMaxChannels> dspark::NoiseGate< T >::freqLpFreq_ {}
protected

Definition at line 751 of file NoiseGate.h.

◆ freqLpState_

template<FloatType T>
std::array<T, kMaxChannels> dspark::NoiseGate< T >::freqLpState_ {}
protected

Definition at line 748 of file NoiseGate.h.

◆ freqSmoothCoeff_

template<FloatType T>
T dspark::NoiseGate< T >::freqSmoothCoeff_ = T(0)
protected

Definition at line 747 of file NoiseGate.h.

◆ gateGain_

template<FloatType T>
T dspark::NoiseGate< T >::gateGain_ = T(0)
protected

Definition at line 744 of file NoiseGate.h.

◆ gateMode_

template<FloatType T>
std::atomic<GateMode> dspark::NoiseGate< T >::gateMode_ { GateMode::Amplitude }
protected

Definition at line 702 of file NoiseGate.h.

◆ holdCounter_

template<FloatType T>
int dspark::NoiseGate< T >::holdCounter_ = 0
protected

Definition at line 745 of file NoiseGate.h.

◆ holdMs_

template<FloatType T>
std::atomic<T> dspark::NoiseGate< T >::holdMs_ { T(50) }
protected

Definition at line 698 of file NoiseGate.h.

◆ holdSamples_

template<FloatType T>
int dspark::NoiseGate< T >::holdSamples_ = 0
protected

Definition at line 737 of file NoiseGate.h.

◆ hysteresis_

template<FloatType T>
std::atomic<T> dspark::NoiseGate< T >::hysteresis_ { T(4) }
protected

Definition at line 696 of file NoiseGate.h.

◆ kMaxChannels

template<FloatType T>
constexpr int dspark::NoiseGate< T >::kMaxChannels = 2
staticconstexprprotected

Definition at line 476 of file NoiseGate.h.

◆ kMaxLookaheadChannels

template<FloatType T>
constexpr int dspark::NoiseGate< T >::kMaxLookaheadChannels = 16
staticconstexprprotected

Definition at line 711 of file NoiseGate.h.

◆ kMaxLookaheadMs

template<FloatType T>
constexpr double dspark::NoiseGate< T >::kMaxLookaheadMs = 10.0
staticconstexprprotected

Definition at line 710 of file NoiseGate.h.

◆ kMaxScChannels

template<FloatType T>
constexpr int dspark::NoiseGate< T >::kMaxScChannels = 16
staticconstexprprotected

Definition at line 729 of file NoiseGate.h.

◆ kZeroCrossWindow

template<FloatType T>
constexpr int dspark::NoiseGate< T >::kZeroCrossWindow = 2048
staticconstexprprotected

Definition at line 754 of file NoiseGate.h.

◆ lookahead_

template<FloatType T>
std::array<RingBuffer<T>, kMaxLookaheadChannels> dspark::NoiseGate< T >::lookahead_ {}
protected

Definition at line 716 of file NoiseGate.h.

◆ lookaheadChannels_

template<FloatType T>
int dspark::NoiseGate< T >::lookaheadChannels_ = 0
protected

Channels with a prepared delay line.

Definition at line 715 of file NoiseGate.h.

◆ lookaheadMs_

template<FloatType T>
std::atomic<T> dspark::NoiseGate< T >::lookaheadMs_ { T(0) }
protected

Definition at line 712 of file NoiseGate.h.

◆ lookaheadSamples_

template<FloatType T>
int dspark::NoiseGate< T >::lookaheadSamples_ = 0
protected

Audio-side value (consumed in syncParams()).

Definition at line 713 of file NoiseGate.h.

◆ maxLookaheadSamples_

template<FloatType T>
int dspark::NoiseGate< T >::maxLookaheadSamples_ = 0
protected

Allocated delay (0 before prepare()).

Definition at line 714 of file NoiseGate.h.

◆ paramsDirty_

template<FloatType T>
std::atomic<bool> dspark::NoiseGate< T >::paramsDirty_ { true }
protected

Definition at line 704 of file NoiseGate.h.

◆ prevSign_

template<FloatType T>
bool dspark::NoiseGate< T >::prevSign_ = false
protected

Definition at line 757 of file NoiseGate.h.

◆ rangeDb_

template<FloatType T>
std::atomic<T> dspark::NoiseGate< T >::rangeDb_ { T(-80) }
protected

Definition at line 700 of file NoiseGate.h.

◆ releaseCoeff_

template<FloatType T>
T dspark::NoiseGate< T >::releaseCoeff_ = T(0)
protected

Definition at line 736 of file NoiseGate.h.

◆ releaseMs_

template<FloatType T>
std::atomic<T> dspark::NoiseGate< T >::releaseMs_ { T(100) }
protected

Definition at line 699 of file NoiseGate.h.

◆ sampleRate_

template<FloatType T>
double dspark::NoiseGate< T >::sampleRate_ = 48000.0
protected

Definition at line 693 of file NoiseGate.h.

◆ scHpfA0_

template<FloatType T>
T dspark::NoiseGate< T >::scHpfA0_ = T(0.9975)
protected

Definition at line 731 of file NoiseGate.h.

◆ scHpfCoeff_

template<FloatType T>
T dspark::NoiseGate< T >::scHpfCoeff_ = T(0.995)
protected

Definition at line 730 of file NoiseGate.h.

◆ scHpfEnabled_

template<FloatType T>
std::atomic<bool> dspark::NoiseGate< T >::scHpfEnabled_ { false }
protected

Definition at line 706 of file NoiseGate.h.

◆ scHpfFreq_

template<FloatType T>
std::atomic<T> dspark::NoiseGate< T >::scHpfFreq_ { T(80) }
protected

Definition at line 707 of file NoiseGate.h.

◆ scHpfPrev_

template<FloatType T>
std::array<T, kMaxScChannels> dspark::NoiseGate< T >::scHpfPrev_ {}
protected

Definition at line 733 of file NoiseGate.h.

◆ scHpfState_

template<FloatType T>
std::array<T, kMaxScChannels> dspark::NoiseGate< T >::scHpfState_ {}
protected

Definition at line 732 of file NoiseGate.h.

◆ state_

template<FloatType T>
State dspark::NoiseGate< T >::state_ = State::Closed
protected

Definition at line 743 of file NoiseGate.h.

◆ threshold_

template<FloatType T>
std::atomic<T> dspark::NoiseGate< T >::threshold_ { T(-40) }
protected

Definition at line 695 of file NoiseGate.h.

◆ zeroCrossCount_

template<FloatType T>
int dspark::NoiseGate< T >::zeroCrossCount_ = 0
protected

Definition at line 755 of file NoiseGate.h.

◆ zeroCrossSamples_

template<FloatType T>
int dspark::NoiseGate< T >::zeroCrossSamples_ = 0
protected

Definition at line 756 of file NoiseGate.h.


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