fft

package
v0.0.0-...-bb7769e Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BitReverse

func BitReverse(a []complex128) []complex128

BitReverse used by FftV2(); rearranges the sequences of elements in the slice to speed up later calculation.

func BruteForceFFT

func BruteForceFFT(a []complex128) []complex128

BruteForceFFT returns the FFT of a using brute force.

assumes length of a to be a power of 2.

WARNING: this has a time complexity of O(n ^ 2) and is only used for testing.

func Convert2Complex

func Convert2Complex(a []float64) (b []complex128)

Convert2Complex converts a float64 array to a complex128 array.

func ExtractReals

func ExtractReals(c []complex128) []float64

ExtractReals extract the real parts from []complex128.

func Fft

func Fft(a []complex128) []complex128

Fft returns FFT of a using recursive functions.

assumes length of a to be a power of 2.

func FftV2

func FftV2(a []complex128) []complex128

FftV2 returns FFT of a using a loop.

assumes length of a to be a power of 2.

func Interpolation

func Interpolation(ys []complex128) []complex128

Interpolation calculates the interpolation, which is the reverse of DFT (or DFT ^ -1).

This function is a modification of the recursive Fft().

func InterpolationV2

func InterpolationV2(ys []complex128) []complex128

InterpolationV2 calculates the interpolation, which is the reverse of DFT (or DFT ^ -1).

This function is a modification of the iterative FftV2().

func MultipleYs

func MultipleYs(y0, y1 []complex128) ([]complex128, error)

MultipleYs multiplies 2 complex128 slices which should have equal length.

e.g., y0 * y1 = y0[0] * y1[0], y0[1] * y1[1] ...

func RoundUpComplexNums

func RoundUpComplexNums(a []complex128) (b []complex128)

RoundUpComplexNums rounds up all the real and imaginary numbers in the slice of complex numbers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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