fftpack

package
v0.3.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: MIT, BSD-3-Clause Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func Rfftf(n int, r, work []float64, ifac []int)

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

func Rffti(n int, work []float64, ifac []int)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL