Given a sequence of
$n$ real data values
${x}_{\mathit{j}}$, for
$\mathit{j}=0,1,\dots ,n-1$,
c06faf calculates their discrete Fourier transform defined by
(Note the scale factor of
$\frac{1}{\sqrt{n}}$ in this definition.) The transformed values
${\hat{z}}_{k}$ are complex, but they form a Hermitian sequence (i.e.,
${\hat{z}}_{n-k}$ is the complex conjugate of
${\hat{z}}_{k}$), so they are completely determined by
$n$ real numbers (see also the
C06 Chapter Introduction).
To compute the inverse discrete Fourier transform defined by
this routine should be followed by forming the complex conjugates of the
${\hat{z}}_{k}$; that is,
$x\left(\mathit{k}\right)=-x\left(\mathit{k}\right)$, for
$\mathit{k}=n/2+2,\dots ,n$.
c06faf uses the fast Fourier transform (FFT) algorithm (see
Brigham (1974)).
If on entry
${\mathbf{ifail}}=0$ or
$\mathrm{-1}$, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
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).
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
This example reads in a sequence of real data values and prints their discrete Fourier transform (as computed by
c06faf), after expanding it from Hermitian form into a full complex sequence. It then performs an inverse transform using
c06fbf and conjugation, and prints the sequence so obtained alongside the original data values.