cprod3d(3F)
cprod3d, zprod3d - Compute the product of a 3D Fourier transforms with a 3D filter.
As shipped in IRIX 6.5.19. Unchanged since IRIX 6.5.
NAME cprod3d, zprod3d - Compute the product of a 3D Fourier transforms with a 3D filter. SYNOPSYS Fortran : subroutine cprod3d( n1,n2,n3,array,la1,la2,filter,lf1,lf2) integer n1,n2,n3,la1,la2,lf1,lf2 complex array(la1,la2,n3), filter(lf1,lf2,n3) subroutine zprod3d( n1,n2,n3,array,la1,la2,filter,lf1,lf2) integer n1,n2,n3,la1,la2,lf1,lf2 double complex array(la1,la2,n3), filter(lf1,lf2,n3) C : #include <fft.h> int cprod3d(int n1,int n2,int n3,complex *array,int la1, int la2, complex *filter, int lf1, int lf2); int zprod3d(int n1,int n2,int n3,zomplex *array,int la1, int la2, zomplex *filter, int lf1, int lf2); DESCRIPTION cprod3d and zprod3d compute the product of the Fourier transforms of 3D complex sequence (size N1xN2xN3) with the Fourier transform of 3D filter. Note, the product of the Fourier transforms of two sequences is equal to the Fourier transform of their convolution. PARAMETERS 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. 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. FILTER Array containing the Fourier Transform of the 3D filter. Unchanged on exit. LF1 Integer, filter array first leading dimension. Unchanged on exit. LF2 Integer, filter array second leading dimension. Unchanged on exit. 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, Fortran complex array(0:100-1,0:64-1,0:125-1) complex filter(0:100-1,0:64-1,0:125-1), complex coeff(100+15 + 64+15 + 125+15) call cfft3di( 100, 64, 125, coeff) call cfft3d( -1, 100, 64, 125, array, 100, 64, coeff) call cprod3d( 100,64,125,array,100 ,64,filter,100,64) call cfft3d( 1, 100, 64, 125, array, 100, 64, coeff) C #include <fft.h> complex array[100*64*125], filter[100*64*125], *coeff; coeff = cfft3di( 100, 64, 125, NULL); cfft3d( -1, 100, 64, 125, array, 100, 64, coeff); cprod3d( 100, 64, 125, array, 100, 64, filter, 100); cfft3d( -1, 100, 64, 125, array, 100, 64, coeff); NOTE : As the FFTs are not normalized, a successive direct, then inverse transform, scales the original input by the size of the sequence. Rather than calling cscal3d or zscal3d to scale back the result, this scaling factor could be directly applied to the filter transform, thus saving some extra work. SEE ALSO fft, cfft3di, zfft3di, cfft3d, zfft3d, cscal3d, zscal3d