|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjfftw.DataArray
jfftw.RealDataArray
public class RealDataArray
Class to handle Real Data arrays in either Real or Fourier space. Data in real space in held a double[] array on row order, but in Fourier space in Complex pairs with Hermition symmetry. For width of N the symmetry is given by F(k,m,n) = F*(N-k,m,n).
Note 1: in Fourier space the data width is given by
getFourierWidth()
Note 2: The underlying FTTW is taking out-of-place transforms so the length and location of the internal databuffer WILL change when a transform is taken.
Warning to novice users; read and understand about FFTs before using this especially on two or three dimensions.
Field Summary |
---|
Fields inherited from class jfftw.DataArray |
---|
conversionFlag, currentWidth, dataBuffer, depth, errorStream, fftw, height, space, width |
Constructor Summary | |
---|---|
RealDataArray(BufferedImage bi,
int band)
Constructor to form the a two-dimensional RealDataArray from a band of a Java BufferedImage . |
|
RealDataArray(int w)
Constructor to form a one-dimensional RealDataArray, in real space. |
|
RealDataArray(int w,
int h)
Constructor to form a two-dimensional RealDataArray, in real space. |
|
RealDataArray(int w,
int h,
int d)
Constructor to form a three-dimensional RealDataArray in real space. |
|
RealDataArray(int w,
int h,
int d,
double[] da)
Forms a general RealDataArray taking its data from the a supplied double[] assumed to be in the correct
(row) order. |
|
RealDataArray(RealDataArray data)
Form a RealDataArray with all parameters taken from the specified RealDataArray. |
Method Summary | |
---|---|
void |
add(int i,
double a)
Add a double to an element |
void |
add(int i,
double a,
double b)
Add a Complex specified by two doubles to an element |
void |
checker()
Method to apply a checker in either Real or Fourier space. |
RealDataArray |
clone()
Form a deep clone of current RealDataArray, including data. |
void |
conjugate(int i)
Form the conjugate of the ith Complex element. |
void |
fourier()
Method to take in-place fft. |
Complex |
getComplex(int i)
Method to get a Complex in one-dimensional case. |
double |
getDouble(int i)
Method to get value of element as a double. |
FFTWReal |
getFFTW()
Method to get underlying FFTWReal |
void |
mult(int i,
double a)
Multiply an element by a double, works in both real and fourier space. |
void |
mult(int i,
double a,
double b)
Multiply an element by a Complex specified by two doubles in Fourier space. |
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 a double point in one-dimensions. |
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, mult, mult, mult, mult, mult, mult, mult, mult, mult, multConjugate, normaliseDB, 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 RealDataArray(int w, int h, int d)
w
- the width (primary) dimensionh
- the height (secondary) dimensiond
- the depth (third) dimensionpublic RealDataArray(int w, int h)
w
- the width (primary) dimensionh
- the height (secondary) dimensionpublic RealDataArray(int w)
w
- the width (primary) dimensionpublic RealDataArray(RealDataArray data)
This is valid in both real and Fourier space.
data
- the RealDataArraypublic RealDataArray(int w, int h, int d, double[] da)
double[]
assumed to be in the correct
(row) order.
Warning: when fourier() method is called the result will be
relocated to a new double[]
array which can be
accessed by getDataBuffer()
.
Really understand what you are doing before playing with this!
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 RealDataArray(BufferedImage bi, int band)
BufferedImage
.
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 RealDataArray clone()
clone
in class Object
RealDataArray
cloned of current.public double getDouble(int i)
setConversion()
, which defaults
to Complex.MODULUS
.
For multi-dimensional array may be indexed as a one-dimenional
array of length width*height*depth
. Use this
feature to bypass the array bound checking overhead.
getDouble
in class DataArray
i
- the element indexpublic Complex getComplex(int i)
getComplex
in class DataArray
i
- the element indexpublic void setDouble(int i, double a)
setDouble
in class DataArray
i
- the element indexa
- the valuepublic void setComplex(int i, double a, double b)
setComplex
in class DataArray
i
- the element indexa
- the real partb
- the imaginary partpublic 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 addedpublic 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 indexpublic FFTWReal getFFTW()
getFFTW
in class DataArray
FFTWReal
used to do transforms.public void fourier()
fourier
in class DataArray
public void checker()
checker
in class DataArray
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |