OpenWareLaboratory
ComplexShort Struct Reference

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...
 
float getPhase ()
 Get the phase of the complex number. More...
 
void setMagnitude (int16_t magnitude)
 Set the magnitude of the complex number. More...
 
void setPhase (float phase)
 Set the phase of the complex number. More...
 
void setPolar (int16_t magnitude, float 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...
 

Detailed Description

A structure defining a fixed point complex number as two members of type int16_t.

Definition at line 11 of file ComplexShortArray.h.

Member Function Documentation

int16_t ComplexShort::getMagnitude ( )
inline

Get the magnitude of the complex number.

Computes and returns the magnitude of the complex number.

Returns
The magnitude of the complex number.

Definition at line 27 of file ComplexShortArray.h.

References im, and re.

Referenced by setPhase().

float ComplexShort::getPhase ( )
inline

Get the phase of the complex number.

Computes and returns the phase of the complex number.

Returns
The phase of the complex number.

Definition at line 48 of file ComplexShortArray.h.

References im, and re.

Referenced by setMagnitude().

void ComplexShort::setMagnitude ( int16_t  magnitude)
inline

Set the magnitude of the complex number.

Set the magnitude of the complex number, keeping the phase unaltered.

Parameters
magnitudeThe new magnitude of the complex number

Definition at line 67 of file ComplexShortArray.h.

References getPhase(), and setPolar().

void ComplexShort::setPhase ( float  phase)
inline

Set the phase of the complex number.

Set the phase of the complex number, keeping the magnitude unaltered.

Parameters
phaseThe new phase of the complex number

Definition at line 57 of file ComplexShortArray.h.

References getMagnitude(), and setPolar().

void ComplexShort::setPolar ( int16_t  magnitude,
float  phase 
)
inline

Set magnitude and phase of the complex number.

Parameters
magnitudeThe new magnitude of the complex number
phaseThe new phase of the complex number

Definition at line 77 of file ComplexShortArray.h.

References im, and re.

Referenced by setMagnitude(), and setPhase().

Field Documentation

int16_t ComplexShort::im

The imaginary part of the complex number.

Definition at line 20 of file ComplexShortArray.h.

Referenced by getMagnitude(), getPhase(), ComplexShortArray::im(), ComplexShortArray::mag2(), and setPolar().

int16_t ComplexShort::re

The real part of the complex number.

Definition at line 15 of file ComplexShortArray.h.

Referenced by getMagnitude(), getPhase(), ComplexShortArray::mag2(), ComplexShortArray::re(), and setPolar().


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