1 #ifndef __ShortArray_h__
2 #define __ShortArray_h__
32 void getMin(int16_t* value,
int* index);
39 void getMax(int16_t* value,
int* index);
167 void clip(int16_t range);
196 void add(int16_t scalar);
285 void setAll(int16_t value);
358 void move(
int fromIndex,
int toIndex,
size_t length);
365 void shift(
int shiftValue);
This class contains useful methods for manipulating arrays of floats.
This class contains useful methods for manipulating arrays of int16_ts.
int16_t getMean()
Mean of the array.
void correlate(ShortArray operand2, ShortArray destination)
Correlation between arrays.
void rectify()
Absolute value of the array.
void setFloatValue(uint32_t n, float value)
Converts a float to int16 and stores it.
void setAll(int16_t value)
Set all the values in the array.
int16_t getStandardDeviation()
Standard deviation of the array.
void noise()
Random values Fills the array with random values in the range [-1, 1)
void fromFloat(FloatArray source)
Copies the content of a FloatArray into a ShortArray, converting the float elements to fixed-point 1....
void toFloat(FloatArray destination)
Copies the content of the array to a FloatArray, interpreting the content of the ShortArray as 1....
int getMinIndex()
Get the index of the minimum value in the array.
void shift(int shiftValue)
Bitshift the array values, saturating.
void insert(ShortArray source, int sourceOffset, int destinationOffset, size_t samples)
Copies the content of an array into a subset of the array.
void clip(int16_t range)
Clips the elements in the array in the range [-**range**, range].
static void destroy(ShortArray array)
Destroys a ShortArray created with the create() method.
ShortArray subArray(int offset, size_t length)
A subset of the array.
void clear()
Clear the array.
void subtract(ShortArray operand2, ShortArray destination)
Element-wise difference between arrays.
void multiply(ShortArray operand2, ShortArray destination)
Element-wise multiplication between arrays.
void insert(ShortArray source, int destinationOffset, size_t samples)
Copies the content of an array into a subset of the array.
int16_t getMaxValue()
Get the maximum value in the array.
float getFloatValue(uint32_t n)
Returns an element of the array converted to float.
void reciprocal()
Reciprocal of the array.
int16_t getMinValue()
Get the minimum value in the array.
int16_t getVariance()
Variance of the array.
int16_t getRms()
Root mean square value of the array.
static ShortArray create(int size)
Creates a new ShortArray.
void getMax(int16_t *value, int *index)
Get the maximum value in the array and its index.
int64_t getPower()
Power of the array.
void move(int fromIndex, int toIndex, size_t length)
Copies values within an array.
int getMaxIndex()
Get the index of the maximum value in the array.
void negate()
Negate the array.
void correlateInitialized(ShortArray operand2, ShortArray destination)
Correlation between arrays.
void getMin(int16_t *value, int *index)
Get the minimum value in the array and its index.
ShortArray(int16_t *data, size_t size)
void convolve(ShortArray operand2, ShortArray destination)
Convolution between arrays.
void add(ShortArray operand2, ShortArray destination)
Element-wise sum between arrays.
void reverse()
Reverse the array.
SimpleArray holds a pointer to an array and the array size, and is designed to be passed by value.