next up previous index
Next: D704 Complex Fast Up: CERNLIB Previous: D700 Real Fast

D703 Real Fast Fourier Transform

Routine ID: D703
Author(s): H.-H. UmstätterLibrary: KERNLIB
Submitter: Submitted: 01.12.1981
Language: FortranRevised:

Subroutine RFFT computes either:

the finite Fourier transform of a real periodic sequence, or

the corresponding inverse transform.
The period n must be a power of 2.

Given a sequence of real numbers y0,y1,...,yn-1 , the forward transform computes the terms

ck = {1n}∑m=0n-1ymexp( {-i 2πmkn}),

= {1n}∑m=0n-1ymcos( {2πmkn}) -{in}∑m=0n-1ymsin( {2πmkn}),(k=0,1,...,n-1),

which have period n in the subscript k and passess the property c-k=ck=cn-k , where ck is the complex conjugate of ck . Therefore only those ck for which 0 ≤k ≤n/2

are computed by RFFT.

Conversely, given a sequence of complex numbers c0,c1,...,cn-1

possessing the property c-k=ck , the inverse transform computes the terms

ym = k=0n-1ckexp( {i 2πkmn}),(m=0,1,...,n-1),

which have period n in the subscript m and are real. Only those ck for which 0 ≤k ≤n/2 need be supplied as input to RFFT for the calculation of (2).

To ensure optimum use of storage, the same array is used for input and output, and all intermediate calculations are carried out in this array.

Structure:

SUBROUTINE subprogram
User Entry Names: RFFT
External References: CFFT (D704)

Usage:

    COMPLEX C(ncdim)
    REAL Y(nydim)
    EQUIVALENCE (C,Y)
    ...
    CALL RFFT (C,M)
    ...

C
( COMPLEX) Array of length ncdim not less than (n/2+1) .
Y
( REAL) Array of length nydim not less than n.
M
( INTEGER) On entry, the absolute value of M determines the value of n through the relation n=2|M| . If M is negative, expression (1) is evaluated. If M is non-negative, expression (2) is evaluated. Unchanged on exit.
M < 0:
On entry, Y(m+1)=ym, (m=0,1,...,n-1) .
On exit, C(k+1)=ck, (k=0,1,...,n/2) , as defined by (1).
M ≥0:
On entry, C(k+1)=ck, (k=0,1,...,n/2) .
On exit, Y(m+1)=ym, (m=0,1,...,n/2) , as defined by (2) with ck=ck .

Method:

RFFT calls the complex fast Fourier transform subroutine CFFT (D704) with sequences of half-length as explained in Ref. 1.

References:

  1. E.O. Brigham, The fast Fourier transformation, (Prentice-Hall, Englewood Cliffs 1974) Chap. 10, Sect. 10, Fig. 10-10.

D704



next up previous index
Next: D704 Complex Fast Up: CERNLIB Previous: D700 Real Fast


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995