OpenWareLaboratory
KaiserWindow Class Reference
Inheritance diagram for KaiserWindow:
Collaboration diagram for KaiserWindow:

Public Types

enum  WindowType {
  HammingWindow , HannWindow , HanningWindow , TriangularWindow ,
  RectangularWindow , WelchWindow , SineWindow
}
 
typedef enum Window::WindowType WindowType
 

Public Member Functions

void add (float scalar)
 In-place array-scalar addition. More...
 
void add (float scalar, FloatArray destination)
 Array-scalar addition. More...
 
void add (FloatArray operand2)
 Element-wise sum between arrays. More...
 
void add (FloatArray operand2, FloatArray destination)
 Element-wise sum between arrays. More...
 
void apply (float *signalIn)
 
void apply (float *signalIn, float *signalOut)
 
void clear ()
 Clear the array. More...
 
void clip ()
 Clips the elements in the array in the range [-1, 1]. More...
 
void clip (float min, float max)
 Clips the elements in the array in the range [min, max]. More...
 
void clip (float range)
 Clips the elements in the array in the range [-**range**, range]. More...
 
void convolve (FloatArray operand2, FloatArray destination)
 Convolution between arrays. More...
 
void convolve (FloatArray operand2, FloatArray destination, int offset, size_t samples)
 Partial convolution between arrays. More...
 
void copyFrom (SimpleArray< float > source)
 Copies the content of another array into this array. More...
 
void copyTo (SimpleArray< float > destination)
 Copies the content of this array to another array. More...
 
void correlate (FloatArray operand2, FloatArray destination)
 Correlation between arrays. More...
 
void correlateInitialized (FloatArray operand2, FloatArray destination)
 Correlation between arrays. More...
 
void decibelToGain (FloatArray destination)
 Convert decibel to gains values: gain = 10^(dB/20) -6dB = 0.5, 0dB = 1.0, +6dB = 2.0. More...
 
bool equals (const SimpleArray< float > &other) const
 Compares two arrays. More...
 
void gainToDecibel (FloatArray destination)
 Convert gains to decibel values: dB = log10(gain)*20 Gain 0.5 = -6dB, 1.0 = 0dB, 2.0 = +6dB. More...
 
float * getData ()
 Get the data stored in the Array. More...
 
float getElement (size_t index)
 Get a single value stored in the array. More...
 
void getMax (float *value, int *index)
 Get the maximum value in the array and its index. More...
 
int getMaxIndex ()
 Get the index of the maximum value in the array. More...
 
float getMaxValue ()
 Get the maximum value in the array. More...
 
float getMean ()
 Mean of the array. More...
 
void getMin (float *value, int *index)
 Get the minimum value in the array and its index. More...
 
int getMinIndex ()
 Get the index of the minimum value in the array. More...
 
float getMinValue ()
 Get the minimum value in the array. More...
 
float getPower ()
 Power of the array. More...
 
float getRms ()
 Root mean square value of the array. More...
 
size_t getSize () const
 
float getStandardDeviation ()
 Standard deviation of the array. More...
 
float getSum ()
 Sum of the array. More...
 
float getVariance ()
 Variance of the array. More...
 
void insert (SimpleArray< float > source, int destinationOffset, size_t len)
 Copies the content of an array into a subset of the array. More...
 
void insert (SimpleArray< float > source, int sourceOffset, int destinationOffset, size_t len)
 Copies the content of an array into a subset of the array. More...
 
bool isEmpty () const
 
 KaiserWindow ()
 
 KaiserWindow (float *data, size_t size)
 
void move (int fromIndex, int toIndex, size_t len)
 Copies values within an array. More...
 
void multiply (float scalar)
 Array-scalar multiplication. More...
 
void multiply (float scalar, FloatArray destination)
 Array-scalar multiplication. More...
 
void multiply (FloatArray operand2)
 Element-wise multiplication between arrays. More...
 
void multiply (FloatArray operand2, FloatArray destination)
 Element-wise multiplication between arrays. More...
 
void negate ()
 Negate the array. More...
 
void negate (FloatArray &destination)
 Negate the array. More...
 
void noise ()
 Random values Fills the array with random values in the range [-1, 1) More...
 
void noise (float min, float max)
 Random values in range. More...
 
 operator float * ()
 Casting operator to T*. More...
 
float process (float input)
 
void process (FloatArray input, FloatArray output)
 
void ramp (float from, float to)
 Create a linear ramp from one value to another. More...
 
void reciprocal ()
 Reciprocal of the array, in-place version. More...
 
void reciprocal (FloatArray &destination)
 Reciprocal of the array. More...
 
void rectify ()
 Absolute value of the array, in-place version. More...
 
void rectify (FloatArray &destination)
 Absolute value of the array. More...
 
void reverse ()
 Reverse the array. More...
 
