|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.oregondsp.signalProcessing.fft.IRDFT
public class IRDFT
Class to calculate the inverse discrete Fourier transform of a real sequence using the split-radix algorithm.
This class calculates the inverse discrete Fourier transform of a real sequence. It is a TEMPORARY class provided for completeness, using the Complex DFT class (CDFT) to perform the inverse DFT. It less efficient than a class specifically written for real sequences and is intended to be replaced by such a class with the same calling parameters. Like CDFT and RDFT, it is designed for calculation of many discrete Fourier transforms of the same length. It is limited to transform lengths that are powers of two and greater than or equal to 32. The class recursively constructs and links sub-DFTs with hard-wired array indices to eliminate index calculations during DFT evaluation. This approach may produce large run-time images. Special hand-coded implementations of length 8 and 16 DFTs eliminate many unnecessary calculations. The code uses precomputed sine and cosine tables and does not implement in-place calculations in order to eliminate the bit reversal step. Consequently, this implementation trades memory for speed.
The transform is assumed to be packed into the input array x using the scheme of Sorensen et al. (1987).
Because the corresponding sequence is real, the transform is conjugate symmetric:
x(i) = x*(N-i), i = 1,...,N
Consequently, the transform can be represented by its first N/2 + 1 values (the values at 0 and N/2 are
real. Let xr(i) represent the real part of transform value at index i and xi(i) the imaginary part. Then
the array x of this implementation is organized as follows:
x(i) = xr(i) i = 0,..., N/2
x(i) = xi(N-i) i = N/2+1,...,N-1
Upon evaluation, the inverse transform is a real sequence found in array X in natural order.
*The class may be used in two different ways. It may be instantiated with hard-wired arrays for the input transform and resulting output sequence, e.g.:
int N     = 16384;
int log2N = 14;
float[] x = new float[N];
float[] X = new float[N];
IRDFT Xfm = new IRDFT( x, X, log2N );
// load transform real part
for ( int i = 0; i <= N/2; i++ ) {
  x[i] = ...
}
// load transform imaginary part
for ( int i = N/2+1; i < N; i++ ) {
  x[i] = ...
}
// evaluate inverse transform of data
Xfm.evaluate();
Alternatively, the arrays can be linked at evaluation time, with a (very) slight performance penalty. This usage probably is more natural for most users:
IRDFT Xfm = new IRDFT( log2N );
// load transform real part
for ( int i = 0; i <= N/2; i++ ) {
  x[i] = ...
}
// load transform imaginary part
for ( int i = N/2+1; i < N; i++ ) {
  x[i] = ...
}
// evaluate transform of data
Xfm.evaluate( x, X );
Calling the evaluate method with array arguments always relinks the arrays, even if the IRDFT object was instantiated with "hard-wired" array arguments.
As long as the transform size does not change, the IRDFT object does not need to be reinstantiated. Consequently, the data arrays can be reloaded and the evaluate method invoked to compute additional DFTs without incurring the cost of IRDFT object instantiation.
See "On Computing the Split-Radix FFT", Sorensen, H. V., Heideman, M. T. and Burrus, C. S. IEEE TRANSACTIONS ON ACOUSTICS, SPEECH, AND SIGNAL PROCESSING, VOL. ASSP-34, NO. 1, FEBRUARY, 1986, pp. 152-156.
and "Real-valued Fast Fourier Transform Algorithms", Sorensen, H. V., et al., IEEE TRANSACTIONS ON ACOUSTICS, SPEECH, AND SIGNAL PROCESSING, VOL. ASSP-35, NO. 6, JUNE 1987, pp. 849-863.
Constructor Summary | |
---|---|
IRDFT(float[] x,
float[] X,
int log2N)
Instantiates a new IRDFT. |
|
IRDFT(int log2N)
Instantiates a new IRDFT without linking transform (input) or sequence (output) arrays. |
Method Summary | |
---|---|
void |
evaluate()
Evaluate the inverse transform assuming the input (transform) and output (sequence) arrays have been linked during IRDFT instantiation. |
void |
evaluate(float[] y,
float[] Y)
Evaluate the inverse transform, linking the two supplied input (transform) and output (sequence) arrays. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IRDFT(int log2N)
log2N
- the log2 npublic IRDFT(float[] x, float[] X, int log2N)
x
- float[] containing the input transform.X
- float[] containing the output sequence.log2N
- int containing the log2( transform size, always a power of two).Method Detail |
---|
public void evaluate()
public void evaluate(float[] y, float[] Y)
y
- float[] containing the transform of a real sequence in packed form.Y
- float[] containing the corresponding real sequence following execution in natural order.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |