cscal1d,zscal1d(3F) cscal1d,zscal1d(3F)
cscal1d, zscal1d - scales a 1D real sequence.
Fortran :
subroutine cscal1d( n, alpha, array, inc)
integer n, inc
real alpha
complex array(0:(n-1)*inc)
subroutine zscal1d( n, alpha, array, inc)
integer n, inc
real*8 alpha
complex*16 array(0:(n-1)*inc)
C :
#include <fft.h>
int cscal1d ( int n, float alpha, complex *array, int inc);
int zscal1d ( int n, double alpha, zomplex *array, int inc);
cscal1d and zscal1d scale a complex sequences of N samples.
The Fourier Transforms are not normalized so the succession DirectInverse
transform scales the input data by a factor equal to the size of
the transform. cscal1d or zscal1d are used to scale back the result.
N Integer, the number of samples in each sequence.
Unchanged on exit.
Alpha scaling floating point value.
ARRAY Array containing the samples of the sequence to be scaled (in
place0.
INC Integer, increment between two consecutive elements of a sequence.
Unchanged on exit.
P Integer, the number of sequences. Unchanged on exit.
Example of Calling Sequence
Given a 1D Complex sequence of 200 samples. We successively apply a
Direct Fourier Transform, an Inverse Fourier Trasnform and finally scale
back the result by a factor 1/N (1/200.)-
This sequence DirectFFT-InverseFFT-Scaling is equivalent to the identity
operator and the final sequence should be equal (with round-off
precision) to the initial sequence.
Elements of each sequence are stored with increment (stride) 1.
Fortran :
complex array(0:200-1), coeff(200+15)
call cfft1di( 200, coeff)
Page 1
cscal1d,zscal1d(3F) cscal1d,zscal1d(3F)
call cfft1d( -1, 200, array, 1, coeff)
call cfft1d( 1, 200, array, 1, coeff)
call cscal1d(200,(1./real(200)),array,1)
C :
#include <fft.h>
complex array[200], *coeff;
coeff = cfft1di( 200, NULL);
cfft1d( -1, 200, array, 1, coeff);
cfft1d( 1, 200, array, 1, coeff);
cscal1d( 200, 1./(float)200, array, 1);
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.
fft, cfft1di, zfft1di, cfft1d, zfft1d, sprod1d, dprod1d
PPPPaaaaggggeeee 2222 [ Back ]
|