OpenWareLaboratory
|
A structure defining a fixed point complex number as two members of type int16_t. More...
Public Member Functions | |
int16_t | getMagnitude () |
Get the magnitude of the complex number. More... | |
int16_t | getPhase () |
Get the phase of the complex number. More... | |
bool | operator!= (const ComplexShort &other) const |
bool | operator== (const ComplexShort &other) const |
void | setMagnitude (int16_t magnitude) |
Set the magnitude of the complex number. More... | |
void | setPhase (int16_t phase) |
Set the phase of the complex number. More... | |
void | setPolar (int16_t magnitude, int16_t phase) |
Set magnitude and phase of the complex number. More... | |
Data Fields | |
int16_t | im |
The imaginary part of the complex number. More... | |
int16_t | re |
The real part of the complex number. More... | |
A structure defining a fixed point complex number as two members of type int16_t.
Definition at line 9 of file ComplexShortArray.h.
int16_t ComplexShort::getMagnitude | ( | ) |
Get the magnitude of the complex number.
Computes and returns the magnitude of the complex number.
Definition at line 6 of file ComplexShortArray.cpp.
References FLOAT_TO_Q15, im, Q15_TO_FLOAT, and re.
Referenced by setPhase().
int16_t ComplexShort::getPhase | ( | ) |
Get the phase of the complex number.
Computes and returns the phase of the complex number.
Definition at line 23 of file ComplexShortArray.cpp.
References FLOAT_TO_Q15, im, Q15_TO_FLOAT, and re.
Referenced by setMagnitude().
|
inline |
Definition at line 65 of file ComplexShortArray.h.
|
inline |
Definition at line 61 of file ComplexShortArray.h.
|
inline |
Set the magnitude of the complex number.
Set the magnitude of the complex number, keeping the phase unaltered.
magnitude | The new magnitude of the complex number |
Definition at line 49 of file ComplexShortArray.h.
References getPhase(), and setPolar().
|
inline |
Set the phase of the complex number.
Set the phase of the complex number, keeping the magnitude unaltered.
phase | The new phase of the complex number |
Definition at line 39 of file ComplexShortArray.h.
References getMagnitude(), and setPolar().
void ComplexShort::setPolar | ( | int16_t | magnitude, |
int16_t | phase | ||
) |
Set magnitude and phase of the complex number.
magnitude | The new magnitude of the complex number |
phase | The new phase of the complex number |
Definition at line 27 of file ComplexShortArray.cpp.
References FLOAT_TO_Q15, im, Q15_TO_FLOAT, and re.
Referenced by setMagnitude(), and setPhase().
int16_t ComplexShort::im |
The imaginary part of the complex number.
Definition at line 18 of file ComplexShortArray.h.
Referenced by ComplexShortArray::add(), getMagnitude(), getPhase(), ComplexShortArray::im(), operator!=(), operator==(), ComplexShortArray::setAll(), and setPolar().
int16_t ComplexShort::re |
The real part of the complex number.
Definition at line 13 of file ComplexShortArray.h.
Referenced by ComplexShortArray::add(), getMagnitude(), getPhase(), operator!=(), operator==(), ComplexShortArray::re(), ComplexShortArray::setAll(), and setPolar().