cscal2d(3F)

cscal2d, zscal2d - scales a 2D complex sequence.

As shipped in IRIX 6.5.22. Unchanged since IRIX 6.5.

NAME
     cscal2d, zscal2d - scales a 2D complex sequence.

SYNOPSYS
     Fortran :
     subroutine cscal2d( n1, n2, alpha, array, lda)
          integer     n1, n2, lda
          real        alpha
          complex     array(lda,n2)
     subroutine zscal2d( n1, n2, alpha, array, lda)
          integer     n1, n2, lda
          real*8      alpha
          double complex array(lda,n2)

     C :
     #include <fft.h>
     int cscal2d(int n1,int n2,float alpha,
               complex *array,int lda);
     int zscal2d(int n1,int n2,double alpha,
               zomplex *array,int lda);


DESCRIPTION
     cscal2d and zscal2d scale a 2D complex sequence of size N1xN2.
     The Fourier Transforms are not normalized so the succession Direct-
     Inverse transform scales the input data by a factor equal to the size of
     the transform.  So cscal2d or zscal2d may be used to scale back the
     result.

PARAMETERS
     N1 - Integer, the first dimension size of the 2D sequence.
     Unchanged on exit.

     N2 - Integer, the second dimension size of the 2D sequence.
     Unchanged on exit.

     Alpha - scaling floating point value.

     ARRAY - Array containing the samples of the 2D sequence to be
     transformed.
     On input, the element {i,j} of the sequence is stored as A(i,j) in
     Fortran , and A[i+j*lda] in C.
     On exit, the array is overwritten by its transform.  LDA - Integer,
     leading dimension: increment between the samples of two consecutive sub-
     sequences (e.g between {i,j+1} and {i,j}).
     Unchanged on exit.


Example of Calling Sequence
     Given a 2D complex sequence of size 64x1024.  We successively apply a
     Direct Fourier Transform, an Inverse Fourier Transform and finally scale
     back the result by a factor 1/N (1/(64*1024.))-
     This succession DirectFFT-InverseFFT-Scaling is equivalent to the
     identity operator and the final sequence should be equal (with round-off
     precision) to the initial sequence.
     The offset between the first element of two succesive sub-sequence
     (leading dimension) is 2049.
     Fortran
          complex array(0:2049-1,0:64-1), coeff(1024+64+2*15)
          call cfft2di( 1024, coeff)
          call cfft2d( -1, 1024, 64, array, 2049, coeff)
          call cfft2d(  1, 1024, 64, array, 2049, coeff)
          call cscal2d(1024,64,(1./real(1024*64)),array,2049)

     C
          #include <fft.h>
          complex array[64*2049], *coeff;
          coeff = cfft2di( 1024, NULL);
          cfft2d( -1, 1024, 64, array, 2049, coeff);
          cfft2d(  1, 1024, 64, array, 2049, coeff);
          cscal2d( 1024,64,1./(float)(1024*64),array,2049);

     NOTE_1 : The Direct and Inverse transforms should use opposite signs -
     Which one is used (+1 or -1) for Direct transform is just a matter of
     convention-

     NOTE_2 : The Fourier Transforms are not normalized so the succession
     Direct-Inverse transform scales the input data by a factor equal to the
     size of the transform.

SEE ALSO
     fft, cfft2di, zfft2di, cfft2d, zfft2d, cprod2d, zprod2d