1 #ifndef __ComplexShortArray_h__
2 #define __ComplexShortArray_h__
59 void setPolar(int16_t magnitude, int16_t phase);
62 return re == other.
re &&
im == other.
im;
66 return re != other.
re ||
im != other.
im;
82 int16_t
re(
const int i){
91 int16_t
im(
const int i){
104 int16_t
mag(
const int i);
117 int16_t
mag2(
const int i);
249 void setAll(int16_t value);
256 void setAll(int16_t valueRe, int16_t valueIm);
void getComplexConjugateValues(ComplexShortArray destination)
The complex conjugate values of the element of the array.
int16_t mag(const int i)
The magnitude of an element of the array.
void subtract(ComplexShortArray operand2)
In-place element-wise difference between complex arrays.
void setPhase(ShortArray phase)
Set the phase of the elements of the array, leaving the magnitude unchanged.
void setPhase(ShortArray phase, int offset, int count)
Set the phase of a range of elements of the array, leaving the magnitude unchanged.
int16_t im(const int i)
The imaginary part of an element of the array.
void getRealValues(ShortArray buf)
Get the real part of the elements of the array.
void setPhase(ShortArray phase, ComplexShortArray destination)
Set the phase of the elements of an array, using the magnitude from the current array.
void add(ComplexShortArray operand2, ComplexShortArray destination)
Element-wise sum between complex arrays.
void complexByComplexMultiplication(ComplexShortArray operand2, ComplexShortArray result)
Complex by complex multiplication between arrays.
static ComplexShortArray create(unsigned int size)
Creates a new ComplexShortArray.
ComplexShortArray subArray(unsigned int offset, unsigned int length)
A subset of the array.
void setMagnitude(ShortArray magnitude, int offset, int count, ComplexShortArray destination)
Set the magnitude of a range of the elements of an array, using the phases from the current array.
void complexDotProduct(ComplexShortArray operand2, ComplexShort &result)
Complex dot product between arrays.
void subtract(ComplexShortArray operand2, ComplexShortArray destination)
Element-wise difference between complex arrays.
void add(ComplexShortArray operand2)
In-place element-wise sum between complex arrays.
ComplexShortArray(ComplexShort *data, size_t size)
void setMagnitude(ShortArray magnitude, int offset, int count)
Set the magnitude of a range of elements of the array, leaving the phase unchanged.
void setMagnitude(ShortArray magnitude, ComplexShortArray destination)
Set the magnitude of the elements of an array, using the phase from the current array.
int16_t getMaxMagnitudeValue()
The value of the element with the maximum magnitude in the array.
void getMagnitudeSquaredValues(ShortArray destination)
The squared magnitudes of the elements of the array.
void scale(int16_t factor)
Array by scalar multiplication.
int16_t mag2(const int i)
The magnitude squared of an element of the array.
unsigned int getMaxMagnitudeIndex()
The index of the element with the maximum magnitude in the array.
void getImaginaryValues(ShortArray buf)
Get the imaginary part of the elements of the array.
void complexByRealMultiplication(ShortArray operand2, ComplexShortArray result)
Complex by real multiplication between arrays.
void setPolar(ShortArray magnitude, ShortArray phase, int offset, int count)
Set a range of elements in the array using polar coordinates.
void setPolar(ShortArray magnitude, ShortArray phase)
Set all the elements in the array using polar coordinates.
static void destroy(ComplexShortArray)
Destroys a ComplexShortArray created with the create() method.
void getMagnitudeValues(ShortArray destination)
The magnitudes of the elements of the array.
int16_t re(const int i)
The real part of an element of the array.
void setMagnitude(ShortArray magnitude)
Set the magnitude of the elements of the array, leaving the phase unchanged.
void setPhase(ShortArray phase, int offset, int count, ComplexShortArray destination)
Set the phase of a range of the elements of an array, using the magnitude from the current array.
void setAll(ComplexShort value)
Set all the elements in the array.
This class contains useful methods for manipulating arrays of int16_ts.
SimpleArray holds a pointer to an array and the array size, and is designed to be passed by value.
A structure defining a fixed point complex number as two members of type int16_t.
bool operator!=(const ComplexShort &other) const
void setPhase(int16_t phase)
Set the phase of the complex number.
void setPolar(int16_t magnitude, int16_t phase)
Set magnitude and phase of the complex number.
int16_t re
The real part of the complex number.
int16_t getMagnitude()
Get the magnitude of the complex number.
int16_t getPhase()
Get the phase of the complex number.
void setMagnitude(int16_t magnitude)
Set the magnitude of the complex number.
int16_t im
The imaginary part of the complex number.
bool operator==(const ComplexShort &other) const