Method: Numo::Pocketfft.fft2

Defined in:
lib/numo/pocketfft.rb

.fft2(a) ⇒ Numo::DComplex

Compute the 2-dimensional discrete Fourier Transform.

Parameters:

  • a (Numo::DFloat/Numo::DComplex)

    Real or complex 2-dimensional input array.

Returns:

  • (Numo::DComplex)

    Transformed data.

Raises:

  • (ArgumentError)

    This error is raised if input array is not Numo::NArray, is not two-dimensional array, or is empty.



39
40
41
42
43
44
45
# File 'lib/numo/pocketfft.rb', line 39

def fft2(a)
  raise ArgumentError, 'Expect class of input array to be Numo::NArray.' unless a.is_a?(Numo::NArray)
  raise ArgumentError, 'Expect input array to be non-empty.' if a.empty?
  raise ArgumentError, 'Expect input array to be two-dimensional.' unless a.ndim == 2

  fftn(a)
end