org.javaseis.fft
Class SeisFft

java.lang.Object
  extended by org.javaseis.fft.SeisFft
All Implemented Interfaces:
IFFT

public class SeisFft
extends java.lang.Object
implements IFFT


Nested Class Summary
static class SeisFft.Scale
           
static class SeisFft.Type
           
 
Field Summary
protected  float[] _cy
           
protected  FftComplex _fftCplx
           
protected  FftReal _fftReal
           
protected  int _lendata
           
protected  int _lenfft
           
protected  int _lentran
           
protected  IFFT.Scale _scale
           
protected  float _scaleForward
           
protected  float _scaleInverse
           
protected  int _signForward
           
protected  int _signInverse
           
protected  IFFT.Type _type
           
protected  float[] _wk
           
 
Constructor Summary
SeisFft()
          Default constructor for an empty transform
SeisFft(int length)
          Forward transform for real data with default padding, type, scaling, and sign
SeisFft(int length, float padPercent)
          Forward transform for real data with specified length padding in percent
SeisFft(int length, float padPercent, IFFT.Type type)
          Forward transform for real data specifying length, padding, and transform type
SeisFft(int length, float padPercent, IFFT.Type type, int isign)
          Forward transform for real data specifying length, padding, transform type, and sign
SeisFft(int length, float padPercent, IFFT.Type type, int isign, IFFT.Scale scale)
          Forward transform for real data specifying length, padding, transform type, sign, and scale
 
Method Summary
 void complexForward(float[] cx)
          Perform an in-place complex-to-complex forward transform
 void complexForward(float[] cx, float[] cy)
           
 void complexForward(float[] cx, int offset)
           
 void complexForward(float[] cx, int xoff, float[] cy, int yoff)
           
 void complexInverse(float[] cy)
          Perform an in-place complex-to-complex inverse transform
 void complexInverse(float[] cy, float[] cx)
           
 void complexInverse(float[] cy, int offset)
           
 void complexInverse(float[] cy, int yoff, float[] cx, int xoff)
           
 void complexToReal(float[] cy)
          Perform an in-place complex-to-real inverse transform
 void complexToReal(float[] cy, float[] rx)
           
 void complexToReal(float[] cy, int offset)
           
 void complexToReal(float[] cy, int yoff, float[] rx, int xoff)
           
 int getArrayLength()
          Return the length of the transform array in 32 bit words (floats)
 int getLength()
          Return the transform length
static void main(java.lang.String[] args)
           
 void realToComplex(float[] rx)
          Perform an in-place real to complex forward transform
 void realToComplex(float[] rx, float[] cy)
          Out-of-place transforms that do not modify the input data
 void realToComplex(float[] rx, int offset)
          In place transforms with optional offset
 void realToComplex(float[] rx, int xoff, float[] cy, int yoff)
          Out-of-place transforms that do not modify the input data
 void setFftParms(int length, IFFT.Type type, IFFT.Scale scale, float padPercent, int forwardSign)
          Set transform parameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_cy

protected float[] _cy

_fftCplx

protected FftComplex _fftCplx

_fftReal

protected FftReal _fftReal

_lendata

protected int _lendata

_lenfft

protected int _lenfft

_lentran

protected int _lentran

_scale

protected IFFT.Scale _scale

_scaleForward

protected float _scaleForward

_scaleInverse

protected float _scaleInverse

_signForward

protected int _signForward

_signInverse

protected int _signInverse

_type

protected IFFT.Type _type

_wk

protected float[] _wk
Constructor Detail

SeisFft

public SeisFft()
Default constructor for an empty transform


SeisFft

public SeisFft(int length)
Forward transform for real data with default padding, type, scaling, and sign

Parameters:
length - length of the input data to be transformed

SeisFft

public SeisFft(int length,
               float padPercent)
Forward transform for real data with specified length padding in percent

Parameters:
length - length of the input data to be transformed
padPercent - requested zero padding as a percentage of the input length

SeisFft

public SeisFft(int length,
               float padPercent,
               IFFT.Type type)
Forward transform for real data specifying length, padding, and transform type

Parameters:
length - length of the input data to be transformed
padPercent - requested zero padding as a percentage of the input length
type - transform type from the enum SeisFft.Type.REAL or SeisFft.Type.COMPLEX

SeisFft

public SeisFft(int length,
               float padPercent,
               IFFT.Type type,
               int isign)
Forward transform for real data specifying length, padding, transform type, and sign

