fft_genericfft_genericFftGenericFftGenericFftGeneric computes the fast Fourier transform of the input
image ImageImageImageImageimage. Because several definitions of the forward
and reverse transforms exist in the literature, this operator allows
the user to select the most convenient definition.
The general definition of a Fourier transform is as follows:
Opinions vary on whether the sign s in the exponent should
be set to 1 or -1 for the forward transform, i.e., the transform for
going to the frequency domain. There is also disagreement on the
magnitude of the normalizing factor c. This is sometimes
set to 1 for the forward transform, sometimes to M*N, and
sometimes (in case of the unitary FFT) to
. Especially in image processing
applications the DC term is shifted to the center of the image.
fft_genericfft_genericFftGenericFftGenericFftGeneric allows to select these choices individually.
The parameter DirectionDirectionDirectionDirectiondirection allows to select the logical
direction of the FFT. (This parameter is not unnecessary; it is
needed to discern how to shift the image if the DC term should rest
in the center of the image.) Possible values are 'to_freq'"to_freq""to_freq""to_freq""to_freq"
and 'from_freq'"from_freq""from_freq""from_freq""from_freq". The parameter ExponentExponentExponentExponentexponent is used
to determine the sign of the exponent. It can be set to 1 or -1.
The normalizing factor can be set with NormNormNormNormnorm, and can take
on the values 'none'"none""none""none""none", 'sqrt'"sqrt""sqrt""sqrt""sqrt" and 'n'"n""n""n""n".
The parameter ModeModeModeModemode determines the location of the DC term
of the FFT. It can be set to 'dc_center'"dc_center""dc_center""dc_center""dc_center" or
'dc_edge'"dc_edge""dc_edge""dc_edge""dc_edge".
In any case, the user must ensure the consistent use of the
parameters. This means that the normalizing factors used for the
forward and backward transform must yield M*N when
multiplied, the exponents must be of opposite sign, and
ModeModeModeModemode must be equal for both transforms.
A consistent combination is, for example
'(to_freq,-1,n,dc_edge)'"(to_freq,-1,n,dc_edge)""(to_freq,-1,n,dc_edge)""(to_freq,-1,n,dc_edge)""(to_freq,-1,n,dc_edge)" for the forward transform and
'(from_freq,1,none,dc_edge)'"(from_freq,1,none,dc_edge)""(from_freq,1,none,dc_edge)""(from_freq,1,none,dc_edge)""(from_freq,1,none,dc_edge)" for the reverse transform.
In this case, the FFT can be interpreted as interpolation with
trigonometric basis functions. Another possible combination is
'(to_freq,-1,sqrt,dc_center)'"(to_freq,-1,sqrt,dc_center)""(to_freq,-1,sqrt,dc_center)""(to_freq,-1,sqrt,dc_center)""(to_freq,-1,sqrt,dc_center)" and
'(from_freq,1,sqrt,dc_center)'"(from_freq,1,sqrt,dc_center)""(from_freq,1,sqrt,dc_center)""(from_freq,1,sqrt,dc_center)""(from_freq,1,sqrt,dc_center)".