FFT_1D Function

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

Perform a 1D Fourier Transform on a signal

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

  • "NAFPack_DFT": Direct Discrete Fourier Transform
  • "NAFPack_FFT_1D": Fast Fourier Transform using NAFPack
  • "FFTW_FFT_1D": Fast Fourier Transform using FFTW
  • "FFTW_FFT_1D" + 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))


Calls

proc~~fft_1d~~CallsGraph proc~fft_1d FFT_1D fftw_cleanup fftw_cleanup proc~fft_1d->fftw_cleanup fftw_cleanup_threads fftw_cleanup_threads proc~fft_1d->fftw_cleanup_threads fftw_destroy_plan fftw_destroy_plan proc~fft_1d->fftw_destroy_plan fftw_execute_dft fftw_execute_dft proc~fft_1d->fftw_execute_dft fftw_init_threads fftw_init_threads proc~fft_1d->fftw_init_threads fftw_plan_dft_1d fftw_plan_dft_1d proc~fft_1d->fftw_plan_dft_1d fftw_plan_with_nthreads fftw_plan_with_nthreads proc~fft_1d->fftw_plan_with_nthreads

Source Code

    function FFT_1D(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)) :: result

        if (method == "NAFPack_DFT") then
            result = NAFPack_DFT_1D(signal)
        else if (method == "NAFPack_FFT_1D") then
            result = NAFPack_FFT_1D(signal)
        else if (method == "FFTW_FFT_1D" .and. .not. present(threads)) then
            result = FFTW_FFT_1D(signal)
        else if (method == "FFTW_FFT_1D" .and. present(threads)) then
            result = FFTW_FFT_1D_threads(signal, threads)
        else
            stop "ERROR : Wrong method for FFT_1D"
        end if

    end function FFT_1D