void reverse (FloatArray &destination)
 Reverse the array Copies the elements of the array in reversed order into destination. More...
 
void scale (float from, float to)
 In-place scale. More...
 
void scale (float from, float to, FloatArray destination)
 Scale all values along a linear ramp from one value to another. More...
 
void setAll (float value)
 Set all the values in the array. More...
 
void setElement (size_t index, float value)
 Set a single value in the array. More...
 
void softclip ()
 Applies a cubic soft-clip algorithm to all elements in the array which limits them to the range [-1, 1] In-place version. More...
 
void softclip (FloatArray destination)
 Applies a cubic soft-clip algorithm to all elements in the array which limits them to the range [-1, 1]. More...
 
FloatArray subArray (int offset, size_t length)
 A subset of the array. More...
 
void subtract (float scalar)
 Array-scalar subtraction. More...
 
void subtract (FloatArray operand2)
 Element-wise difference between arrays. More...
 
void subtract (FloatArray operand2, FloatArray destination)
 Element-wise difference between arrays. More...
 
void tanh ()
 In-place tanh. More...
 
void tanh (FloatArray destination)
 Apply tanh to each element in the array. More...
 

Static Public Member Functions

static void applyTriangularWindow (float *signal, int size)
 
static void applyTriangularWindow (float *signalIn, float *signalOut, int size)
 
static void applyWindow (float *signal, float *window, int size)
 
static void applyWindow (float *signalIn, float *window, float *signalOut, int size)
 
static void buildTimeDerivativeWindow (FloatArray win, float shape)
 Build a new time-derivative Kaiser analysis window having the specified shaping parameter, for computing frequency reassignment. More...
 
static void buildWindow (FloatArray win, float shape)
 Build a new Kaiser analysis window having the specified shaping parameter. More...
 
static size_t computeLength (float width, float alpha)
 
static float computeShape (float atten)
 
static void copy (float *dst, float *src, size_t len)
 Optimised array copy for datatype T. More...
 
static KaiserWindow create (float shape, size_t size, bool derivative=false)
 
static Window create (int size)
 
static Window create (WindowType type, int size)
 
static void destroy (FloatArray array)
 Destroys a FloatArray created with the create() method. More...
 
static void destroy (KaiserWindow obj)
 
static float firstOrderBessel (float x)
 
static void hamming (float *window, int size)
 
static void hann (float *window, int size)
 
static void rectangular (float *window, int size)
 
static void sine (float *window, int size)
 
static void triangular (float *window, int size)
 
static void welch (float *window, int size)
 
static void window (WindowType type, float *window, int size)
 
static float zeroethOrderBessel (float x)
 

Protected Attributes

float * data
 
size_t size
 

Detailed Description

Definition at line 36 of file KaiserWindow.h.

Member Typedef Documentation

◆ WindowType

typedef enum Window::WindowType Window::WindowType
inherited

Member Enumeration Documentation

◆ WindowType

enum Window::WindowType
inherited
Enumerator
HammingWindow 
HannWindow 
HanningWindow 
TriangularWindow 
RectangularWindow 
WelchWindow 
SineWindow 

Definition at line 24 of file Window.h.

Constructor & Destructor Documentation

◆ KaiserWindow() [1/2]

KaiserWindow::KaiserWindow ( )
inline

Definition at line 38 of file KaiserWindow.h.

◆ KaiserWindow() [2/2]

KaiserWindow::KaiserWindow ( float *  data,
size_t  size 
)
inline

Definition at line 39 of file KaiserWindow.h.

Member Function Documentation

◆ add() [1/4]

void FloatArray::add ( float  scalar)
inherited

In-place array-scalar addition.

Adds scalar to each value in the array

Parameters
[in]scalarvalue to be added to the array

Definition at line 252 of file FloatArray.cpp.

References SimpleArray< float >::data, and SimpleArray< float >::size.

◆ add() [2/4]

void FloatArray::add ( float  scalar,
FloatArray  destination 
)
inherited

Array-scalar addition.

Adds scalar to each value in the array and put the result in destination

Parameters
[in]scalarvalue to be added to the array
[out]destinationthe destination array

Definition at line 258 of file FloatArray.cpp.

References SimpleArray< float >::data, and SimpleArray< float >::size.

◆ add() [3/4]

void FloatArray::add ( FloatArray  operand2)
inherited

Element-wise sum between arrays.

Adds each element of operand2 to the corresponding element in the array.

Parameters
operand2second operand for the sum
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 247 of file FloatArray.cpp.

References FloatArray::add().

◆ add() [4/4]

void FloatArray::add ( FloatArray  operand2,
FloatArray  destination 
)
inherited

Element-wise sum between arrays.

Sets each element in destination to the sum of the corresponding element of the array and operand2

Parameters
[in]operand2second operand for the sum
[out]destinationthe destination array
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 231 of file FloatArray.cpp.

