|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Facemorph.Complex
public class Complex
Basic complex number class
Field Summary | |
---|---|
double |
x
The real component |
double |
y
The imaginary component |
Constructor Summary | |
---|---|
Complex(double a,
double b)
Constructor for complex number |
Method Summary | |
---|---|
Complex |
add(Complex z)
Add z to this and return the result as a new complex number |
Complex |
conjugate()
Conjugate the complex number |
Complex |
copy()
Returns a new copy of this complex number |
Complex |
divide(Complex z)
Multiply this by z (result = this*z) and return the result as a new complex number |
Complex |
dotProduct(Complex z)
Returns the complex dot product of this with z |
static Complex |
exp(Complex val)
Calculate complex exponential |
static Complex[] |
fft1d(Complex[] data,
boolean inverse)
1D FFT |
static void |
fft1d(Complex[] data,
Complex[] fft,
int N,
int step,
int start,
int out,
boolean inverse)
FFT using Danielson-Lancoz lemma to make O(NlogN) |
static Complex[] |
fftNd(Complex[] data,
int[] dim,
boolean inverse)
Multidimensional FFT, note input data is destroyed by running this and the answer will end up in data, and is also returned |
static Complex[] |
ft1d(Complex[] data,
boolean inverse)
Slow direct calculation of fourier transform. |
double |
magnitude()
calculate the magnitude of this complex number |
double |
magnitudeSquared()
calculate the magnitude of this complex number |
static void |
main(java.lang.String[] args)
Main method used for testing |
Complex |
multiply(Complex z)
Multiply this by z (result = this*z) and return the result as a new complex number |
Complex |
subtract(Complex z)
Add z to this and return the result as a new complex number |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double x
public double y
Constructor Detail |
---|
public Complex(double a, double b)
a
- real partb
- imaginary partMethod Detail |
---|
public double magnitude()
public Complex conjugate()
public double magnitudeSquared()
public static Complex exp(Complex val)
val
- the complex value to exponentiate
public static Complex[] ft1d(Complex[] data, boolean inverse)
data
- inptu data vectorinverse
- used to perform the inverse FT
public static void fft1d(Complex[] data, Complex[] fft, int N, int step, int start, int out, boolean inverse)
data
- input data arrayfft
- outout data arrayN
- length of portion of data to transformstep
- step size along input vectorstart
- start point to read fromout
- start point to write toinverse
- true for inverse FFTpublic static Complex[] fft1d(Complex[] data, boolean inverse)
data
- the data to perform the FFT oninverse
- boolean indicates if inverse FFT is needed
public static Complex[] fftNd(Complex[] data, int[] dim, boolean inverse)
data
- the input data to transformdim
- the size of each dimensioninverse
- true for inverse transform
public static void main(java.lang.String[] args)
args
- args not usedpublic Complex multiply(Complex z)
z
- the number to multiply by this
public Complex divide(Complex z)
z
- the number to multiply by this
public Complex add(Complex z)
z
- the number to add
public Complex copy()
public Complex subtract(Complex z)
z
- the number to add
public Complex dotProduct(Complex z)
z
- the number to dot product with
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |