public class Complex
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
protected static float |
DBLOG |
protected float |
imag |
protected static float |
LOG10 |
protected float |
real |
Constructor and Description |
---|
Complex()
Create a new
Complex number 0 + j0 |
Complex(float real,
float imag) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Return a clone of the
Complex object |
Complex |
conjugate() |
static Complex |
e(double phase) |
static Complex |
e(double mag,
double phase) |
float |
getImag()
Get imaginary component
|
float |
getMagnitude()
Return the magnitude of the
Complex number |
float |
getPhase()
Return the phase of the
Complex number |
float |
getPower()
Return the power of this
Complex number in dBs |
float |
getReal()
Get real component
|
Complex |
minus(Complex c) |
Complex |
multiply(float factor) |
Complex |
plus(Complex c) |
void |
setImag(float imag)
Set imaginary component
|
void |
setReal(float real)
Set real component
|
void |
setRealImag(float real,
float imag) |
Complex |
times(Complex c) |
java.lang.String |
toString() |
void |
zeroMag() |
void |
zeroPhase() |
protected static final float LOG10
protected static final float DBLOG
protected float real
protected float imag
public Complex()
Complex
number 0 + j0public Complex(float real, float imag)
public void zeroMag()
public void zeroPhase()
public static Complex e(double mag, double phase)
mag
- phase
- public static Complex e(double phase)
public Complex conjugate()
public Complex multiply(float factor)
public void setRealImag(float real, float imag)
public float getReal()
public void setReal(float real)
real
- public float getImag()
public void setImag(float imag)
imag
- public float getMagnitude()
Complex
numberpublic float getPhase()
Complex
numberpublic float getPower()
Complex
number in dBspublic java.lang.Object clone()
Complex
objectclone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object