Package boofcv.alg.transform.fft
Class GeneralPurposeFFT_F32_1D
java.lang.Object
boofcv.alg.transform.fft.GeneralPurposeFFT_F32_1D
Computes 1D Discrete Fourier Transform (DFT) of complex and real, float
precision data. The size of the data can be an arbitrary number. The code originally comes from
General Purpose FFT Package written by Takuya Ooura
(http://www.kurims.kyotou.ac.jp/~ooura/fft.html). See below for the full history.
This code has a bit of a history. Originally from General Purpose FFT. Which was then ported into
JFFTPack written by Baoshe Zhang (http://jfftpack.sourceforge.net/), and then into JTransforms by Piotr Wendykier.
The major modification from JTransforms is that the SMP code has been stripped out. It might be added back in
once an SMP strategy has been finalized in BoofCV.
Code License: The original license of General Purpose FFT Package is shown below. This file will fall
under the same license:
Copyright Takuya OOURA, 19962001 You may use, copy, modify and distribute this code for any purpose (include commercial use) and without fee. Please refer to this package when you modify this code.

Constructor Summary

Method Summary
Modifier and TypeMethodDescriptionvoid
complexForward
(float[] a) Computes 1D forward DFT of complex data leaving the result ina
.void
complexForward
(float[] a, int offa) Computes 1D forward DFT of complex data leaving the result ina
.void
complexInverse
(float[] a, boolean scale) Computes 1D inverse DFT of complex data leaving the result ina
.void
complexInverse
(float[] a, int offa, boolean scale) Computes 1D inverse DFT of complex data leaving the result ina
.void
realForward
(float[] a) Computes 1D forward DFT of real data leaving the result ina
.void
realForward
(float[] a, int offa) Computes 1D forward DFT of real data leaving the result ina
.void
realForwardFull
(float[] a) Computes 1D forward DFT of real data leaving the result ina
.void
realForwardFull
(float[] a, int offa) Computes 1D forward DFT of real data leaving the result ina
.void
realInverse
(float[] a, boolean scale) Computes 1D inverse DFT of real data leaving the result ina
.void
realInverse
(float[] a, int offa, boolean scale) Computes 1D inverse DFT of real data leaving the result ina
.protected void
realInverse2
(float[] a, int offa, boolean scale) void
realInverseFull
(float[] a, boolean scale) Computes 1D inverse DFT of real data leaving the result ina
.void
realInverseFull
(float[] a, int offa, boolean scale) Computes 1D inverse DFT of real data leaving the result ina
.

Constructor Details

GeneralPurposeFFT_F32_1D
public GeneralPurposeFFT_F32_1D(int n) Creates new instance of DoubleFFT_1D. Parameters:
n
 size of data


Method Details

complexForward
public void complexForward(float[] a) Computes 1D forward DFT of complex data leaving the result ina
. Complex number is stored as two float values in sequence: the real and imaginary part, i.e. the size of the input array must be greater or equal 2*n. The physical layout of the input data has to be as follows:
a[2*k] = Re[k], a[2*k+1] = Im[k], 0<=k<n
 Parameters:
a
 data to transform

complexForward
public void complexForward(float[] a, int offa) Computes 1D forward DFT of complex data leaving the result ina
. Complex number is stored as two float values in sequence: the real and imaginary part, i.e. the size of the input array must be greater or equal 2*n. The physical layout of the input data has to be as follows:
a[offa+2*k] = Re[k], a[offa+2*k+1] = Im[k], 0<=k<n
 Parameters:
a
 data to transformoffa
 index of the first element in arraya

complexInverse
public void complexInverse(float[] a, boolean scale) Computes 1D inverse DFT of complex data leaving the result ina
. Complex number is stored as two float values in sequence: the real and imaginary part, i.e. the size of the input array must be greater or equal 2*n. The physical layout of the input data has to be as follows:
a[2*k] = Re[k], a[2*k+1] = Im[k], 0<=k<n
 Parameters:
a
 data to transformscale
 if true then scaling is performed

complexInverse
public void complexInverse(float[] a, int offa, boolean scale) Computes 1D inverse DFT of complex data leaving the result ina
. Complex number is stored as two float values in sequence: the real and imaginary part, i.e. the size of the input array must be greater or equal 2*n. The physical layout of the input data has to be as follows:
a[offa+2*k] = Re[k], a[offa+2*k+1] = Im[k], 0<=k<n
 Parameters:
a
 data to transformoffa
 index of the first element in arraya
scale
 if true then scaling is performed

realForward
public void realForward(float[] a) Computes 1D forward DFT of real data leaving the result ina
. The physical layout of the output data is as follows:
if n is even thena[2*k] = Re[k], 0<=k<n/2 a[2*k+1] = Im[k], 0<k<n/2 a[1] = Re[n/2]
if n is odd thena[2*k] = Re[k], 0<=k<(n+1)/2 a[2*k+1] = Im[k], 0<k<(n1)/2 a[1] = Im[(n1)/2]
This method computes only half of the elements of the real transform. The other half satisfies the symmetry condition. If you want the full real forward transform, userealForwardFull
. To get back the original data, userealInverse
on the output of this method. Parameters:
a
 data to transform

realForward
public void realForward(float[] a, int offa) Computes 1D forward DFT of real data leaving the result ina
. The physical layout of the output data is as follows:
if n is even thena[offa+2*k] = Re[k], 0<=k<n/2 a[offa+2*k+1] = Im[k], 0<k<n/2 a[offa+1] = Re[n/2]
if n is odd thena[offa+2*k] = Re[k], 0<=k<(n+1)/2 a[offa+2*k+1] = Im[k], 0<k<(n1)/2 a[offa+1] = Im[(n1)/2]
This method computes only half of the elements of the real transform. The other half satisfies the symmetry condition. If you want the full real forward transform, userealForwardFull
. To get back the original data, userealInverse
on the output of this method. Parameters:
a
 data to transformoffa
 index of the first element in arraya

realForwardFull
public void realForwardFull(float[] a) Computes 1D forward DFT of real data leaving the result ina
. This method computes the full real forward transform, i.e. you will get the same result as fromcomplexForward
called with all imaginary parts equal 0. Because the result is stored ina
, the size of the input array must greater or equal 2*n, with only the first n elements filled with real data. To get back the original data, usecomplexInverse
on the output of this method. Parameters:
a
 data to transform

realForwardFull
public void realForwardFull(float[] a, int offa) Computes 1D forward DFT of real data leaving the result ina
. This method computes the full real forward transform, i.e. you will get the same result as fromcomplexForward
called with all imaginary part equal 0. Because the result is stored ina
, the size of the input array must greater or equal 2*n, with only the first n elements filled with real data. To get back the original data, usecomplexInverse
on the output of this method. Parameters:
a
 data to transformoffa
 index of the first element in arraya

realInverse
public void realInverse(float[] a, boolean scale) Computes 1D inverse DFT of real data leaving the result ina
. The physical layout of the input data has to be as follows:
if n is even thena[2*k] = Re[k], 0<=k<n/2 a[2*k+1] = Im[k], 0<k<n/2 a[1] = Re[n/2]
if n is odd thena[2*k] = Re[k], 0<=k<(n+1)/2 a[2*k+1] = Im[k], 0<k<(n1)/2 a[1] = Im[(n1)/2]
This method computes only half of the elements of the real transform. The other half satisfies the symmetry condition. If you want the full real inverse transform, userealInverseFull
. Parameters:
a
 data to transformscale
 if true then scaling is performed

realInverse
public void realInverse(float[] a, int offa, boolean scale) Computes 1D inverse DFT of real data leaving the result ina
. The physical layout of the input data has to be as follows:
if n is even thena[offa+2*k] = Re[k], 0<=k<n/2 a[offa+2*k+1] = Im[k], 0<k<n/2 a[offa+1] = Re[n/2]
if n is odd thena[offa+2*k] = Re[k], 0<=k<(n+1)/2 a[offa+2*k+1] = Im[k], 0<k<(n1)/2 a[offa+1] = Im[(n1)/2]
This method computes only half of the elements of the real transform. The other half satisfies the symmetry condition. If you want the full real inverse transform, userealInverseFull
. Parameters:
a
 data to transformoffa
 index of the first element in arraya
scale
 if true then scaling is performed

realInverseFull
public void realInverseFull(float[] a, boolean scale) Computes 1D inverse DFT of real data leaving the result ina
. This method computes the full real inverse transform, i.e. you will get the same result as fromcomplexInverse
called with all imaginary part equal 0. Because the result is stored ina
, the size of the input array must greater or equal 2*n, with only the first n elements filled with real data. Parameters:
a
 data to transformscale
 if true then scaling is performed

realInverseFull
public void realInverseFull(float[] a, int offa, boolean scale) Computes 1D inverse DFT of real data leaving the result ina
. This method computes the full real inverse transform, i.e. you will get the same result as fromcomplexInverse
called with all imaginary part equal 0. Because the result is stored ina
, the size of the input array must greater or equal 2*n, with only the first n elements filled with real data. Parameters:
a
 data to transformoffa
 index of the first element in arraya
scale
 if true then scaling is performed

realInverse2
protected void realInverse2(float[] a, int offa, boolean scale)
