Class Dft1dDirect

java.lang.Object
imagingbook.spectral.dft.Dft1dDirect
All Implemented Interfaces:
Dft1d
Direct Known Subclasses:
Dft1dDirect.Double, Dft1dDirect.Float

public abstract class Dft1dDirect extends Object

Direct (slow) implementation of the 1-dimensional DFT using tabulated sine and cosine values. Note that this class has no public constructor - instantiate sub-class Dft1dDirect.Float or Dft1dDirect.Double instead, as shown below. See Sec. 18.4.1 of [1] for additional details.

Usage example (for float data):

 float[] re = {1, 2, 3, 4, 5, 3, 0};
 float[] im = {0, 0, 0, 0, 0, 0, 0};
 Dft1d.Float dft = new Dft1dDirect.Float(re.length);
 dct.forward(re, im);  // re/im now is the DFT spectrum
 dct.inverse(re, im);  // re/im now is the original signal 
 ...
 

[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).

Version:
2022/10/23
  • Method Details

    • getSize

      public int getSize()
      Description copied from interface: Dft1d
      Returns the size of this DFT (length of data vectors).
      Specified by:
      getSize in interface Dft1d
      Returns:
      the size of this DFT
    • getScalingMode

      public ScalingMode getScalingMode()
      Description copied from interface: Dft1d
      Returns the scaling mode of this DFT (see ScalingMode).
      Specified by:
      getScalingMode in interface Dft1d
      Returns:
      the scaling mode of this DFT.