fft

package module
v0.0.0-...-51351a1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: Unlicense Imports: 3 Imported by: 5

README

fft

radix-2 fast Fourier transform

Package fft provides a fast discrete Fourier transformation algorithm.

Implemented is the 1-dimensional DFT of complex input data for with input lengths which are powers of 2.

The algorithm is non-recursive and works in-place overwriting the input array.

Before doing the transform on acutal data, allocate an FFT object with t := fft.New(N) where N is the length of the input array. Then multiple calls to t.Transform(x) can be done with different input vectors having the same length.

Documentation

Overview

Package fft provides a fast discrete Fourier transformation algorithm.

Implemented is the 1-dimensional DFT of complex input data for with input lengths which are powers of 2.

The algorithm is non-recursive and works in-place overwriting the input array.

Before doing the transform on acutal data, allocate an FFT object with t := fft.New(N) where N is the length of the input array. Then multiple calls to t.Transform(x) can be done with different input vectors having the same length.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FFT

type FFT struct {
	N int // Fft length, power of 2.

	E []complex128 // Precomputed roots table, length N.
	// contains filtered or unexported fields
}

func New

func New(N int) (f FFT, err error)

func (FFT) Inverse

func (f FFT) Inverse(x []complex128) []complex128

Inverse is the backwards transform.

func (FFT) Transform

func (f FFT) Transform(x []complex128) []complex128

Forward transform. The forward transform overwrites the input array.

type NFFT

type NFFT struct {
	// contains filtered or unexported fields
}

func Prepare

func Prepare(n uint16) NFFT

func (NFFT) Complex

func (f NFFT) Complex(x []complex128)

func (NFFT) Real2

func (f NFFT) Real2(x, y []float64, out []complex128)

Directories

Path Synopsis
x

Jump to

Keyboard shortcuts

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