fftr2

Functions

int main(int argc, char *argv[])

fftr2 [ option ] [ infile ]

  • -l int

    • FFT length \((1 \le L)\)

  • -r int

    • number of rows \((1 \le M \le L)\)

  • -c int

    • number of columns \((1 \le N \le L)\)

  • -o int

    • output format

      • 0 real and imaginary parts

      • 1 real part

      • 2 imaginary part

      • 3 amplitude spectrum

      • 4 power spectrum

  • -p int

    • output style

      • 0 standard

      • 1 transposed

      • 2 transposed with boundary

      • 3 quadrand with boundary

  • infile str

    • double-type 2D data sequence

  • stdout

    • double-type 2D FFT sequence

Parameters:
  • argc[in] Number of arguments.

  • argv[in] Argument vector.

Returns:

0 on success, 1 on failure.

See also

fftr ifft2 fft2

class TwoDimensionalRealValuedFastFourierTransform

Calculate 2D DFT of real-valued input data.

The input is a real-valued \(M \times N\) matrix:

\[ \begin{array}{cc} \boldsymbol{x}. \end{array} \]
The outputs are two \(L \times L \) matrices:
\[ \begin{array}{cccc} \mathrm{Re}(\boldsymbol{X}), & \mathrm{Im}(\boldsymbol{X}), \end{array} \]
where \(L\) is the FFT length and must be a power of two.

Public Functions

TwoDimensionalRealValuedFastFourierTransform(int num_row, int num_column, int fft_length)
Parameters:
  • num_row[in] Number of rows, \(M\).

  • num_column[in] Number of columns, \(N\).

  • fft_length[in] FFT length, \(L\).

inline int GetNumRow() const
Returns:

Number of rows of input.

inline int GetNumColumn() const
Returns:

Number of columns of input.

inline int GetFftLength() const
Returns:

FFT length.

inline bool IsValid() const
Returns:

True if this object is valid.

bool Run(const Matrix &real_part_input, Matrix *real_part_output, Matrix *imag_part_output, TwoDimensionalRealValuedFastFourierTransform::Buffer *buffer) const
Parameters:
  • real_part_input[in] Real part of input.

  • real_part_output[out] Real part of output.

  • imag_part_output[out] Imaginary part of output.

  • buffer[out] Buffer.

Returns:

True on success, false on failure.

bool Run(Matrix *real_part, Matrix *imag_part, TwoDimensionalRealValuedFastFourierTransform::Buffer *buffer) const
Parameters:
  • real_part[inout] Real part.

  • imag_part[out] Imaginary part.

  • buffer[out] Buffer.

Returns:

True on success, false on failure.

class Buffer

Buffer for TwoDimensionalRealValuedFastFourierTransform class.