Signalsmith Audio's DSP Library  1.6.0
Useful C++ classes/templates for audio effects
Static Methods | Methods
signalsmith::curves::Cubic< Sample > Class Template Reference

#include <curves.h>

Detailed Description

template<typename Sample = double>
class signalsmith::curves::Cubic< Sample >

A real-valued cubic curve. It has a "start" point where accuracy is highest.

Static Methods

static Cubic hermite (Sample x0, Sample x1, Sample y0, Sample y1, Sample g0, Sample g1)
 Cubic segment based on start/end values and gradients. More...
 
static Cubic smooth (Sample x0, Sample x1, Sample x2, Sample x3, Sample y0, Sample y1, Sample y2, Sample y3, bool monotonic=false)
 Cubic segment (valid between x1 and x2), which is smooth when applied to an adjacent set of points. More...
 

Methods

 Cubic (Sample xStart, Sample a0, Sample a1, Sample a2, Sample a3)
 
Sample operator() (Sample x) const
 
Sample start () const
 The reference x-value, used as the centre of the cubic expansion. More...
 
Cubic dx () const
 Differentiate. More...
 
Sample dx (Sample x) const
 

Method Details

◆ dx()

template<typename Sample = double>
Cubic signalsmith::curves::Cubic< Sample >::dx ( ) const
inline

Differentiate.

◆ hermite()

template<typename Sample = double>
static Cubic signalsmith::curves::Cubic< Sample >::hermite ( Sample  x0,
Sample  x1,
Sample  y0,
Sample  y1,
Sample  g0,
Sample  g1 
)
inlinestatic

Cubic segment based on start/end values and gradients.

◆ smooth()

template<typename Sample = double>
static Cubic signalsmith::curves::Cubic< Sample >::smooth ( Sample  x0,
Sample  x1,
Sample  x2,
Sample  x3,
Sample  y0,
Sample  y1,
Sample  y2,
Sample  y3,
bool  monotonic = false 
)
inlinestatic

Cubic segment (valid between x1 and x2), which is smooth when applied to an adjacent set of points.

If x0 == x1 or x2 == x3 it will choose a gradient which continues in a quadratic curve, or 0 if the point is a local minimum/maximum.

◆ start()

template<typename Sample = double>
Sample signalsmith::curves::Cubic< Sample >::start ( ) const
inline

The reference x-value, used as the centre of the cubic expansion.