References ASSERT, SimpleArray< T >::data, SimpleArray< float >::data, SimpleArray< float >::size, and SimpleArray< T >::size.

Referenced by AudioBuffer::add(), FloatArray::add(), CrossFadingCircularBuffer< T >::delay(), MorphingOscillator::generate(), VoiceAllocatorSignalGenerator< Allocator, SynthVoice, VOICES >::generate(), PolyBlepOscillator::generate(), StereoFeedbackProcessor::process(), PingPongFeedbackProcessor::process(), DryWetSignalProcessor< Processor >::process(), FeedbackSignalProcessor< Processor >::process(), and VoiceAllocatorSignalProcessor< Allocator, SynthVoice, VOICES >::process().

◆ apply() [1/2]

void Window::apply ( float *  signalIn)
inlineinherited

◆ apply() [2/2]

void Window::apply ( float *  signalIn,
float *  signalOut 
)
inlineinherited

◆ applyTriangularWindow() [1/2]

static void Window::applyTriangularWindow ( float *  signal,
int  size 
)
inlinestaticinherited

Definition at line 120 of file Window.h.

References SimpleArray< float >::size.

◆ applyTriangularWindow() [2/2]

static void Window::applyTriangularWindow ( float *  signalIn,
float *  signalOut,
int  size 
)
inlinestaticinherited

Definition at line 123 of file Window.h.

References FloatArray::ramp(), and SimpleArray< float >::size.

◆ applyWindow() [1/2]

static void Window::applyWindow ( float *  signal,
float *  window,
int  size 
)
inlinestaticinherited

Definition at line 136 of file Window.h.

References SimpleArray< float >::size, and Window::window().

Referenced by Window::apply(), and Window::process().

◆ applyWindow() [2/2]

void Window::applyWindow ( float *  signalIn,
float *  window,
float *  signalOut,
int  size 
)
staticinherited

Definition at line 3 of file Window.cpp.

References SimpleArray< float >::size, and Window::window().

◆ buildTimeDerivativeWindow()

static void KaiserWindow::buildTimeDerivativeWindow ( FloatArray  win,
float  shape 
)
inlinestatic

Build a new time-derivative Kaiser analysis window having the specified shaping parameter, for computing frequency reassignment.

The closed form for the time derivative can be obtained from the property of modified Bessel functions that the derivative of the zeroeth order function is equal to the first order function.

Parameters
winis the vector that will store the window samples. The number of samples computed will be equal to the length of this vector. Any previous contents will be overwritten.
shapeis the Kaiser shaping parameter, controlling the sidelobe rejection level.

Definition at line 104 of file KaiserWindow.h.

References SimpleArray< float >::data, firstOrderBessel(), SimpleArray< T >::getData(), SimpleArray< T >::getSize(), and zeroethOrderBessel().

Referenced by create().

◆ buildWindow()

static void KaiserWindow::buildWindow ( FloatArray  win,
float  shape 
)
inlinestatic

Build a new Kaiser analysis window having the specified shaping parameter.

See Oppenheim and Schafer: "Digital Signal Processing" (1975), p. 452 for further explanation of the Kaiser window. Also, see Kaiser and Schafer, 1980.

Parameters
winis the vector that will store the window samples. The number of samples computed will be equal to the length of this vector. Any previous contents will be overwritten.
shapeis the Kaiser shaping parameter, controlling the sidelobe rejection level.

Definition at line 73 of file KaiserWindow.h.

References SimpleArray< float >::data, SimpleArray< T >::getData(), SimpleArray< T >::getSize(), and zeroethOrderBessel().

Referenced by create().

◆ clear()

void FloatArray::clear ( )
inlineinherited

Clear the array.

Set all the values in the array to 0.

Definition at line 29 of file FloatArray.h.

References FloatArray::setAll().

Referenced by FloatArray::create(), FirFilter::create(), UpSampler::process(), and SimpleMovingAverage::reset().

◆ clip() [1/3]

void FloatArray::clip ( )
inherited

Clips the elements in the array in the range [-1, 1].

Definition at line 193 of file FloatArray.cpp.

◆ clip() [2/3]

void FloatArray::clip ( float  min,
float  max 
)
inherited

Clips the elements in the array in the range [min, max].

Parameters
minminimum value
maxmaximum value

Definition at line 206 of file FloatArray.cpp.

References SimpleArray< float >::data, max, min, and SimpleArray< float >::size.

◆ clip() [3/3]

void FloatArray::clip ( float  range)
inherited

Clips the elements in the array in the range [-**range**, range].

Parameters
rangeclipping value.

Definition at line 197 of file FloatArray.cpp.

References SimpleArray< float >::data, max, and SimpleArray< float >::size.

◆ computeLength()

