Documentation
¶
Overview ¶
Package fftpack implements Discrete Fourier Transform functions ported from the Fortran implementation of FFTPACK.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Rfftf ¶
Rfftf computes the Fourier coefficients of a real perodic sequence (Fourier analysis). The transform is defined below at output parameter r.
Input parameters:
n The length of the array r to be transformed. The method
is most efficient when n is a product of small primes.
n may change so long as different work arrays are provided.
r A real array of length n which contains the sequence
to be transformed.
work a work array which must be dimensioned at least 2*n.
in the program that calls Rfftf. the work array must be
initialized by calling subroutine rffti(n,work,ifac) and a
different work 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 work array can be used by Rfftf and Rfftb.
ifac A work array containing the factors of n. ifac must have
length of at least 15.
Output parameters:
r r[0] = the sum from i=0 to i=n-1 of r[i]
if n is even set l=n/2, if n is odd set l = (n+1)/2
then for k = 1, ..., l-1
r[2*k-1] = the sum from i = 0 to i = n-1 of
r[i]*cos(k*i*2*pi/n)
r[2*k] = the sum from i = 0 to i = n-1 of
-r[i]*sin(k*i*2*pi/n)
if n is even
r[n-1] = the sum from i = 0 to i = n-1 of
(-1)^i*r[i]
This transform is unnormalized since a call of Rfftf
followed by a call of Rfftb will multiply the input
sequence by n.
work contains results which must not be destroyed between
calls of Rfftf or Rfftb.
ifac contains results which must not be destroyed between
calls of Rfftf or Rfftb.
func Rffti ¶
Rffti initializes the array work 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 work.
Input parameter:
n The length of the sequence to be transformed.
Output parameters:
work A work array which must be dimensioned at least 2*n.
The same work array can be used for both Rfftf and Rfftb
as long as n remains unchanged. different work arrays
are required for different values of n. The contents of
work must not be changed between calls of Rfftf or Rfftb.
ifac A work array containing the factors of n. ifac must have
length of at least 15.
Types ¶
This section is empty.