Parameters:
length - length of the input data to be transformed
padPercent - requested zero padding as a percentage of the input length
type - transform type from the enum SeisFft.Type.REAL or SeisFft.Type.COMPLEX
isign - forward transform sign, -1 or +1

SeisFft

public SeisFft(int length,
               float padPercent,
               IFFT.Type type,
               int isign,
               IFFT.Scale scale)
Forward transform for real data specifying length, padding, transform type, sign, and scale

Parameters:
length - length of the input data to be transformed
padPercent - requested zero padding as a percentage of the input length
type - transform type from the enum SeisFft.Type.REAL or SeisFft.Type.COMPLEX
isign - forward transform sign, -1 or +1
scale - transform scaling from the enum SeisFft.Scale.NONE, INVERSE, or SYMMETRIC
Method Detail

complexForward

public void complexForward(float[] cx)
Perform an in-place complex-to-complex forward transform

Specified by:
complexForward in interface IFFT
Parameters:
cx - input complex data, output complex forward transform

complexForward

public void complexForward(float[] cx,
                           float[] cy)
Specified by:
complexForward in interface IFFT

complexForward

public void complexForward(float[] cx,
                           int offset)
Specified by:
complexForward in interface IFFT

complexForward

public void complexForward(float[] cx,
                           int xoff,
                           float[] cy,
                           int yoff)
Specified by:
complexForward in interface IFFT

complexInverse

public void complexInverse(float[] cy)
Perform an in-place complex-to-complex inverse transform

Specified by:
complexInverse in interface IFFT
Parameters:
cy - input complex transform, output complex inverse transform

complexInverse

public void complexInverse(float[] cy,
                           float[] cx)
Specified by:
complexInverse in interface IFFT

complexInverse

public void complexInverse(float[] cy,
                           int offset)
Specified by:
complexInverse in interface IFFT

complexInverse

public void complexInverse(float[] cy,
                           int yoff,
                           float[] cx,
                           int xoff)
Specified by:
complexInverse in interface IFFT

complexToReal

public void complexToReal(float[] cy)
Perform an in-place complex-to-real inverse transform

Specified by:
complexToReal in interface IFFT
Parameters:
cy - input complex Fourier transform, output real inverse Fourier transform

complexToReal

public void complexToReal(float[] cy,
                          float[] rx)
Specified by:
complexToReal in interface IFFT

complexToReal

public void complexToReal(float[] cy,
                          int offset)
Specified by:
complexToReal in interface IFFT

complexToReal

public void complexToReal(float[] cy,
                          int yoff,
                          float[] rx,
                          int xoff)
Specified by:
complexToReal in interface IFFT

getArrayLength

public int getArrayLength()
Return the length of the transform array in 32 bit words (floats)

Specified by:
getArrayLength in interface IFFT
Returns:
transform array length

getLength

public int getLength()
Return the transform length

Specified by:
getLength in interface IFFT
Returns:
transform length

main

public static void main(java.lang.String[] args)
Parameters:
args -

realToComplex

public void realToComplex(float[] rx)
Perform an in-place real to complex forward transform

Specified by:
realToComplex in interface IFFT
Parameters:
rx - input real data to be transformed, output complex Fourier transform

realToComplex

public void realToComplex(float[] rx,
                          float[] cy)
Out-of-place transforms that do not modify the input data

Specified by:
realToComplex in interface IFFT
Parameters:
a - input array to be transformed
b - output array containing transform

realToComplex

public void realToComplex(float[] rx,
                          int offset)
In place transforms with optional offset

Specified by:
realToComplex in interface IFFT
Parameters:
a - input array to be transformed
offset - starting index for transform within the array

realToComplex

public void realToComplex(float[] rx,
                          int xoff,
                          float[] cy,
                          int yoff)
Out-of-place transforms that do not modify the input data

Specified by:
realToComplex in interface IFFT
Parameters:
a - input array to be transformed
aindex - start index of the data in the input array
b - output array containing transform
bindex - start index for placing the output data

setFftParms

public void setFftParms(int length,
                        IFFT.Type type,
                        IFFT.Scale scale,
                        float padPercent,
                        int forwardSign)
Set transform parameters

Specified by:
setFftParms in interface IFFT
Parameters:
length - length of the input data to be transformed
type - transform type from the enum SeisFft.Type.REAL or SeisFft.Type.COMPLEX
scale - transform scaling from the enum SeisFft.Scale.NONE, INVERSE, or SYMMETRIC
padPercent - requested zero padding as a percentage of the input length
isign - forward transform sign, -1 or +1