static size_t KaiserWindow::computeLength ( float  width,
float  alpha 
)
inlinestatic

Definition at line 209 of file KaiserWindow.h.

References M_PI.

◆ computeShape()

static float KaiserWindow::computeShape ( float  atten)
inlinestatic

Definition at line 182 of file KaiserWindow.h.

References ASSERT.

◆ convolve() [1/2]

void FloatArray::convolve ( FloatArray  operand2,
FloatArray  destination 
)
inherited

Convolution between arrays.

Sets destination to the result of the convolution between the array and operand2

Parameters
[in]operand2the second operand for the convolution
[out]destinationarray. It must have a minimum size of this+other-1.
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 352 of file FloatArray.cpp.

References ASSERT, SimpleArray< T >::data, SimpleArray< float >::data, SimpleArray< T >::getSize(), SimpleArray< float >::size, and SimpleArray< T >::size.

Referenced by FloatArray::correlateInitialized().

◆ convolve() [2/2]

void FloatArray::convolve ( FloatArray  operand2,
FloatArray  destination,
int  offset,
size_t  samples 
)
inherited

Partial convolution between arrays.

Perform partial convolution: start at offset and compute samples values.

Parameters
[in]operand2the second operand for the convolution.
[out]destinationthe destination array.
[in]offsetfirst output sample to compute
[in]samplesnumber of samples to compute
Remarks
destination[n] is left unchanged for n<offset and the result is stored from destination[offset] onwards that is, in the same position where they would be if a full convolution was performed.
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 370 of file FloatArray.cpp.

References ASSERT, SimpleArray< T >::data, SimpleArray< float >::data, SimpleArray< T >::getData(), SimpleArray< T >::getSize(), SimpleArray< float >::size, and SimpleArray< T >::size.

◆ copy()

static void SimpleArray< float >::copy ( T *  dst,
T *  src,
size_t  len 
)
inlinestaticinherited

Optimised array copy for datatype T.

Copy four at a time to minimise loop overheads and allow SIMD optimisations. This performs well on external RAM but is slower on internal memory compared to memcpy.

Definition at line 134 of file SimpleArray.h.

◆ copyFrom()

void SimpleArray< float >::copyFrom ( SimpleArray< T >  source)
inlineinherited

Copies the content of another array into this array.

This array needs to be at least as big as the other array.

Parameters
[in]sourcethe source array

Definition at line 86 of file SimpleArray.h.

◆ copyTo()

void SimpleArray< float >::copyTo ( SimpleArray< T >  destination)
inlineinherited

Copies the content of this array to another array.

The other array needs to be at least as big as this array.

Parameters
[out]destinationthe destination array

Definition at line 76 of file SimpleArray.h.

◆ correlate()

void FloatArray::correlate ( FloatArray  operand2,
FloatArray  destination 
)
inherited

Correlation between arrays.

Sets destination to the correlation of the array and operand2.

Parameters
[in]operand2the second operand for the correlation
[out]destinationthe destination array. It must have a minimum size of 2*max(srcALen, srcBLen)-1
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 398 of file FloatArray.cpp.

References FloatArray::correlateInitialized(), and FloatArray::setAll().

◆ correlateInitialized()

void FloatArray::correlateInitialized ( FloatArray  operand2,
FloatArray  destination 
)
inherited

Correlation between arrays.

Sets destination to the correlation of this array and operand2.

Parameters
[in]operand2the second operand for the correlation
[out]destinationarray. It must have a minimum size of 2*max(srcALen, srcBLen)-1
Remarks
It is the same as correlate(), but destination must have been initialized to 0 in advance.
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 404 of file FloatArray.cpp.

References ASSERT, FloatArray::convolve(), SimpleArray< T >::data, SimpleArray< float >::data, FloatArray::reverse(), SimpleArray< float >::size, and SimpleArray< T >::size.

Referenced by FloatArray::correlate().

◆ create() [1/3]

static KaiserWindow KaiserWindow::create ( float  shape,
size_t  size,
bool  derivative = false 
)
inlinestatic

◆ create() [2/3]

static Window Window::create ( int  size)
inlinestaticinherited

Definition at line 55 of file Window.h.

References SimpleArray< float >::size.

◆ create() [3/3]

static Window Window::create ( WindowType  type,
int  size 
)
inlinestaticinherited

Definition at line 50 of file Window.h.

References SimpleArray< float >::size, and Window::window().

Referenced by FourierPitchDetector::init().

◆ decibelToGain()

void FloatArray::decibelToGain ( FloatArray  destination)
inherited

Convert decibel to gains values: gain = 10^(dB/20) -6dB = 0.5, 0dB = 1.0, +6dB = 2.0.

Definition at line 426 of file FloatArray.cpp.

References ASSERT, SimpleArray< float >::data, SimpleArray< T >::getSize(), and SimpleArray< float >::size.

◆ destroy() [1/2]

◆ destroy() [2/2]

static void KaiserWindow::destroy ( KaiserWindow  obj)
inlinestatic

Definition at line 50 of file KaiserWindow.h.

References FloatArray::destroy().

◆ equals()

bool SimpleArray< float >::equals ( const SimpleArray< T > &  other) const
inlineinherited

Compares two arrays.

Performs an element-wise comparison of the values contained in the arrays.

Parameters
otherthe array to compare against.
Returns
true if the arrays have the same size and the value of each of the elements of the one match the value of the corresponding element of the other, or false otherwise.

Definition at line 61 of file SimpleArray.h.

◆ firstOrderBessel()

static float KaiserWindow::firstOrderBessel ( float  x)
inlinestatic

Definition at line 154 of file KaiserWindow.h.

Referenced by buildTimeDerivativeWindow().

◆ gainToDecibel()

void FloatArray::gainToDecibel ( FloatArray  destination)
inherited

Convert gains to decibel values: dB = log10(gain)*20 Gain 0.5 = -6dB, 1.0 = 0dB, 2.0 = +6dB.

Definition at line 420 of file FloatArray.cpp.

References ASSERT, SimpleArray< float >::data, SimpleArray< T >::getSize(), and SimpleArray< float >::size.

◆ getData()

float * SimpleArray< float >::getData ( )
inlineinherited

Get the data stored in the Array.

Returns
a T* pointer to the data stored in the Array

Definition at line 27 of file SimpleArray.h.

◆ getElement()

float SimpleArray< float >::getElement ( size_t  index)
inlineinherited

Get a single value stored in the array.

Returns
the value stored at index
Parameters
index

Definition at line 43 of file SimpleArray.h.

◆ getMax()

void FloatArray::getMax ( float *  value,
int *  index 
)
inherited

Get the maximum value in the array and its index.

Parameters
[out]valuewill be set to the maximum value after the call
[out]indexwill be set to the index of the maximum value after the call
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 41 of file FloatArray.cpp.

References ASSERT, SimpleArray< float >::data, and SimpleArray< float >::size.

Referenced by FloatArray::getMaxIndex(), and FloatArray::getMaxValue().

◆ getMaxIndex()

int FloatArray::getMaxIndex ( )
inherited

Get the index of the maximum value in the array.

Returns
the maximum value contained in the array
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 69 of file FloatArray.cpp.

References FloatArray::getMax().

Referenced by FourierPitchDetector::computeFrequency().

◆ getMaxValue()

float FloatArray::getMaxValue ( )
inherited

Get the maximum value in the array.

Returns
the maximum value contained in the array
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 61 of file FloatArray.cpp.

References FloatArray::getMax().

◆ getMean()

float FloatArray::getMean ( )
inherited

Mean of the array.

Gets the mean (or average) of the values in the array.

Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 136 of file FloatArray.cpp.

References SimpleArray< float >::data, and SimpleArray< float >::size.

Referenced by ZeroCrossingPitchDetector::getFrequency().

◆ getMin()

void FloatArray::getMin ( float *  value,
int *  index 
)
inherited

Get the minimum value in the array and its index.

Parameters
[out]valuewill be set to the minimum value after the call
[out]indexwill be set to the index of the minimum value after the call
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 6 of file FloatArray.cpp.

References SimpleArray< float >::data, and SimpleArray< float >::size.

Referenced by FloatArray::getMinIndex(), and FloatArray::getMinValue().

◆ getMinIndex()

int FloatArray::getMinIndex ( )
inherited

Get the index of the minimum value in the array.

Returns
the mimimum value contained in the array
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 33 of file FloatArray.cpp.

References FloatArray::getMin().

◆ getMinValue()

float FloatArray::getMinValue ( )
inherited

Get the minimum value in the array.

Returns
the minimum value contained in the array
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 25 of file FloatArray.cpp.

References FloatArray::getMin().

◆ getPower()

float FloatArray::getPower ( )
inherited

Power of the array.

Gets the power of the values in the array.

Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 151 of file FloatArray.cpp.

References SimpleArray< float >::data, and SimpleArray< float >::size.

Referenced by FloatArray::getVariance().

◆ getRms()

float FloatArray::getRms ( )
inherited

Root mean square value of the array.

Gets the root mean square of the values in the array.

Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 113 of file FloatArray.cpp.

References SimpleArray< float >::data, and SimpleArray< float >::size.

◆ getSize()

size_t SimpleArray< float >::getSize ( ) const
inlineinherited

Definition at line 31 of file SimpleArray.h.

◆ getStandardDeviation()

float FloatArray::getStandardDeviation ( )
inherited

Standard deviation of the array.

Gets the standard deviation of the values in the array.

Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 166 of file FloatArray.cpp.

References SimpleArray< float >::data, FloatArray::getVariance(), and SimpleArray< float >::size.

