cprod2d,zprod2d(3F) cprod2d,zprod2d(3F)
cprod2d, zprod2d - Compute the product of a 2D Fourier transforms with a
2D filter.
Fortran :
subroutine cprod2d( n1,n2,array,lda,filter,ldf)
integer n1,n2,lda,ldf
complex array(lda,n2), filter(ldf,n2)
subroutine zprod2d( n1,n2,array,lda,filter,ldf)
integer n1,n2,lda,ldf
double complex array(lda,n2), filter(ldf,n2)
C :
#include <fft.h>
int cprod2d(int n, int p, complex *array, int lda,
complex *filter, int ldf);
int zprod2d(int n, int p, zomplex *array,int lda,
zomplex *filter, int ldf);
cprod2d and zprod2d compute the product of the Fourier transforms of 2D
complex sequence (size N1xN2) with the Fourier transform of 2D filter.
Note, the product of the Fourier transforms of two sequences is equal to
the Fourier transform of their convolution.
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.
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, array
leading dimension: increment between the samples of two consecutive subsequences
(e.g between {i,j+1} and {i,j} ).
Unchanged on exit.
FILTER - Array containing the Fourier Transform of the 2D filter.
Unchanged on exit.
LDF - Integer, array leading dimension: increment between the first
samples of two consecutive sub-sequence(e.g between {i,j+1} and {i,j} ).
Unchanged on exit.
Page 1
cprod2d,zprod2d(3F) cprod2d,zprod2d(3F)
Example of Calling Sequence
Given a complex 2D input of size 1024x64. We successively apply a Direct
Fourier Transform, the product with a filter transform, then an Inverse
Fourier TransformElements
of each sequence are stored with increment (stride)1, and the
offset between the first element of two succesive sub-sequences (leading
dimension) is 2049.
Fortran
complex array(0:2049-1,0:64-1), filter(0:2049-1,0:64-1),
coeff(1024+15 + 64+15)
call cfft2di( 1024, coeff)
call cfft2d( -1, 1024, 64, array, 2049, coeff)
call cprod2d( 1024, 64, array, 2049 , filter, 2049)
call cfft2d( 1, 1024, 64, array, 2049, coeff)
C
#include <fft.h>
complex array[64*2049], filter[64*2049], *coeff;
coeff = cfft2di( 1024, 64, NULL);
cfft2d( -1, 1024, 64, array, 2049, coeff);
cprod2d( 1024, 64, array, 2049, filter, 2049);
cfft2d( -1, 1024, 64, array, 2049, 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 cscal2d or zscal2d to scale back the result, this scaling
factor could be directly applied to the filter transform, thus saving
some extra work.
fft, cfft2di, zfft2di, cfft2d, zfft2d, cscal2d, zscal2d
PPPPaaaaggggeeee 2222 [ Back ]
|