cprodm1d,zprodm1d(3F) cprodm1d,zprodm1d(3F)
cprodm1d, zprodm1d - Compute the product of Multiple 1D Fourier
transforms with Multiple 1D filters.
Fortran :
subroutine cprodm1d( n,p,array,inca,lda,filter,incf,ldf)
integer n, p, inca, lda, incf, ldf
complex array(lda,p), filter(ldf,p)
subroutine zprodm1d( n,p,array,inca,lda,filter,incf,ldf)
integer n, p, inca, lda, incf, ldf
double complex array(lda,p), filter(ldf,p)
C :
#include <fft.h>
int cprodm1d(int n, int p, complex *array, int inc,int lda,
complex *filter, int incf, int ldf);
int zprodm1d(int n, int p, zomplex *array,int inc,int lda,
zomplex *filter, int incf, int ldf);
cprodm1d and zprodm1d compute the product of the Fourier transforms of P
complex sequences of N samples with the Fourier transforms of P complex
filters. Note, the product of the Fourier transforms of two sequences is
equal to the Fourier transform of their convolution.
N - Integer, the number of samples in each sequence.
Unchanged on exit.
P - Integer, the number of sequences. Unchanged on exit.
ARRAY - Array containing the Fourier Transform. On exit, the array is
overwritten by the product.
INCA - Integer, increment between two consecutive elements of the
sequence. Unchanged on exit.
LDA - Integer, leading dimension: increment between the first samples of
two consecutive sequences. Unchanged on exit.
FILTER - Array containing the Fourier Transform of the filter(s).
Unchanged on exit.
INCF - Integer, increment between two consecutive elements of the filter.
Unchanged on exit.
Page 1
cprodm1d,zprodm1d(3F) cprodm1d,zprodm1d(3F)
LDF - Integer, leading dimension: increment between the first samples of
two consecutive filters. Unchanged on exit.
Example of Calling Sequence
Working on 64 sequences of 1024 complex values each. We successively
apply a Direct Fourier Transform, the product with a SINGLE 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 sequences (leading
dimension) is 2049.
Fortran
complex array(0:2049-1,0:64-1),
filter(0:2049-1,0:64-1), coeff(1024+15)
call cfftm1di( 1024, coeff)
call cfftm1d( -1, 1024, 64, array, 1, 2049, coeff)
call cprodm1d( 1024, 64, array, 1, 2049, filter, 1, 0)
call cfftm1d( 1, 1024, 64, array, 1, 2049, coeff)
C
#include <fft.h>
complex array[64*2049], filter[2049], *coeff;
coeff = cfftm1di( 1024, NULL);
cfftm1d( -1, 1024, 64, array, 1, 2049, coeff);
cprodm1d( 1024, 64, array, 1, 2049, filter, 1, 0);
cfftm1d( -1, 1024, 64, array, 1, 2049, coeff);
NOTE_1 : Using a 0 leading dimension for the filter is equivalent to
applying the same filter to all the input sequences.
NOTE_2 : 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 cscalm1d or zscalm1d to scale back the result, this
scaling factor could be directly applied to the filter transform, thus
saving some extra work.
fft, cfftm1di, zfftm1di, cfftm1d, zfftm1d, cscalm1d, zscalm1d
PPPPaaaaggggeeee 2222 [ Back ]
|