◆ getSum()

float FloatArray::getSum ( )
inherited

Sum of the array.

Gets the sum of the values in the array.

Definition at line 129 of file FloatArray.cpp.

References SimpleArray< float >::data, and SimpleArray< float >::size.

◆ getVariance()

float FloatArray::getVariance ( )
inherited

Variance of the array.

Gets the variance of the values in the array.

Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 177 of file FloatArray.cpp.

References SimpleArray< float >::data, FloatArray::getPower(), and SimpleArray< float >::size.

Referenced by FloatArray::getStandardDeviation().

◆ hamming()

static void Window::hamming ( float *  window,
int  size 
)
inlinestaticinherited

Definition at line 91 of file Window.h.

References M_PI, SimpleArray< float >::size, and Window::window().

Referenced by Window::window().

◆ hann()

static void Window::hann ( float *  window,
int  size 
)
inlinestaticinherited

Definition at line 87 of file Window.h.

References M_PI, SimpleArray< float >::size, and Window::window().

Referenced by Window::window().

◆ insert() [1/2]

void SimpleArray< float >::insert ( SimpleArray< T >  source,
int  destinationOffset,
size_t  len 
)
inlineinherited

Copies the content of an array into a subset of the array.

Copies len elements from source to destinationOffset in the current array.

Parameters
[in]sourcethe source array
[in]destinationOffsetthe offset into the destination array
[in]lenthe number of samples to copy

Definition at line 99 of file SimpleArray.h.

◆ insert() [2/2]

void SimpleArray< float >::insert ( SimpleArray< T >  source,
int  sourceOffset,
int  destinationOffset,
size_t  len 
)
inlineinherited

Copies the content of an array into a subset of the array.

Copies len elements starting from sourceOffset of source to destinationOffset in the current array.

Parameters
[in]sourcethe source array
[in]sourceOffsetthe offset into the source array
[in]destinationOffsetthe offset into the destination array
[in]lenthe number of samples to copy

Definition at line 111 of file SimpleArray.h.

◆ isEmpty()

bool SimpleArray< float >::isEmpty ( ) const
inlineinherited

Definition at line 35 of file SimpleArray.h.

◆ move()

void SimpleArray< float >::move ( int  fromIndex,
int  toIndex,
size_t  len 
)
inlineinherited

Copies values within an array.

Copies length values starting from index fromIndex to locations starting with index toIndex

Parameters
[in]fromIndexthe first element to copy
[in]toIndexthe destination of the first element
[in]lenthe number of elements to copy

Definition at line 124 of file SimpleArray.h.

◆ multiply() [1/4]

void FloatArray::multiply ( float  scalar)
inherited

Array-scalar multiplication.

Multiplies the values in the array by scalar.

Parameters
scalarto be multiplied with the array elements

Definition at line 312 of file FloatArray.cpp.

References SimpleArray< float >::data, and SimpleArray< float >::size.

◆ multiply() [2/4]

void FloatArray::multiply ( float  scalar,
FloatArray  destination 
)
inherited

Array-scalar multiplication.

Multiplies the values in the array by scalar.

Parameters
scalarto be subtracted from the array
destinationthe destination array

Definition at line 321 of file FloatArray.cpp.

References SimpleArray< float >::data, and SimpleArray< float >::size.

◆ multiply() [3/4]

void FloatArray::multiply ( FloatArray  operand2)
inherited

Element-wise multiplication between arrays.

Multiplies each element in the array by the corresponding element in operand2.

Parameters
operand2second operand for the sum
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 307 of file FloatArray.cpp.

References FloatArray::multiply().

◆ multiply() [4/4]

void FloatArray::multiply ( FloatArray  operand2,
FloatArray  destination 
)
inherited

Element-wise multiplication between arrays.

Sets each element in destination to the product of the corresponding element of the array and operand2

Parameters
[in]operand2second operand for the product
[out]destinationthe destination array
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 290 of file FloatArray.cpp.

References ASSERT, SimpleArray< T >::data, SimpleArray< float >::data, SimpleArray< float >::size, and SimpleArray< T >::size.

Referenced by MorphingOscillator::generate(), PolyBlepOscillator::generate(), PolyBlepOscillator::getSamples(), AudioBuffer::multiply(), FloatArray::multiply(), StereoFeedbackProcessor::process(), PingPongFeedbackProcessor::process(), FourierPitchDetector::process(), DryWetSignalProcessor< Processor >::process(), and FeedbackSignalProcessor< Processor >::process().

◆ negate() [1/2]

void FloatArray::negate ( )
inlineinherited

Negate the array.

Sets each element in the array to its opposite.

Definition at line 127 of file FloatArray.h.

◆ negate() [2/2]

void FloatArray::negate ( FloatArray destination)
inherited

Negate the array.

