SCFFT2,DZFFT2(3)            MathKeisan FFT routine            SCFFT2,DZFFT2(3)



NAME
       rcfft2, dzfft2 - one-dimensional real-to-complex FFT

SYNOPSIS
       libfft.a

          INTEGER init, ix, n
          COMPLEX y(n/2 + 1)
          REAL    x(n+2), work(2*n + 64)
          CALL RCFFT2 ( init, ix, n, x, work, y )

          INTEGER         init, ix, n
          COMPLEX(kind=8) y(n/2 + 1)
          REAL(kind=8)    x(n+2), work(2*n + 64)
          CALL DZFFT2 ( init, ix, n, x, work, y )

       libfft_64.a

          INTEGER(kind=8) init, ix, n
          COMPLEX(kind=8) y(n/2 + 1)
          REAL(kind=8)    x(n+2), work(2*n + 64)
          CALL RCFFT2 ( init, ix, n, x, work, y )

          INTEGER(kind=8) init, ix, n
          COMPLEX(kind=8) y(n/2 + 1)
          REAL(kind=8)    x(n+2), work(2*n + 64)
          CALL DZFFT2 ( init, ix, n, x, work, y )

DESCRIPTION
       This subroutine computes the one-dimensional discrete Fourier transform
       of the given real array x; the transformed data is stored in  the  com-
       plex  array  y.   If  we take x and y to be dimensioned as x(0:n-1) and
       y(0:n/2), the transform is expressed by the following formula:


                  n-1

       y(k) = 2 * Sum x(j) * exp((+/-)j*k*2*pi*i/n)

                  j=0


       for k = 0, ..., n/2, where i = sqrt(-1).

       In order to accomodate multiple calls of the same size to this routine,
       an  additional initialization step is required prior to the computation
       of any transforms.  Hence, whenever it is desired to use [(RC)(DZ)]FFT2
       in a program, it must be called at least twice.

       A  result  of Fourier theory is that a transform of real data is conju-
       gate symmetric; hence, only the first n/2 + 1 complex data points  will
       be output by this routine.

       Note that this routine currently provides only serial functionality.


ARGUMENTS
       Input

       init   Option flag:

              If  init != 0, the routine is initialized for the given value of
              n.

       ix     Determines the sign of the exponential in  the  transform.   The
              sign of the exponential in the transform is the same as the sign
              of ix.

              Not used if init != 0.

              NOTE: This routine requires that ix != 0 if init = 0.

       n      Number of data points (n>0).

              NOTE: This routine requires that n be even.

       x      Array of data to be transformed.

              Not used if init != 0.

       Working Storage

       work   Workspace for computing the transform.

              Not used if init != 0.

       Output

       y      Transformed data.

              Not used if init != 0.



SciLib routine                                                SCFFT2,DZFFT2(3)