FFT v0.1.1 FFT View Source

FFT - Fast Fourier Transform Algorithm for fast fourier transform, which is widely used in the treatment of signals.

The fast fourier transform picks up the signal input in a given time period and divides it into its frequency components.

Link to this section Summary

Functions

Bit-reverse. List -> List input a list and returns a list with the reassembled elements using bit-reverse

Transform

Link to this section Functions

Link to this function bit_reverse(array, reverse \\ [], n \\ 0) View Source

Bit-reverse. List -> List input a list and returns a list with the reassembled elements using bit-reverse.

Example

iex> a = [0, 1, 2, 3, 4, 5, 6, 7]
[0, 1, 2, 3, 4, 5, 6, 7]
iex> FFT.bit_reverse a
[0, 4, 2, 6, 1, 5, 3, 7]

Transform

List (With length power of 2) -> Complex List

Input list and return the fft-list.

Example

iex> a = [1,1,1,1,0,0,0,0]
  [1, 1, 1, 1, 0, 0, 0, 0]
iex> FFT.transform a
  [#ComplexNum (Cartesian) <4.0 + 0.0ยท๐‘–>,
  #ComplexNum (Cartesian) <1.0 + -2.414213562373095ยท๐‘–>,
  #ComplexNum (Cartesian) <0.0 + 0.0ยท๐‘–>,
  #ComplexNum (Cartesian) <1.0 + -0.4142135623730949ยท๐‘–>,
  #ComplexNum (Cartesian) <0.0 + 0.0ยท๐‘–>,
  #ComplexNum (Cartesian) <0.9999999999999999 + 0.4142135623730949ยท๐‘–>,
  #ComplexNum (Cartesian) <0.0 + 0.0ยท๐‘–>,
  #ComplexNum (Cartesian) <0.9999999999999997 + 2.414213562373095ยท๐‘–>]