fft

package module
v0.0.0-...-8d44add Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: MIT Imports: 2 Imported by: 0

README

fft

Fast Fourier Transform in Golang.

A library of fast Fourier transforms / inverse transforms.

Install

$ go get github.com/rnicolas/fft

Usage

Use the fft.FFT function for the Fourier transform.

y := fft.FFT(x, n)

x is the number of data (complex number) and n is the number of data. n must be a power of 2.

Use the fft.IFFT function for the inverse transform.

z := fft.IFFT(y, n)

Use the fft.GetAmplitude function to get the amplitude of a Fourier transform.

y := fft.FFT(x, n)
z := fft.GetAmplitude(y)

x is the number of data (complex number) and n is the number of data. n must be a power of 2. y is the FFT result. z is the array with amplitudes calculated.

License

MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FFT

func FFT(x []complex128, n int) []complex128

FFT calculates the Fast Fourier Transform

func GetMagnitude

func GetMagnitude(m []complex128) []float64

GetMagnitude alculates frequencies amplitude given a FFT m

func IFFT

func IFFT(x []complex128, n int) []complex128

IFFT calculates the Inverse Fast Fourier Transform

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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