cosqmf

Return to Main Contents

NAME

COSQMF - real, multiple forward quarter-cosine fast Fourier transform

SYNOPSIS

 SUBROUTINE COSQMF (LOT, JUMP, N, INC, R, LENR, WSAVE, LENSAV, 
1                   WORK, LENWRK, IER)

 INTEGER    LOT, JUMP, N, INC, LENR, LENSAV, LENWRK, IER
 REAL       R(LENR), WSAVE(LENSAV), WORK(LENWRK)

DESCRIPTION

 FFTPACK 5.0 routine COSQMF computes the one-dimensional Fourier 
 transform of multiple sequences within a real array, where each 
 of the sequences is a cosine series with odd wave numbers.  This 
 transform is referred to as the forward transform or Fourier 
 synthesis, transforming the sequences from spectral to physical 
 space.
 
 This transform is normalized since a call to COSQMF followed
 by a call to COSQMB (or vice-versa) reproduces the original
 array  within roundoff error.
 
 Input Arguments
 
 LOT     Integer number of sequences to be transformed within
         array R.
 
 JUMP    Integer increment between the locations, in array R,
         of the first elements of two consecutive sequences
         to be transformed.

 N       Integer length of each sequence to be transformed.  The 
         transform is most efficient when N is a product of 
         small primes.
 
 INC     Integer increment between the locations, in array R,
         of two consecutive elements within the same sequence.
 
 R       Real array containing LOT sequences, each having length N.
         R can have any number of dimensions, but the total number 
         of locations must be at least LENR.
 
 LENR    Integer dimension of R array.  LENR must be at least
         (LOT-1)*JUMP + INC*(N-1)+ 1.


 WSAVE   Real work array o length LENSAV.  WSAVE's contents must 
         be initialized with a call to subroutine COSQMI before the 
         first call to routine COSQMF or COSQMB for a given transform
         length N.  WSAVE's contents may be re-used for subsequent
         calls to COSQMF and COSQMB with the same N.
 
 LENSAV  Integer dimension of WSAVE array.  LENSAV must be at least 
         2*N + INT(LOG (REAL(N))) +4.


 WORK    Real array of dimension LENWRK.
 
 LENWRK  Integer dimension of WORK array.  LENWRK must be at 
         least LOT*N.


 Output Arguments
 
  R      Real output array R.  For purposes of exposition, 
         assume R's range of indices is given by 
         R(0:(LOT-1)*JUMP+(N-1)*INC).
 
         The output values of R are written over the input values.
         For I=0,...,LOT-1 and J=0,...,N-1
 
          R(I*JUMP+J*INC) = 

              R(I*JUMP)/N 
 
              N-1
            + SUM  2.*R(I*JUMP+*N1*INC)*COS((2*J+1)*N1*PI/(2*N))/N
              N1=1
 
 IER     Integer error return
         =  0 successful exit
         =  1 input parameter LENR   not big enough
         =  2 input parameter LENSAV not big enough
         =  3 input parameter LENWRK not big enough
         =  4 input parameters INC,JUMP,N,LOT are not consistent.
         = 20 input error returned by lower level routine

              The parameters integers INC, JUMP, N and LOT are 
              consistent if equality 
              I1*INC + J1*JUMP = I2*INC + J2*JUMP for I1,I2 < N 
              and J1,J2 < LOT implies I1=I2 and J1=J2.

              For multiple FFTs to execute correctly, input variables 
              INC, JUMP, N and LOT must be consistent, otherwise at 
              least one array element mistakenly is transformed more 
              than once.