casacore

C++ interface to the Fortran FFTPACK library. More...
#include <FFTPack.h>
Static Public Member Functions  
static void  cffti (Int n, Float *wsave) 
cffti initializes the array wsave which is used in both cfftf and cfftb . More...  
static void  cffti (Int n, Double *wsave) 
static void  cfft2i (const Int &n, const Int &m, Float *&wsave, const Int &lensav, Int &ier) 
Here is the doc from FFTPack 5.1 You can convert the linguo from fortran to C/C++. More...  
static void  cfftf (Int n, Complex *c, Float *wsave) 
cfftf computes the forward complex discrete Fourier transform (the Fourier analysis). More...  
static void  cfftf (Int n, DComplex *c, Double *wsave) 
static void  cfft2f (const Int &ldim, const Int &L, const Int &M, Complex *&C, Float *&WSAVE, const Int &LENSAV, Float *&WORK, const Int &LENWRK, Int &IER) 
Description from FFTPack 5.1. More...  
static void  cfftb (Int n, Complex *c, Float *wsave) 
cfftb computes the backward complex discrete Fourier transform (the Fourier synthesis). More...  
static void  cfftb (Int n, DComplex *c, Double *wsave) 
static void  cfft2b (const Int &LDIM, const Int &L, const Int &M, Complex *&C, Float *&WSAVE, const Int &LENSAV, Float *&WORK, const Int &LENWRK, Int &IER) 
Documentation from FFTPack 5.1. More...  
static void  rffti (Int n, Float *wsave) 
rffti initializes the array wsave which is used in both rfftf and rfftb . More...  
static void  rffti (Int n, Double *wsave) 
static void  rfftf (Int n, Float *r, Float *wsave) 
rfftf computes the Fourier coefficients of a real perodic sequence (Fourier analysis). More...  
static void  rfftf (Int n, Double *r, Double *wsave) 
static void  rfftb (Int n, Float *r, Float *wsave) 
rfftb computes the real perodic sequence from its Fourier coefficients (Fourier synthesis). More...  
static void  rfftb (Int n, Double *r, Double *wsave) 
static void  ezffti (Int n, Float *wsave) 
ezffti initializes the array wsave which is used in both ezfftf and ezfftb . More...  
static void  ezfftf (Int n, Float *r, Float *azero, Float *a, Float *b, Float *wsave) 
ezfftf computes the Fourier coefficients of a real perodic sequence (Fourier analysis). More...  
static void  ezfftb (Int n, Float *r, Float *azero, Float *a, Float *b, Float *wsave) 
ezfftb computes a real perodic sequence from its Fourier coefficients (Fourier synthesis). More...  
static void  sinti (Int n, Float *wsave) 
sinti initializes the array wsave which is used in sint . More...  
static void  sinti (Int n, Double *wsave) 
static void  sint (Int n, Float *x, Float *wsave) 
sint computes the discrete Fourier sine transform of an odd sequence x(i). More...  
static void  sint (Int n, Double *x, Double *wsave) 
static void  costi (Int n, Float *wsave) 
costi initializes the array wsave which is used in cost . More...  
static void  costi (Int n, Double *wsave) 
static void  cost (Int n, Float *x, Float *wsave) 
cost computes the discrete Fourier cosine transform of an even sequence x(i). More...  
static void  cost (Int n, Double *x, Double *wsave) 
static void  sinqi (Int n, Float *wsave) 
sinqi initializes the array wsave which is used in both sinqf and sinqb . More...  
static void  sinqi (Int n, Double *wsave) 
static void  sinqf (Int n, Float *x, Float *wsave) 
sinqf computes the fast Fourier transform of quarter wave data. More...  
static void  sinqf (Int n, Double *x, Double *wsave) 
static void  sinqb (Int n, Float *x, Float *wsave) 
sinqb computes the fast Fourier transform of quarter wave data. More...  
static void  sinqb (Int n, Double *x, Double *wsave) 
static void  cosqi (Int n, Float *wsave) 
static void  cosqi (Int n, Double *wsave) 
static void  cosqf (Int n, Float *x, Float *wsave) 
static void  cosqf (Int n, Double *x, Double *wsave) 
static void  cosqb (Int n, Float *x, Float *wsave) 
static void  cosqb (Int n, Double *x, Double *wsave) 
C++ interface to the Fortran FFTPACK library.
The static functions in this class are C++ wrappers to the Fortran FFTPACK library. This library contains functions that perform fast Fourier transforms (FFT's) and related transforms.
An additional purpose of these definitions is to overload the functions so that C++ users can access the functions in either fftpak (single precision) or dfftpack (double precision) with identical function names.
These routines only do onedimensional transforms with the first element of the array being the "origin" of the transform. The FFTServer class uses some of these functions to implement multidimensional transforms with the origin of the transform either at the centre or the first element of the Array.
You must initialise the work array wsave
before using the forward transform (function with a suffix of f) or the backward transform (with a suffix of b).
The transforms done by the functions in this class can be categorised as follows:
Warning: These functions assume that it is possible to convert between Casacore numeric types and those used by Fortran; That it is possible to convert between Float & float, Double & double and Int & int;
Warning: These function also assume that a Complex array is stored as pairs of floating point numbers, with no intervening gaps, and with the real component first ie;, [re0,im0,re1,im1, ;;;]
so that the following type casts work,
and allow a Complex number to be accessed as a pair of real numbers; If this assumption is bad then float Arrays will have to generated by copying the complex ones; When compiled in debug mode mode the functions that require this assumption will throw an exception (AipsError) if this assumption is bad; Ultimately this assumption about Complex<>Float Array conversion should be put somewhere central like Array2Math;cc;

static 
Documentation from FFTPack 5.1.

static 
Description from FFTPack 5.1.

static 
Here is the doc from FFTPack 5.1 You can convert the linguo from fortran to C/C++.
cfftb computes the backward complex discrete Fourier transform (the Fourier synthesis).
Equivalently, cfftb computes a complex periodic sequence from its Fourier coefficients. The transform is defined below with output parameter c.
A call of cfftf followed by a call of cfftb will multiply the sequence by n.
The array wsave which is used by cfftb
must be initialized by calling cffti(n,wsave)
.
Input parameters:
cffti(n,wsave)
and a different wsave array must be used for each different value of n. This initialization does not have to be repeated so long as n remains unchanged thus subsequent transforms can be obtained faster than the first. The same wsave array can be used by cfftf and cfftb. Output parameters:
for j=1,...,n
c(j)=the sum from k=1,...,n of
c(k)*exp(i*(j1)*(k1)*2*pi/n)
cfftf computes the forward complex discrete Fourier transform (the Fourier analysis).
Equivalently, cfftf computes the Fourier coefficients of a complex periodic sequence. the transform is defined below at output parameter c.
The transform is not normalized. To obtain a normalized transform the output must be divided by n. Otherwise a call of cfftf followed by a call of cfftb will multiply the sequence by n.
The array wsave which is used by cfftf
must be initialized by calling cffti(n,wsave)
.
Input parameters:
cffti(n,wsave)
and a different wsave array must be used for each different value of n. This initialization does not have to be repeated so long as n remains unchanged thus subsequent transforms can be obtained faster than the first. The same wsave array can be used by cfftf and cfftb. Output parameters:
cffti initializes the array wsave which is used in both cfftf
and cfftb
.
The prime factorization of n together with a tabulation of the trigonometric functions are computed and stored in wsave.
Input parameter:
Output parameter:
cost computes the discrete Fourier cosine transform of an even sequence x(i).
The transform is defined below at output parameter x. cost is the unnormalized inverse of itself since a call of cost followed by another call of cost will multiply the input sequence x by 2*(n1). The transform is defined below at output parameter x. The array wsave which is used by cost
must be initialized by calling costi(n,wsave)
.
Input parameters:
costi(n,wsave)
and a different wsave array must be used for each different value of n. This initialization does not have to be repeated so long as n remains unchanged thus subsequent transforms can be obtained faster than the first. Output parameters:
for i=1,...,n
x(i) = x(1)+(1)**(i1)*x(n)
a call of cost followed by another call of cost will multiply the sequence x by 2*(n1) hence cost is the unnormalized inverse of itself.
costi initializes the array wsave which is used in cost
.
The prime factorization of n together with a tabulation of the trigonometric functions are computed and stored in wsave.
Input parameter:
Output parameter:

static 
ezfftb computes a real perodic sequence from its Fourier coefficients (Fourier synthesis).
The transform is defined below at output parameter r. ezfftb is a simplified but slower version of rfftb.
Input parameters:
ezffti(n,wsave)
and a different wsave array must be used for each different value of n. This initialization does not have to be repeated so long as n remains unchanged thus subsequent transforms can be obtained faster than the first. The same wsave array can be used by ezfftf and ezfftb. Output parameters:

static 
ezfftf computes the Fourier coefficients of a real perodic sequence (Fourier analysis).
The transform is defined below at output parameters azero, a and b. ezfftf is a simplified but slower version of rfftf.
Input parameters:
ezffti(n,wsave)
and a different wsave array must be used for each different value of n. This initialization does not have to be repeated so long as n remains unchanged thus subsequent transforms can be obtained faster than the first. The same wsave array can be used by ezfftf and ezfftb. Output parameters:
Real arrays of length n/2 (n even) or (n1)/2 (n odd)
for n even
b(n/2)=0, and
a(n/2) is the sum from i=1 to i=n of (1)**(i1)*r(i)/n
for n even define kmax=n/21
for n odd define kmax=(n1)/2
then for k=1,...,kmax
a(k) equals the sum from i=1 to i=n of
2./n*r(i)*cos(k*(i1)*2*pi/n)
b(k) equals the sum from i=1 to i=n of
2./n*r(i)*sin(k*(i1)*2*pi/n)
ezffti initializes the array wsave which is used in both ezfftf
and ezfftb
.
The prime factorization of n together with a tabulation of the trigonometric functions are computed and stored in wsave.
Input parameter:
Output parameter:
rfftb computes the real perodic sequence from its Fourier coefficients (Fourier synthesis).
The transform is defined below at output parameter r.
Input parameters:
rffti(n,wsave)
and a different wsave array must be used for each different value of n. This initialization does not have to be repeated so long as n remains unchanged thus subsequent transforms can be obtained faster than the first. The same wsave array can be used by rfftf and rfftb. Output parameters:
for n even and for i = 1,...,n
r(i) = r(1)+(1)**(i1)*r(n)
plus the sum from k=2 to k=n/2 of
2.*r(2*k2)*cos((k1)*(i1)*2*pi/n)
2.*r(2*k1)*sin((k1)*(i1)*2*pi/n)
for n odd and for i = 1,...,n
r(i) = r(1) plus the sum from k=2 to k=(n+1)/2 of
2.*r(2*k2)*cos((k1)*(i1)*2*pi/n)
2.*r(2*k1)*sin((k1)*(i1)*2*pi/n)
note: this transform is unnormalized since a call of rfftf followed by a call of rfftb will multiply the input sequence by n.
rfftf computes the Fourier coefficients of a real perodic sequence (Fourier analysis).
The transform is defined below at output parameter r.
Input parameters:
rffti(n,wsave)
and a different wsave array must be used for each different value of n. This initialization does not have to be repeated so long as n remains unchanged thus subsequent transforms can be obtained faster than the first. The same wsave array can be used by rfftf and rfftb. output parameters
r(1) = the sum from i=1 to i=n of r(i)
if n is even set l = n/2, if n is odd set l = (n+1)/2
then for k = 2,...,l
r(2*k2) = the sum from i = 1 to i = n of
r(i)*cos((k1)*(i1)*2*pi/n)
r(2*k1) = the sum from i = 1 to i = n of
r(i)*sin((k1)*(i1)*2*pi/n)
if n is even
r(n) = the sum from i = 1 to i = n of
(1)**(i1)*r(i)
note: this transform is unnormalized since a call of rfftf followed by a call of rfftb will multiply the input sequence by n.
rffti initializes the array wsave which is used in both rfftf
and rfftb
.
The prime factorization of n together with a tabulation of the trigonometric functions are computed and stored in wsave.
Input parameter:
Output parameter:
sinqb computes the fast Fourier transform of quarter wave data.
that is, sinqb computes a sequence from its representation in terms of a sine series with odd wave numbers. the transform is defined below at output parameter x.
sinqf is the unnormalized inverse of sinqb since a call of sinqb followed by a call of sinqf will multiply the input sequence x by 4*n.
The array wsave which is used by sinqb
must be initialized by calling sinqi(n,wsave)
.
Input parameters:
sinqi(n,wsave)
and a different wsave array must be used for each different value of n. This initialization does not have to be repeated so long as n remains unchanged thus subsequent transforms can be obtained faster than the first. Output parameters:
for i=1,...,n
x(i)= the sum from k=1 to k=n of
4*x(k)*sin((2k1)*i*pi/(2*n))
a call of sinqb followed by a call of sinqf will multiply the sequence x by 4*n. Therefore sinqf is the unnormalized inverse of sinqb.
sinqf computes the fast Fourier transform of quarter wave data.
That is, sinqf computes the coefficients in a sine series representation with only odd wave numbers. The transform is defined below at output parameter x.
sinqb is the unnormalized inverse of sinqf since a call of sinqf followed by a call of sinqb will multiply the input sequence x by 4*n.
The array wsave which is used by sinqf must be initialized by calling sinqi(n,wsave)
.
Input parameters:
sinqi(n,wsave)
and a different wsave array must be used for each different value of n. This initialization does not have to be repeated so long as n remains unchanged thus subsequent transforms can be obtained faster than the first. Output parameters:
for i=1,...,n
x(i) = (1)**(i1)*x(n)
a call of sinqf followed by a call of sinqb will multiply the sequence x by 4*n. therefore sinqb is the unnormalized inverse of sinqf.
sinqi initializes the array wsave which is used in both sinqf
and sinqb
.
The prime factorization of n together with a tabulation of the trigonometric functions are computed and stored in wsave.
Input parameter:
Output parameter:
sint computes the discrete Fourier sine transform of an odd sequence x(i).
The transform is defined below at output parameter x. sint is the unnormalized inverse of itself since a call of sint followed by another call of sint will multiply the input sequence x by 2*(n+1). The array wsave which is used by sint must be initialized by calling sinti(n,wsave)
.
Input parameters:
sinti(n,wsave)
and a different wsave array must be used for each different value of n. This initialization does not have to be repeated so long as n remains unchanged thus subsequent transforms can be obtained faster than the first. Output parameters:
for i=1,...,n
x(i) = the sum from k=1 to k=n
2*x(k)*sin(k*i*pi/(n+1))
a call of sint followed by another call of sint will multiply the sequence x by 2*(n+1). Hence sint is the unnormalized inverse of itself.
sinti initializes the array wsave which is used in sint
.
The prime factorization of n together with a tabulation of the trigonometric functions are computed and stored in wsave.
Input parameter:
Output parameter: