|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjfftw.DataArray
jfftw.ComplexDataArray
public class ComplexDataArray
Class to handle Complex Data arrays in either Real or Fourier space. This is the simplest fft interface with simple support for one, two and three dimensional complex data with, almost, all indexing problems covered by the support methods.
Novice users should start here, and use the more complex
RealDataArray
or the low-level FFTW
if they want need either more efficient interface or have data
formatted other than the interleaved complex implemented here.
Field Summary |
---|
Fields inherited from class jfftw.DataArray |
---|
conversionFlag, currentWidth, dataBuffer, depth, errorStream, fftw, height, space, width |
Constructor Summary | |
---|---|
ComplexDataArray(BufferedImage bi,
int band)
Constructor to form the a two-dimensional ComplexDataArray from a band of a Java BufferedImage . |
|
ComplexDataArray(DataArray data)
Form a ComplexDataArray from supplied
DataArray . |
|
ComplexDataArray(int w)
Constructor to form a one-dimensional ComplexDataArray, which defaults to FFTW.REAL space. |
|
ComplexDataArray(int w,
int h)
Constructor to form a two-dimensional ComplexDataArray, which defaults to FFTW.REAL space. |
|
ComplexDataArray(int w,
int h,
int d)
Constructor to form a three-dimensional ComplexDataArray, which defaults to FFTW.REAL space. |
|
ComplexDataArray(int w,
int h,
int d,
double[] da)
Form a general ComplexDataArray with specified dimensional and supplied data array, which is NOT copied, it is used internally. |
Method Summary | |
---|---|
void |
add(int i,
double a)
Add a double to real part of element |
void |
add(int i,
double a,
double b)
Add a Complex to specified |
void |
checker()
Method to apply a +/1 checker patterns to the Complex data, used to form centred FFTW. |
ComplexDataArray |
clone()
Form a deep clone of current ComplexDataArray, including data. |
void |
conjugate(int i)
Form the conjugate of the element on one-dimensions by negating the imaginary parts. |
void |
fourier()
Method to take in-place fft. |
Complex |
getComplex(int i)
Method to get a Complex element in one-dimensional case. |
double |
getDouble(int i)
Method to get the double value of the element on one-dimensions where the Complex real conversion is controlled by setConversion() , which defaults to
Complex.MODULUS . |
FFTWComplex |
getFFTW()
Method to get underlying FFTWComplex |
void |
mult(int i,
double a)
Multiply an element by a double |
void |
mult(int i,
double a,
double b)
Multiply an element by a Complex specified |
void |
setComplex(int i,
double a,
double b)
Method to set a Complex point in one-dimension with two doubles. |
void |
setDouble(int i,
double a)
Method to set the Real part of an element with a double, the imaginary part is not modified. |
Methods inherited from class jfftw.DataArray |
---|
add, add, add, add, add, add, centreFourier, clear, conjugate, conjugate, conjugate, getComplex, getComplex, getConversion, getCurrentWidth, getDataBuffer, getDepth, getDouble, getDouble, getHeight, getNormalisation, getRealDataArray, getRealDataArray, getSpace, getType, getWidth, isComplex, length, maxModSqr, mult, mult, mult, mult, mult, mult, mult, mult, mult, multConjugate, normaliseDB, power, powerSpectrum, setComplex, setComplex, setComplex, setComplex, setComplex, setConversion, setDataBuffer, setDimensions, setDouble, setDouble, setNormalisation, setSpace, sizeMatch, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ComplexDataArray(int w, int h, int d)
FFTW.REAL
space.
All data is pre-initialised to zero.
w
- the width (primary) dimensionh
- the height (secondary) dimensiond
- the depth (third) dimensionpublic ComplexDataArray(int w, int h)
FFTW.REAL
space.
w
- the width (primary) dimensionh
- the height (secondary) dimensionpublic ComplexDataArray(int w)
FFTW.REAL
space.
w
- the width (primary) dimensionpublic ComplexDataArray(int w, int h, int d, double[] da)
Use with care, you must format the supplied data in the
correct row interleaved format. If you are using this
in a main program, consider using the low-level level
FFTWComplex
class.
w
- the width (primary) dimensionh
- the height (secondary) dimensiond
- the depth (third) dimensionda
- the data array.
IllegalArgumentException
- if length of
data array does not match parameters.public ComplexDataArray(DataArray data)
ComplexDataArray
from supplied
DataArray
.
If supplied with ComplexDataArray
it will produce a
clone including the data.
For a RealDataArray
the real values will be used
to set the real parts with imaginary defaulting to zero. Note:
this will only work for RealDataArray in real space.
data
- the specifying DataArray
IllegalArgumentException
- if
real array is in Fourier space.public ComplexDataArray(BufferedImage bi, int band)
BufferedImage
. The
real parts are set by the image data, with the imaginary parts
set to zero.
bi
- the BufferedImage supplying the size and databand
- the band to be used. If negative or greater that
available bands, then the centre band will be used, so the
zero band on a monochrome image, or band 1 of a tricoloured image.Method Detail |
---|
public ComplexDataArray clone()
clone
in class Object
ComplexDataArray
cloned of current.public Complex getComplex(int i)
DataArray
and handles the internal indexing.
For a multi-dimensional array this can be treated as
a one-dimensional array length
width*height*depth
allowing more efficiency
one-dimensional access. This bypasses the array bound
checking.
getComplex
in class DataArray
i
- the element indexpublic double getDouble(int i)
setConversion()
, which defaults to
Complex.MODULUS
.
getDouble
in class DataArray
i
- the element index.public void setComplex(int i, double a, double b)
setComplex
in class DataArray
i
- the element indexa
- the real partb
- the imaginary partpublic void setDouble(int i, double a)
setDouble
in class DataArray
i
- the element indexa
- the double valuepublic void mult(int i, double a)
mult
in class DataArray
i
- the element indexa
- the multiplierpublic void mult(int i, double a, double b)
mult
in class DataArray
i
- the element indexa
- the real partb
- the imaginary partpublic void add(int i, double a)
add
in class DataArray
i
- the element indexa
- to be added to real partpublic void add(int i, double a, double b)
add
in class DataArray
i
- the element indexa
- the real partb
- the imaginary partpublic void conjugate(int i)
conjugate
in class DataArray
i
- the element to be conjugated.public FFTWComplex getFFTW()
getFFTW
in class DataArray
FFTWComplex
used to do transforms.public void fourier()
true
fourier
in class DataArray
DataArray.setNormalisation(boolean)
public void checker()
checker
in class DataArray
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |