DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
dspark::Smoothers::OnePoleSmoother Class Reference

Authentic one-pole exponential IIR low-pass smoother. More...

#include <Smoothers.h>

Public Member Functions

void reset (double sampleRate, float timeConstantMilliseconds, float initialValue=0.0f) noexcept
 
void setTargetValue (float newTarget) noexcept
 
float getNextValue () noexcept
 
float getCurrentValue () const noexcept
 
float getTargetValue () const noexcept
 
bool isSmoothing () const noexcept
 
void skip () noexcept
 

Static Public Attributes

static constexpr float epsilon = 1e-6f
 

Detailed Description

Authentic one-pole exponential IIR low-pass smoother.

Implements analog-style smoothing. Anti-denormal protected.

Internal state is double precision: in float the recursion stalls once coeff * delta rounds back to the same value, parking the output around ulp(target) / (1 - coeff) away from the target (about 1e-5 for a 10 ms tau at 48 kHz and unity-scale targets), outside the settle window, so isSmoothing() would never turn off. The public API stays float.

Definition at line 136 of file Smoothers.h.

Member Function Documentation

◆ getCurrentValue()

float dspark::Smoothers::OnePoleSmoother::getCurrentValue ( ) const
inlinenoexcept

Definition at line 145 of file Smoothers.h.

◆ getNextValue()

float dspark::Smoothers::OnePoleSmoother::getNextValue ( )
inlinenoexcept

Definition at line 476 of file Smoothers.h.

◆ getTargetValue()

float dspark::Smoothers::OnePoleSmoother::getTargetValue ( ) const
inlinenoexcept

Definition at line 146 of file Smoothers.h.

◆ isSmoothing()

bool dspark::Smoothers::OnePoleSmoother::isSmoothing ( ) const
inlinenoexcept

Definition at line 483 of file Smoothers.h.

◆ reset()

void dspark::Smoothers::OnePoleSmoother::reset ( double  sampleRate,
float  timeConstantMilliseconds,
float  initialValue = 0.0f 
)
inlinenoexcept

Definition at line 462 of file Smoothers.h.

◆ setTargetValue()

void dspark::Smoothers::OnePoleSmoother::setTargetValue ( float  newTarget)
inlinenoexcept

Definition at line 471 of file Smoothers.h.

◆ skip()

void dspark::Smoothers::OnePoleSmoother::skip ( )
inlinenoexcept

Definition at line 488 of file Smoothers.h.

Member Data Documentation

◆ epsilon

constexpr float dspark::Smoothers::OnePoleSmoother::epsilon = 1e-6f
staticconstexpr

Definition at line 139 of file Smoothers.h.


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