Stores the opposite of the elements in the array into destination.

Parameters
[out]destinationthe destination array.
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 330 of file FloatArray.cpp.

References SimpleArray< float >::data, SimpleArray< T >::getData(), and SimpleArray< float >::size.

◆ noise() [1/2]

void FloatArray::noise ( )
inherited

Random values Fills the array with random values in the range [-1, 1)

Definition at line 340 of file FloatArray.cpp.

◆ noise() [2/2]

void FloatArray::noise ( float  min,
float  max 
)
inherited

Random values in range.

Fills the array with random values in the range [min, max)

Parameters
minminimum value in the range
maxmaximum value in the range

Definition at line 344 of file FloatArray.cpp.

References SimpleArray< float >::data, max, min, randf(), and SimpleArray< float >::size.

◆ operator float *()

SimpleArray< float >::operator float * ( )
inlineinherited

Casting operator to T*.

Returns
a T* pointer to the data stored in the Array

Definition at line 157 of file SimpleArray.h.

◆ process() [1/2]

float Window::process ( float  input)
inlinevirtualinherited

Reimplemented from SignalProcessor.

Definition at line 41 of file Window.h.

References SimpleArray< float >::getData(), and SimpleArray< float >::getSize().

◆ process() [2/2]

void Window::process ( FloatArray  input,
FloatArray  output 
)
inlinevirtualinherited

Reimplemented from SignalProcessor.

Definition at line 47 of file Window.h.

References Window::applyWindow(), SimpleArray< float >::getData(), and SimpleArray< float >::getSize().

◆ ramp()

void FloatArray::ramp ( float  from,
float  to 
)
inherited

Create a linear ramp from one value to another.

Interpolates all samples in the FloatArray between the endpoints from to to.

Definition at line 432 of file FloatArray.cpp.

References SimpleArray< float >::data, and SimpleArray< float >::size.

Referenced by Window::applyTriangularWindow(), and Window::triangular().

◆ reciprocal() [1/2]

void FloatArray::reciprocal ( )
inlineinherited

Reciprocal of the array, in-place version.

Sets each element in the array to its reciprocal.

Definition at line 111 of file FloatArray.h.

◆ reciprocal() [2/2]

void FloatArray::reciprocal ( FloatArray destination)
inherited

Reciprocal of the array.

Stores the reciprocal of the elements in the array into destination.

Parameters
[out]destinationthe destination array.

Definition at line 107 of file FloatArray.cpp.

References SimpleArray< float >::data, SimpleArray< float >::getData(), and SimpleArray< float >::getSize().

◆ rectangular()

static void Window::rectangular ( float *  window,
int  size 
)
inlinestaticinherited

Definition at line 83 of file Window.h.

References SimpleArray< float >::size, and Window::window().

Referenced by Window::window().

◆ rectify() [1/2]

void FloatArray::rectify ( )
inlineinherited

Absolute value of the array, in-place version.

Sets each element in the array to its absolute value.

Definition at line 83 of file FloatArray.h.

◆ rectify() [2/2]

void FloatArray::rectify ( FloatArray destination)
inherited

Absolute value of the array.

Stores the absolute value of the elements in the array into destination.

Parameters
[out]destinationthe destination array.
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 77 of file FloatArray.cpp.

References SimpleArray< float >::data, SimpleArray< T >::getData(), SimpleArray< T >::getSize(), min, and SimpleArray< float >::size.

◆ reverse() [1/2]

void FloatArray::reverse ( )
inherited

Reverse the array.

Reverses the order of the elements in the array.

Definition at line 99 of file FloatArray.cpp.

References SimpleArray< float >::data, and SimpleArray< float >::size.

Referenced by FloatArray::reverse().

◆ reverse() [2/2]

void FloatArray::reverse ( FloatArray destination)
inherited

Reverse the array Copies the elements of the array in reversed order into destination.

Parameters
[out]destinationthe destination array.

Definition at line 89 of file FloatArray.cpp.

References SimpleArray< float >::data, FloatArray::reverse(), and SimpleArray< float >::size.

Referenced by FloatArray::correlateInitialized().

◆ scale() [1/2]

void FloatArray::scale ( float  from,
float  to 
)
inlineinherited

In-place scale.

Definition at line 374 of file FloatArray.h.

References FloatArray::scale().

◆ scale() [2/2]

void FloatArray::scale ( float  from,
float  to,
FloatArray  destination 
)
inherited

Scale all values along a linear ramp from one value to another.

Definition at line 440 of file FloatArray.cpp.

References SimpleArray< float >::data, and SimpleArray< float >::size.

Referenced by CrossFadingCircularBuffer< T >::delay(), and FloatArray::scale().

◆ setAll()

void FloatArray::setAll ( float  value)
inherited

Set all the values in the array.

Sets all the elements of the array to value.

