nag_fft_real (c06eac) calculates the discrete Fourier transform of a sequence of real data values.
Given a sequence of
real data values
, for
, nag_fft_real (c06eac) calculates their discrete Fourier transform defined by
(Note the scale factor of
in this definition.) The transformed values
are complex, but they form a Hermitian sequence (i.e.,
is the complex conjugate of
), so they are completely determined by
real numbers.
The function
nag_multiple_hermitian_to_complex (c06gsc) may be used to convert a Hermitian sequence to the corresponding complex sequence.
To compute the inverse discrete Fourier transform defined by
this function should be followed by a call of
nag_conjugate_hermitian (c06gbc) to form the complex conjugates of the
.
nag_fft_real (c06eac) uses the fast Fourier transform (FFT) algorithm (see
Brigham (1974)). There are some restrictions on the value of
(see
Section 5).
Some indication of accuracy can be obtained by performing a subsequent inverse transform and comparing the results with the original sequence (in exact arithmetic they would be identical).
Not applicable.
This example reads in a sequence of real data values and prints their discrete Fourier transform (as computed by nag_fft_real (c06eac)), after expanding it from Hermitian form into a full complex sequence. It then performs an inverse transform using
nag_fft_hermitian (c06ebc) and
nag_conjugate_hermitian (c06gbc), and prints the sequence so obtained alongside the original data values.