sscal3d,dscal3d(3F) sscal3d,dscal3d(3F)
sscal3d, dscal3d - scales 3D real sequence.
Fortran :
subroutine sscal3d( n1, n2, n3, alpha, array, la1, la2)
integer n1, n2, n3, la1, la2
real alpha, array(la1,la2,n3)
subroutine dscal3d( n1, n2, n3, alpha, array, lda)
integer n1, n2, n3, la1, la2
real*8 alpha, array(la1,la2,n3)
C :
#include <fft.h>
int sscal3d(int n1,int n2,int n3, float alpha,
float *array,int la1, int la2);
int dscal3d(int n1,int n2,int n3, double alpha,
double *array,int la1, int la2);
sscal3d and dscal3d scale the 3D real sequence of N1xN2xN3 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. So sscal3d or dscal3d may be used to scale back the
result.
N1 Integer, the first dimension size of the 3D sequence. Unchanged on
exit.
N2 Integer, the second dimension size of the 3D sequence. Unchanged on
exit.
N3 Integer, the thrid dimension size of the 3D sequence. Unchanged on
exit.
Alpha scaling floating point value.
ARRAY Array containing the samples of the 3D sequence to be transformed.
On input, the element {i,j,k} of the sequence is stored as A(i,j,k) in
Fortran , and A[i+j*la1+k*la1*la2] in C.
On exit, the array is overwritten.
LA1 Integer, first leading dimension: increment between the samples of
two consecutive 1D sub-sequences (e.g between {i,j+1,k} and {i,j,k} ).
Unchanged on exit.
LA2 Integer, second leading dimension: number of the 1D sub-sequence
between two consecutive 2D sub-sequences (e.g between {i,j,k+1} and
{i,j,k}). Unchanged on exit.
Page 1
sscal3d,dscal3d(3F) sscal3d,dscal3d(3F)
Example of Calling Sequence
Given a real sequence of size 100x64x125. We apply successvely the
Direct FFT, the Inverse FFT, and scale back. The elements of each
sequence are stored with increment (stride) 1, the offset between the
first element of two succesive 1D sub-sequences (first leading dimension)
is 102, and the number of 1D sub-sequence between two succesive 2D subsequences
(second leading dimension) is 64.
Note : 102 >= 100+2 , and 64 >= 64.
Fortran
real array(0:102-1,0:64-1,0:125-1), alpha
real coeff(102+15 + 2*(64+15) + 2*(125+15))
call scfft3dui( 100, 64, 125, coeff)
call scfft3du( -1, 100, 64, 125, array, 102, 64, coeff)
call csfft3du( 1, 100, 64, 125, array, 102, 64, coeff)
alpha = 1./ real(100*64*125)
call sscal3d( 100, 64, 125, alpha, array, 102, 64)
C
#include <fft.h>
float array[64*102*125], *coeff;
coeff = scfft3dui( 100, 64, 125, NULL);
scfft3du( -1, 100, 64, 125, array, 102, 64, coeff);
csfft3du( 1, 100, 64, 125, array, 102, 64, coeff);
alpha = 1./(float)(100*64*125);
sscal3d( 100, 64, 125, alpha, array, 102, 64);
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, scfft3dui, dzfft3dui, scfft3du, dzfft3du, csfft3du, zdfft3du,
sprod3du, dprod3du
PPPPaaaaggggeeee 2222 [ Back ]
|