# ddsp.util.functions

## Members

### Functions

decibelToFloat
float decibelToFloat(float value)

Accepts a decibel value and returns its floating point equivalent.

floatToDecibel
float floatToDecibel(float value)

+ This is a collection of useful DSP related functions and algorithms. + if you feel anything is missing, please feel free to add it. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/ /// Accepts a floating point value and returns its decibel equivalent. /// value should be in the range of -1 to 1 and returns a float in the /// range -96 to

lagrpol
float lagrpol(float[] arrX, float[] arrY, int order, float input)

Lagrange Interpolation Accepts: arrX = an array of x coordinates. arrY = an array of y coordinates. order = the number of coordinates (size of arrX & arrY) input = the x coordinate whose corresponding y value will be found Returns a y value along the curve that touches each (x,y) pair from arrX and arrY. The pair (input, sum) is a point on that curve.

linearInterp
float linearInterp(float x1, float x2, float y1, float y2, float x)

Linear Interpolation between two points. (x1,y1) is the leftmost point and (x2,y2) is the rightmost point. x is some number between x1 and x2. Returns the corresopnding y value for x such that (x,y) is a point on the line that intersects (x1,y1) and (x2,y2)

msToSamples
float msToSamples(float ms, float sampleRate)

Accepts a time in milliseconds and the sample rate Returns the amount of samples that corresponds to the time in milliseconds.

roundToInt
int roundToInt(float x)

Simple nothrow @nogc method of rounding a float to an int

samplesToMs
float samplesToMs(float samples, float sampleRate)

Accepts a number of samples and the sample rate. Returns the corresponding time in milliseconds.

sinc
float sinc(float x)

sinc(x) aka the sampling function.