Copyright | [2017] Rinat Stryungis |
---|---|

License | BSD3 |

Maintainer | Rinat Stryungis <lazybonesxp@gmail.com> |

Stability | experimental |

Portability | non-portable (GHC extensions) |

Safe Haskell | None |

Language | Haskell2010 |

Computation of a Hilbert Transform using the accelerate-fft library. It just makes fft transform, remove signal with negative frequencies and makes inverse fft. The time complexity is O(n log n) in the size of the input.

The base implementation of fft uses a naïve divide-and-conquer fft implementation whose absolute performance is appalling. It also requires that you know on the Haskell side the size of the data being transformed, and that this is a power-of-two in each dimension.

For performance, compile accelerate-fft against the foreign library bindings (using any number of '-fllvm-ptx', and '-fllvm-cpu' for the accelerate-llvm-ptx, and accelerate-llvm-native backends, respectively), which have none of the above restrictions.

# Documentation

hilbert :: (RealFloat e, Fractional (Exp e), Floating (Exp e), IsFloating e, FromIntegral Int e, Elt e, sh ~ DIM1) => sh -> Acc (Array DIM1 e) -> Acc (Array DIM1 (Complex e)) Source #

Hilbert transform. It removes a negative frequencies from the signal. The default implementation requires the array dimension to be a power of two (else error). The FFI-backed implementations ignore the Haskell-side size parameter (first argument).