DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::Smoothers::SlewLimiter Class Reference

Rate limiter to cap maximum change per sample. More...

#include <Smoothers.h>

Public Member Functions

void reset (double sampleRate, float maxRatePerSecond, 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

Rate limiter to cap maximum change per sample.

Internal state is double precision (the public API stays float): in float a step below half an ulp of the value was lost, and a limiter at 10000 with a 20 units/s rate at 48 kHz never moved.

Definition at line 229 of file Smoothers.h.

Member Function Documentation

◆ getCurrentValue()

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

Definition at line 238 of file Smoothers.h.

◆ getNextValue()

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

Definition at line 667 of file Smoothers.h.

◆ getTargetValue()

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

Definition at line 239 of file Smoothers.h.

◆ isSmoothing()

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

Definition at line 675 of file Smoothers.h.

◆ reset()

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

Definition at line 652 of file Smoothers.h.

◆ setTargetValue()

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

Definition at line 662 of file Smoothers.h.

◆ skip()

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

Definition at line 680 of file Smoothers.h.

Member Data Documentation

◆ epsilon

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

Definition at line 232 of file Smoothers.h.


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