DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::detail::AdaaHardClip Struct Reference

#include <Adaa.h>

Static Public Member Functions

static double g (double u) noexcept
 
static double d1 (double u) noexcept
 
static double d2 (double u) noexcept
 
static double d3 (double u) noexcept
 
static AdaaPoint point (double u) noexcept
 
static double value (double u0, double u1, double u2) noexcept
 
static bool exact (const AdaaPoint &p0, const AdaaPoint &p1, const AdaaPoint &p2, double &y) noexcept
 
static double rampAbove (double a, double b, double c, double mean, double tau) noexcept
 
static double rampBelow (double a, double b, double c, double mean, double tau) noexcept
 

Static Public Attributes

static constexpr bool kClosedForm = true
 

Detailed Description

Definition at line 94 of file Adaa.h.

Member Function Documentation

◆ d1()

static double dspark::detail::AdaaHardClip::d1 ( double  u)
inlinestaticnoexcept

Definition at line 102 of file Adaa.h.

◆ d2()

static double dspark::detail::AdaaHardClip::d2 ( double  u)
inlinestaticnoexcept

Definition at line 107 of file Adaa.h.

◆ d3()

static double dspark::detail::AdaaHardClip::d3 ( double  u)
inlinestaticnoexcept

Definition at line 108 of file Adaa.h.

◆ exact()

static bool dspark::detail::AdaaHardClip::exact ( const AdaaPoint &  p0,
const AdaaPoint &  p1,
const AdaaPoint &  p2,
double &  y 
)
inlinestaticnoexcept

Exact in every case: clamp(t) = t - (t - 1)+ + (-1 - t)+, and the B-spline average of a ramp (t - tau)+ has a closed form with no subtraction of nearly equal terms, so a kink crossed in tiny steps costs no accuracy (the divided-difference formula lost up to five digits there). Three points on one linear piece return before any ramp is evaluated.

Definition at line 128 of file Adaa.h.

◆ g()

static double dspark::detail::AdaaHardClip::g ( double  u)
inlinestaticnoexcept

Definition at line 96 of file Adaa.h.

◆ point()

static AdaaPoint dspark::detail::AdaaHardClip::point ( double  u)
inlinestaticnoexcept

Definition at line 110 of file Adaa.h.

◆ rampAbove()

static double dspark::detail::AdaaHardClip::rampAbove ( double  a,
double  b,
double  c,
double  mean,
double  tau 
)
inlinestaticnoexcept

Average of (t - tau)+ over the linear B-spline with knots a <= b <= c.

Definition at line 144 of file Adaa.h.

◆ rampBelow()

static double dspark::detail::AdaaHardClip::rampBelow ( double  a,
double  b,
double  c,
double  mean,
double  tau 
)
inlinestaticnoexcept

Average of (tau - t)+ over the same B-spline (mirror of rampAbove).

Definition at line 158 of file Adaa.h.

◆ value()

static double dspark::detail::AdaaHardClip::value ( double  u0,
double  u1,
double  u2 
)
inlinestaticnoexcept

Definition at line 115 of file Adaa.h.

Member Data Documentation

◆ kClosedForm

constexpr bool dspark::detail::AdaaHardClip::kClosedForm = true
staticconstexpr

Closed form for every input triple (see exact()), so Adaa2 keeps only the inputs for this curve.

Definition at line 114 of file Adaa.h.


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