10 arm_min_f32(
data,
size, value, &idx);
15 for(
size_t n=1; n<
size; n++){
16 float currentValue=
data[n];
17 if(currentValue<*value){
46 arm_max_f32(
data,
size, value, &idx);
51 for(
size_t n=1; n<
size; n++){
52 float currentValue=
data[n];
53 if(currentValue>*value){
83 for(
size_t n=0; n<minSize; n++){
84 destination[n] = fabsf(
data[n]);
90 if(destination==*
this){
94 for(
size_t n=0; n<
size; n++){
100 for(
size_t n=0; n<
size/2; n++){
109 for(
size_t n=0; n<
getSize(); n++)
110 destination[n] = 1.0f/
data[n];
121 for(
size_t n=0; n<
size; n++){
122 result += pSrc[n]*pSrc[n];
124 result=sqrtf(result/
size);
131 for(
size_t n=0; n<
size; n++)
143 for(
size_t n=0; n<
size; n++){
155 arm_power_f32 (
data,
size, &result);
159 for(
size_t n=0; n<
size; n++){
160 result += pSrc[n]*pSrc[n];
185 for(
size_t n=0; n<
size; n++){
188 result=(sumOfSquares - sum*sum/
size) / (
size - 1);
198 for(
size_t n=0; n<
size; n++){
207 for(
size_t n=0; n<
size; n++){
216 ASSERT(
size >= offset+length,
"Array too small");
225 for(
size_t n=0; n<
size; n++){
241 for(
size_t n=0; n<
size; n++){
242 destination[n]=
data[n]+operand2[n];
249 add(operand2, *
this);
253 for(
size_t n=0; n<
size; n++){
259 for(
size_t n=0; n<
size; n++)
260 destination[n] =
data[n]+scalar;
273 for(
size_t n=0; n<
size; n++){
274 destination[n]=
data[n]-operand2[n];
285 for(
size_t n=0; n<
size; n++){
300 for(
size_t n=0; n<
size; n++){
301 destination[n]=
data[n]*operand2[n];
316 for(
size_t n=0; n<
size; n++)
323 arm_scale_f32(
data, scalar, destination,
size);
325 for(
size_t n=0; n<
size; n++)
326 destination[n] =
data[n] * scalar;
334 for(
size_t n=0; n<
size; n++){
335 destination[n]=-
data[n];
345 float amplitude = fabsf(
max-
min);
347 for(
size_t n=0; n<
size; n++)
357 size_t size2 = operand2.
getSize();
358 for(
size_t n=0; n<
size+size2-1; n++){
361 for(
size_t k=0; k<size2; k++){
363 destination[n] +=
data[n1]*operand2[k];
385 size_t size2=operand2.
getSize();
386 for (
size_t n=offset; n<offset+samples; n++){
389 for(
size_t k=0; k<size2; k++){
391 destination[n]+=
data[n1]*operand2[k];
422 for(
size_t i=0; i<
size; i++)
423 destination[i] = log10f(
data[i])*20.0;
428 for(
size_t i=0; i<
size; i++)
429 destination[i] = exp10f(
data[i]*0.05);
433 float step = (to-from)/
size;
434 for(
size_t i=0; i<
size; i++){
441 float step = (to-from)/
size;
442 for(
size_t i=0; i<
size; i++){
455 for(
size_t i=0; i<
size; i++){
457 destination[i] =
clamp((3*x/2)*(1-x*x/3), -1.0f, 1.0f);
462 for(
size_t i=0; i<
size; i++)
463 destination[i] = tanhf(
data[i]);
float randf()
generate a random number between 0 and 1
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 add(FloatArray operand2, FloatArray destination)
Element-wise sum between arrays.
float getVariance()
Variance of the array.
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 reverse(FloatArray &destination)
Reverse the array Copies the elements of the array in reversed order into destination.
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.
T * getData()
Get the data stored in the Array.
#define ASSERT(cond, msg)