fourier

package
v0.3.25 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT, BSD-3-Clause Imports: 1 Imported by: 1 module, 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 fourier provides functions to perform Discrete Fourier Transforms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FFT

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

FFT implements the Fast Fourier Transform for real sequences.

func NewFFT

func NewFFT(n int) *FFT

NewFFT returns an FFT initialized for work on sequences of length n.

func (*FFT) Coefficients

func (t *FFT) Coefficients(dst []complex128, seq []float64) []complex128

Coefficients computes the Fourier coefficients of the input sequence, converting the time series in seq into the frequency spectrum, placing the result in dst and returning it. This transform is unnormalized.

If the length of seq is not t.Len(), Coefficients will panic. If dst is nil, a new slice is allocated and returned. If dst is not nil and the length of dst does not equal t.Len()/2+1, Coefficients will panic.

func (*FFT) Freq

func (t *FFT) Freq(i int) float64

Freq returns the relative frequency center for coefficient i. Freq will panic if i is negative or greater than or equal to t.Len().

func (*FFT) Len

func (t *FFT) Len() int

Len returns the length of the acceptable input.

func (*FFT) Reset

func (t *FFT) Reset(n int)

Reset reinitializes the FFT for work on sequences of length n.

Directories

Path Synopsis
internal
fftpack
Package fftpack implements Discrete Fourier Transform functions ported from the Fortran implementation of FFTPACK.
Package fftpack implements Discrete Fourier Transform functions ported from the Fortran implementation of FFTPACK.

Jump to

Keyboard shortcuts

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