FFT_2D Function

public function FFT_2D(signal, method, threads) result(result)

Perform a 2D Fast Fourier Transform on a signal

This function takes a signal and performs a Fourier Transform using the specified method. The available methods are:

  • "NAFPack_FFT_2D": Fast Fourier Transform using NAFPack
  • "FFTW_FFT_2D": Fast Fourier Transform using FFTW
  • "FFTW_FFT_2D" + threads: Fast Fourier Transform using FFTW with multithreading

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), dimension(:, :) :: signal
character(len=*), intent(in) :: method
integer, intent(in), optional :: threads

Return Value complex(kind=dp), dimension(size(signal, 1), size(signal, 2))


Calls

proc~~fft_2d~~CallsGraph proc~fft_2d FFT_2D fftw_cleanup fftw_cleanup proc~fft_2d->fftw_cleanup fftw_cleanup_threads fftw_cleanup_threads proc~fft_2d->fftw_cleanup_threads fftw_destroy_plan fftw_destroy_plan proc~fft_2d->fftw_destroy_plan fftw_execute_dft fftw_execute_dft proc~fft_2d->fftw_execute_dft fftw_init_threads fftw_init_threads proc~fft_2d->fftw_init_threads fftw_plan_dft_2d fftw_plan_dft_2d proc~fft_2d->fftw_plan_dft_2d fftw_plan_with_nthreads fftw_plan_with_nthreads proc~fft_2d->fftw_plan_with_nthreads

Source Code

    function FFT_2D(signal, method, threads) result(result)

        complex(dp), dimension(:, :), intent(inout) :: signal
        character(*), intent(in) :: method
        integer, optional, intent(in) :: threads
        complex(dp), dimension(size(signal, 1), size(signal, 2)) :: result

        if (method == "NAFPack_FFT_2D") then
            result = NAFPack_FFT_2D(signal)
        else if (method == "FFTW_FFT_2D" .and. .not. present(threads)) then
            result = FFTW_FFT_2D(signal)
        else if (method == "FFTW_FFT_2D" .and. present(threads)) then
            result = FFTW_FFT_2D_threads(signal, threads)
        else
            stop "ERROR : Wrong method for FFT_2D"
        end if

    end function FFT_2D