1 #ifndef __FloatArray_h__
2 #define __FloatArray_h__
39 void getMin(
float* value,
int* index);
46 void getMax(
float* value,
int* index);
190 void clip(
float range);
241 void add(
float scalar);
364 void ramp(
float from,
float to);
375 scale(from, to, *
this);
This class contains useful methods for manipulating arrays of floats.
void reverse()
Reverse the array.
float getStandardDeviation()
Standard deviation of the array.
void clear()
Clear the array.
void negate()
Negate the array.
void noise()
Random values Fills the array with random values in the range [-1, 1)
void multiply(FloatArray operand2, FloatArray destination)
Element-wise multiplication between arrays.
float getRms()
Root mean square value of the array.
int getMinIndex()
Get the index of the minimum value in the array.
void decibelToGain(FloatArray destination)
Convert decibel to gains values: gain = 10^(dB/20) -6dB = 0.5, 0dB = 1.0, +6dB = 2....
float getPower()
Power of the array.
float getMinValue()
Get the minimum value in the array.
void scale(float from, float to)
In-place scale.
void add(FloatArray operand2, FloatArray destination)
Element-wise sum between arrays.
float getVariance()
Variance of the array.
FloatArray(float *data, size_t size)
float getSum()
Sum of the array.
void reciprocal()
Reciprocal of the array, in-place version.
int getMaxIndex()
Get the index of the maximum value in the array.
void ramp(float from, float to)
Create a linear ramp from one value to another.
static void destroy(FloatArray array)
Destroys a FloatArray created with the create() method.
void rectify()
Absolute value of the array, in-place version.
void gainToDecibel(FloatArray destination)
Convert gains to decibel values: dB = log10(gain)*20 Gain 0.5 = -6dB, 1.0 = 0dB, 2....
void correlateInitialized(FloatArray operand2, FloatArray destination)
Correlation between arrays.
float getMean()
Mean of the array.
static FloatArray create(int size)
Creates a new FloatArray.
void subtract(FloatArray operand2, FloatArray destination)
Element-wise difference between arrays.
void clip()
Clips the elements in the array in the range [-1, 1].
void correlate(FloatArray operand2, FloatArray destination)
Correlation between arrays.
void scale(float from, float to, FloatArray destination)
Scale all values along a linear ramp from one value to another.
void getMax(float *value, int *index)
Get the maximum value in the array and its index.
void softclip()
Applies a cubic soft-clip algorithm to all elements in the array which limits them to the range [-1,...
void convolve(FloatArray operand2, FloatArray destination)
Convolution between arrays.
FloatArray subArray(int offset, size_t length)
A subset of the array.
void tanh()
In-place tanh.
void setAll(float value)
Set all the values in the array.
void getMin(float *value, int *index)
Get the minimum value in the array and its index.
float getMaxValue()
Get the maximum value in the array.
SimpleArray holds a pointer to an array and the array size, and is designed to be passed by value.