accelerate-fft-1.1.0.0: FFT using the Accelerate library

Copyright [2012..2017] Manuel M T Chakravarty Gabriele Keller Trevor L. McDonell[2013..2017] Robert Clifton-Everest BSD3 Trevor L. McDonell experimental non-portable (GHC extensions) None Haskell98

Data.Array.Accelerate.Math.DFT

Description

Compute the Discrete Fourier Transform (DFT) along the lower order dimension of an array.

This uses a naïve algorithm which takes O(n^2) time. However, you can transform an array with an arbitrary extent, unlike with FFT which requires each dimension to be a power of two.

The dft and idft functions compute the roots of unity as needed. If you need to transform several arrays with the same extent than it is faster to compute the roots once using rootsOfUnity or inverseRootsOfUnity respectively, then call dftG directly.

You can also compute single values of the transform using dftGS

Synopsis

# Documentation

dft :: (Shape sh, Slice sh, RealFloat e, FromIntegral Int e) => Acc (Array (sh :. Int) (Complex e)) -> Acc (Array (sh :. Int) (Complex e)) Source #

Compute the DFT along the low order dimension of an array

idft :: (Shape sh, Slice sh, RealFloat e, FromIntegral Int e) => Acc (Array (sh :. Int) (Complex e)) -> Acc (Array (sh :. Int) (Complex e)) Source #

Compute the inverse DFT along the low order dimension of an array

Arguments

 :: (Shape sh, Slice sh, RealFloat e) => Acc (Array (sh :. Int) (Complex e)) roots of unity -> Acc (Array (sh :. Int) (Complex e)) input array -> Acc (Array (sh :. Int) (Complex e))

Generic function for computation of forward and inverse DFT. This function is also useful if you transform many arrays of the same extent, and don't want to recompute the roots for each one.

The extent of the input and roots must match.

Arguments

 :: (Shape sh, Slice sh, RealFloat e) => Exp (sh :. Int) index of the value we want -> Acc (Array (sh :. Int) (Complex e)) roots of unity -> Acc (Array (sh :. Int) (Complex e)) input array -> Acc (Scalar (Complex e))

Compute a single value of the DFT.