Parameters
[in]valueall the elements are set to this value.
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 220 of file FloatArray.cpp.

References SimpleArray< float >::data, and SimpleArray< float >::size.

Referenced by FloatArray::clear(), FloatArray::correlate(), InterpolatingSignalGenerator< im >::generate(), and SimpleMovingAverage::set().

◆ setElement()

void SimpleArray< float >::setElement ( size_t  index,
value 
)
inlineinherited

Set a single value in the array.

Definition at line 50 of file SimpleArray.h.

◆ sine()

static void Window::sine ( float *  window,
int  size 
)
inlinestaticinherited

Definition at line 101 of file Window.h.

References M_PI, SimpleArray< float >::size, and Window::window().

Referenced by Window::window().

◆ softclip() [1/2]

void FloatArray::softclip ( )
inlineinherited

Applies a cubic soft-clip algorithm to all elements in the array which limits them to the range [-1, 1] In-place version.

Definition at line 209 of file FloatArray.h.

◆ softclip() [2/2]

void FloatArray::softclip ( FloatArray  destination)
inherited

Applies a cubic soft-clip algorithm to all elements in the array which limits them to the range [-1, 1].

Parameters
[out]destinationthe destination array

Definition at line 454 of file FloatArray.cpp.

References clamp, SimpleArray< float >::data, and SimpleArray< float >::size.

◆ subArray()

FloatArray FloatArray::subArray ( int  offset,
size_t  length 
)
inherited

A subset of the array.

Returns a array that points to subset of the memory used by the original array.

Parameters
[in]offsetthe first element of the subset.
[in]lengththe number of elments in the new FloatArray.
Returns
the newly created FloatArray.
Remarks
no memory is allocated by this method. The memory is still shared with the original array. The memory should not be de-allocated elsewhere (e.g.: by calling FloatArray::destroy() on the original FloatArray) as long as the FloatArray returned by this method is still in use.
Calling FloatArray::destroy() on a FloatArray instance created with this method might cause an exception.

Definition at line 215 of file FloatArray.cpp.

References ASSERT, SimpleArray< float >::data, FloatArray::FloatArray(), and SimpleArray< float >::size.

Referenced by FourierPitchDetector::computeFrequency().

◆ subtract() [1/3]

void FloatArray::subtract ( float  scalar)
inherited

Array-scalar subtraction.

Subtracts scalar from the values in the array.

Parameters
scalarto be subtracted from the array

Definition at line 284 of file FloatArray.cpp.

References SimpleArray< float >::data, and SimpleArray< float >::size.

◆ subtract() [2/3]

void FloatArray::subtract ( FloatArray  operand2)
inherited

Element-wise difference between arrays.

Subtracts from each element of the array the corresponding element in operand2.

Parameters
[in]operand2second operand for the subtraction
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 279 of file FloatArray.cpp.

References FloatArray::subtract().

◆ subtract() [3/3]

void FloatArray::subtract ( FloatArray  operand2,
FloatArray  destination 
)
inherited

Element-wise difference between arrays.

Sets each element in destination to the difference between the corresponding element of the array and operand2

Parameters
[in]operand2second operand for the subtraction
[out]destinationthe destination array
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 263 of file FloatArray.cpp.

References ASSERT, SimpleArray< T >::data, SimpleArray< float >::data, SimpleArray< float >::size, and SimpleArray< T >::size.

Referenced by FloatArray::subtract().

◆ tanh() [1/2]

void FloatArray::tanh ( )
inlineinherited

In-place tanh.

Definition at line 386 of file FloatArray.h.

◆ tanh() [2/2]

void FloatArray::tanh ( FloatArray  destination)
inherited

Apply tanh to each element in the array.

Definition at line 461 of file FloatArray.cpp.

References SimpleArray< float >::data, and SimpleArray< float >::size.

◆ triangular()

static void Window::triangular ( float *  window,
int  size 
)
inlinestaticinherited

Definition at line 106 of file Window.h.

References FloatArray::ramp(), SimpleArray< float >::size, and Window::window().

Referenced by Window::window().

◆ welch()

static void Window::welch ( float *  window,
int  size 
)
inlinestaticinherited

Definition at line 95 of file Window.h.

References SimpleArray< float >::size, and Window::window().

Referenced by Window::window().

◆ window()

◆ zeroethOrderBessel()

static float KaiserWindow::zeroethOrderBessel ( float  x)
inlinestatic

Definition at line 127 of file KaiserWindow.h.

Referenced by buildTimeDerivativeWindow(), and buildWindow().

Field Documentation

◆ data

float * SimpleArray< float >::data
protectedinherited

Definition at line 16 of file SimpleArray.h.

◆ size

size_t SimpleArray< float >::size
protectedinherited

Definition at line 17 of file SimpleArray.h.


The documentation for this class was generated from the following file: