·  Home
+   man pages
 -> Linux -> FreeBSD -> OpenBSD -> NetBSD -> Tru64 Unix -> HP-UX 11i -> IRIX
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

man pages->IRIX man pages -> complib/cprod1d (3)
 Title
 Content
 Arch
 Section All Sections 1 - General Commands 2 - System Calls 3 - Subroutines 4 - Special Files 5 - File Formats 6 - Games 7 - Macros and Conventions 8 - Maintenance Commands 9 - Kernel Interface n - New Commands

### Contents

```
cprod1d,zprod1d(3F)					   cprod1d,zprod1d(3F)

```

### NAME[Toc][Back]

```     cprod1d, zprod1d -	Compute	the product of a 1D Fourier transform with a
1D	filter.
```

### SYNOPSYS[Toc][Back]

```     Fortran :
subroutine	cprod1d( n,array,inca,filter,incf)
integer   n, inca, incf
complex   array(0:(n-1)*inca), filter(0:(n-1)*incf)

subroutine	zprod1d( n,p,array,inca,filter,incf)
integer   n, inca, incf
double complex      array(0:(n-1)*inca),
filter(0:(n-1)*incf)

C :
#include <fft.h>
int cprod1d(int n,	complex	*array,	int inc,
complex *filter,	int incf);
int zprod1d(int n,	zomplex	*array,int inc,
zomplex *filter,	int incf);

```

### DESCRIPTION[Toc][Back]

```     cprod1d and zprod1d compute the product of	the Fourier transforms of a
complex sequence of N samples with	the Fourier transforms of a complex
filter.
Note, the product of the Fourier transforms of two	sequences is equal to
the Fourier transform of their convolution.

```

### PARAMETERS[Toc][Back]

```     N - Integer, the number of	samples	in each	sequence.
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.

FILTER - Array containing the Fourier Transform of	the filter.  Unchanged
on	exit.

INCF - Integer, increment between two consecutive elements	of the filter.
Unchanged on exit.

Page 1

cprod1d,zprod1d(3F)					   cprod1d,zprod1d(3F)

Example	of Calling Sequence
Working on	a sequence of 1024 complex values.  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.
Fortran
complex array(0:1024-1), filter(0:1024-1),
coeff(1024+15)
call cfft1di(	1024, coeff)
call cfft1d( -1, 1024, array,	1, coeff)
call cprod1d(	1024, array, 1,	filter,
call cfft1d(	1, 1024, array,	1, coeff)

C
#include <fft.h>
complex array[1024], filter[1024], *coeff;
coeff	= cfft1di( 1024, NULL);
cfft1d( -1, 1024, array, 1, coeff);
cprod1d( 1024, array,	1, filter, 1);
cfft1d( -1, 1024, array, 1, 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 cscal1d or zscal1d to	scale back the result, this scaling
factor could be directly applied to the filter transform, thus saving
some extra	work.
```

```     fft, cfft1di, zfft1di, cfft1d, zfft1d, cscal1d, zscal1d