Indexfft_nrfft5 fft_nrfft5odd fft_ccfftm fft_ccfft2d fft_ccfft3d fft_crfftm fft_crfft2d fft_crfft3d fft_rcfftm fft_rcfft2d fft_rcfft3d fft_zzfftm fft_zzfft2d fft_zzfft3d
|
fft_crfft2d - complex-real 2D FFT
SYNOPSIS
#include <fft.h> (fixed-format sources)
#include <f90fft.h> (free-format sources)
integer function fft_crfft2d(scale, n1, n2, ld1, data, iopt)
-
real scale
integer n1
integer n2
integer ld1
real data(ld1,n2)
integer iopt
DESCRIPTION
The function, "fft_crfft2d", performs a complex-to-real 2D FFT --
essentially a 1D CC FFT along the second axis followed by a 1D FFT along
the first axis.
INPUT
The parameter, "scale", specifies the scale factor to be
applied to the data.
The size parameters, "n1" and "n2", specify the 2D FFT
sizes. These must be setup as mixed radix values (must be even) in
order to allow the FFT's to be more efficient. It is recommended to
use fft_nrfft5 to calculate these values.
The leading dimension parameter, "ld1", specifies the leading
dimension of the data array in number of real values. It must be
even and at least "n1" + 2.
The real array, "data", is the I/O array; it is performed
"in place". The input complex data must be packed into "n1"+2
real array locations in a typical half-complex format.
The parameter, "iopt", is used to specify any other
information that is unique to a specific FFT implementation.
Currently, the use is for specifying whether to measure or estimate
the FFT's when using FFTW routines. The "fft.h" header
defines FFT_MEASURE and FFT_ESTIMATE, besides defining
the FFT functions, as integer.
OUTPUT
The fft results are returned in the real data array and the returned
value is zero "0" if successful. A value of "-1" is returned if the
arguments are invalid. Otherwise, a value unique to each FFT
implementation is returned.
EXAMPLE
integer :: fft_size1, complex_vals, fft_size2, fft_flag
integer :: ier
real :: fft_scale
real, allocatable :: data(:,:)
complex :: cdata
pointer(ptr_cdata, cdata)
fft_size1 = fft_nrfft5(100)
complex_vals = fft_size/2+1
fft_size2 = fft_nrfft5(50)
! allocate real data, but have complex data point to same location
allocate(data(2*complex_vals, fft_size2))
ptr_cdata = loc(data(1,1))
...
fft_flag = FFT_ESTIMATE
! forward FFT
fft_scale = 1.0D+00/(dble(fft_size1)*dble(fft_size2))
ier = fft_rcfft2d(fft_scale, fft_size1, fft_size2, 2*complex_vals, data, fft_flag)
! can now access complex data as cdata(complex_vals, fft_size2)
! inverse FFT
fft_scale = 1.0
ier = fft_crfft2d(fft_scale, fft_size1, fft_size2, 2*complex_vals, data, fft_flag)
AUTHOR
Phuong Vu, HPC
Jerry Ehlers, EPTG
|