-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A binding to the fftw library for one-dimensional vectors. -- -- This package provides bindings to the fftw library for one-dimensional -- vectors. It provides both high-level functions and more low-level -- manipulation of fftw plans. -- -- We provide three different modules which wrap fftw's operations: -- -- -- -- Note that this package is currently not thread-safe. @package vector-fftw @version 0.1.3 module Numeric.FFT.Vector.Plan -- | A transform which may be applied to vectors of different sizes. data Transform a b -- | Create a Plan of a specific size for this transform. planOfType :: (Storable a, Storable b) => PlanType -> Transform a b -> Int -> Plan a b data PlanType Estimate :: PlanType Measure :: PlanType Patient :: PlanType Exhaustive :: PlanType -- | Create a Plan of a specific size. This function is equivalent -- to planOfType Estimate. plan :: (Storable a, Storable b) => Transform a b -> Int -> Plan a b -- | Create and run a Plan for the given transform. run :: (Vector v a, Vector v b, Storable a, Storable b) => Transform a b -> v a -> v b -- | A Plan can be used to run an fftw algorithm for a -- specific input/output size. data Plan a b -- | The (only) valid input size for this plan. planInputSize :: Storable a => Plan a b -> Int -- | The (only) valid output size for this plan. planOutputSize :: Storable b => Plan a b -> Int -- | Run a plan on the given Vector. -- -- If planInputSize p /= length v, then calling -- execute p v will throw an exception. execute :: (Vector v a, Vector v b, Storable a, Storable b) => Plan a b -> v a -> v b -- | Run a plan on the given mutable vectors. The same vector may be used -- for both input and output. -- -- If planInputSize p /= length vIn or -- planOutputSize p /= length vOut, then calling -- unsafeExecuteM p vIn vOut will throw an exception. executeM :: (PrimMonad m, MVector v a, MVector v b, Storable a, Storable b) => Plan a b -> v (PrimState m) a -> v (PrimState m) b -> m () -- | Raw, unnormalized versions of the transforms in fftw. -- -- Note that the forwards and backwards transforms of this module are not -- actually inverses. For example, run idft (run dft v) /= v in -- general. -- -- For more information on the individual transforms, see -- http://www.fftw.org/fftw3_doc/What-FFTW-Really-Computes.html. module Numeric.FFT.Vector.Unnormalized -- | Create and run a Plan for the given transform. run :: (Vector v a, Vector v b, Storable a, Storable b) => Transform a b -> v a -> v b -- | Create a Plan of a specific size. This function is equivalent -- to planOfType Estimate. plan :: (Storable a, Storable b) => Transform a b -> Int -> Plan a b -- | Run a plan on the given Vector. -- -- If planInputSize p /= length v, then calling -- execute p v will throw an exception. execute :: (Vector v a, Vector v b, Storable a, Storable b) => Plan a b -> v a -> v b -- | A forward discrete Fourier transform. The output and input sizes are -- the same (n). -- --
--   y_k = sum_(j=0)^(n-1) x_j e^(-2pi i j k/n)
--   
dft :: Transform (Complex Double) (Complex Double) -- | A backward discrete Fourier transform. The output and input sizes are -- the same (n). -- --
--   y_k = sum_(j=0)^(n-1) x_j e^(2pi i j k/n)
--   
idft :: Transform (Complex Double) (Complex Double) -- | A forward discrete Fourier transform with real data. If the input size -- is n, the output size will be n `div` 2 + 1. dftR2C :: Transform Double (Complex Double) -- | A backward discrete Fourier transform which produces real data. -- -- This Transform behaves differently than the others: -- -- dftC2R :: Transform (Complex Double) Double -- | A type-1 discrete cosine transform. -- --
--   y_k = x_0 + (-1)^k x_(n-1) + 2 sum_(j=1)^(n-2) x_j cos(pi j k/(n-1))
--   
dct1 :: Transform Double Double -- | A type-2 discrete cosine transform. -- --
--   y_k = 2 sum_(j=0)^(n-1) x_j cos(pi(j+1/2)k/n)
--   
dct2 :: Transform Double Double -- | A type-3 discrete cosine transform. -- --
--   y_k = x_0 + 2 sum_(j=1)^(n-1) x_j cos(pi j(k+1/2)/n)
--   
dct3 :: Transform Double Double -- | A type-4 discrete cosine transform. -- --
--   y_k = 2 sum_(j=0)^(n-1) x_j cos(pi(j+1/2)(k+1/2)/n)
--   
dct4 :: Transform Double Double -- | A type-1 discrete sine transform. -- --
--   y_k = 2 sum_(j=0)^(n-1) x_j sin(pi(j+1)(k+1)/(n+1))
--   
dst1 :: Transform Double Double -- | A type-2 discrete sine transform. -- --
--   y_k = 2 sum_(j=0)^(n-1) x_j sin(pi(j+1/2)(k+1)/n)
--   
dst2 :: Transform Double Double -- | A type-3 discrete sine transform. -- --
--   y_k = (-1)^k x_(n-1) + 2 sum_(j=0)^(n-2) x_j sin(pi(j+1)(k+1/2)/n)
--   
dst3 :: Transform Double Double -- | A type-4 discrete sine transform. -- --
--   y_k = sum_(j=0)^(n-1) x_j sin(pi(j+1/2)(k+1/2)/n)
--   
dst4 :: Transform Double Double -- | This module provides normalized versions of the transforms in -- fftw. -- -- The forwards transforms in this module are identical to those in -- Numeric.FFT.Vector.Unnormalized. The backwards transforms are -- normalized to be their inverse operations (approximately, due to -- floating point precision). -- -- For more information on the underlying transforms, see -- http://www.fftw.org/fftw3_doc/What-FFTW-Really-Computes.html. module Numeric.FFT.Vector.Invertible -- | Create and run a Plan for the given transform. run :: (Vector v a, Vector v b, Storable a, Storable b) => Transform a b -> v a -> v b -- | Create a Plan of a specific size. This function is equivalent -- to planOfType Estimate. plan :: (Storable a, Storable b) => Transform a b -> Int -> Plan a b -- | Run a plan on the given Vector. -- -- If planInputSize p /= length v, then calling -- execute p v will throw an exception. execute :: (Vector v a, Vector v b, Storable a, Storable b) => Plan a b -> v a -> v b -- | A forward discrete Fourier transform. The output and input sizes are -- the same (n). -- --
--   y_k = sum_(j=0)^(n-1) x_j e^(-2pi i j k/n)
--   
dft :: Transform (Complex Double) (Complex Double) -- | A backward discrete Fourier transform which is the inverse of -- dft. The output and input sizes are the same (n). -- --
--   y_k = (1/n) sum_(j=0)^(n-1) x_j e^(2pi i j k/n)
--   
idft :: Transform (Complex Double) (Complex Double) -- | A forward discrete Fourier transform with real data. If the input size -- is n, the output size will be n `div` 2 + 1. dftR2C :: Transform Double (Complex Double) -- | A normalized backward discrete Fourier transform which is the left -- inverse of dftR2C. (Specifically, run dftC2R . run dftR2C -- == id.) -- -- This Transform behaves differently than the others: -- -- dftC2R :: Transform (Complex Double) Double -- | A type-1 discrete cosine transform. -- --
--   y_k = x_0 + (-1)^k x_(n-1) + 2 sum_(j=1)^(n-2) x_j cos(pi j k/(n-1))
--   
dct1 :: Transform Double Double -- | A type-1 discrete cosine transform which is the inverse of -- dct1. -- --
--   y_k = (1/(2(n-1)) [x_0 + (-1)^k x_(n-1) + 2 sum_(j=1)^(n-2) x_j cos(pi j k/(n-1))]
--   
idct1 :: Transform Double Double -- | A type-2 discrete cosine transform. -- --
--   y_k = 2 sum_(j=0)^(n-1) x_j cos(pi(j+1/2)k/n)
--   
dct2 :: Transform Double Double -- | A type-3 discrete cosine transform which is the inverse of -- dct2. -- --
--   y_k = (1/(2n)) [x_0 + 2 sum_(j=1)^(n-1) x_j cos(pi j(k+1/2)/n)]
--   
idct2 :: Transform Double Double -- | A type-3 discrete cosine transform. -- --
--   y_k = x_0 + 2 sum_(j=1)^(n-1) x_j cos(pi j(k+1/2)/n)
--   
dct3 :: Transform Double Double -- | A type-2 discrete cosine transform which is the inverse of -- dct3. -- --
--   y_k = (1/n) sum_(j=0)^(n-1) x_j cos(pi(j+1/2)k/n)
--   
idct3 :: Transform Double Double -- | A type-4 discrete cosine transform. -- --
--   y_k = 2 sum_(j=0)^(n-1) x_j cos(pi(j+1/2)(k+1/2)/n)
--   
dct4 :: Transform Double Double -- | A type-4 discrete cosine transform which is the inverse of -- dct4. -- --
--   y_k = (1/n) sum_(j=0)^(n-1) x_j cos(pi(j+1/2)(k+1/2)/n)
--   
idct4 :: Transform Double Double -- | A type-1 discrete sine transform. -- --
--   y_k = 2 sum_(j=0)^(n-1) x_j sin(pi(j+1)(k+1)/(n+1))
--   
dst1 :: Transform Double Double -- | A type-1 discrete sine transform which is the inverse of dst1. -- --
--   y_k = (1/(n+1)) sum_(j=0)^(n-1) x_j sin(pi(j+1)(k+1)/(n+1))
--   
idst1 :: Transform Double Double -- | A type-2 discrete sine transform. -- --
--   y_k = 2 sum_(j=0)^(n-1) x_j sin(pi(j+1/2)(k+1)/n)
--   
dst2 :: Transform Double Double -- | A type-3 discrete sine transform which is the inverse of dst2. -- --
--   y_k = (1/(2n)) [(-1)^k x_(n-1) + 2 sum_(j=0)^(n-2) x_j sin(pi(j+1)(k+1/2)/n)]
--   
idst2 :: Transform Double Double -- | A type-3 discrete sine transform. -- --
--   y_k = (-1)^k x_(n-1) + 2 sum_(j=0)^(n-2) x_j sin(pi(j+1)(k+1/2)/n)
--   
dst3 :: Transform Double Double -- | A type-2 discrete sine transform which is the inverse of dst3. -- --
--   y_k = (1/n) sum_(j=0)^(n-1) x_j sin(pi(j+1/2)(k+1)/n)
--   
idst3 :: Transform Double Double -- | A type-4 discrete sine transform. -- --
--   y_k = sum_(j=0)^(n-1) x_j sin(pi(j+1/2)(k+1/2)/n)
--   
dst4 :: Transform Double Double -- | A type-4 discrete sine transform which is the inverse of dst4. -- --
--   y_k = (1/(2n)) sum_(j=0)^(n-1) x_j sin(pi(j+1/2)(k+1/2)/n)
--   
idst4 :: Transform Double Double -- | This module provides normalized versions of the transforms in -- fftw. -- -- All of the transforms are normalized so that -- -- -- -- (Both conditions only hold approximately, due to floating point -- precision.) -- -- For more information on the underlying transforms, see -- http://www.fftw.org/fftw3_doc/What-FFTW-Really-Computes.html. module Numeric.FFT.Vector.Unitary -- | Create and run a Plan for the given transform. run :: (Vector v a, Vector v b, Storable a, Storable b) => Transform a b -> v a -> v b -- | Create a Plan of a specific size. This function is equivalent -- to planOfType Estimate. plan :: (Storable a, Storable b) => Transform a b -> Int -> Plan a b -- | Run a plan on the given Vector. -- -- If planInputSize p /= length v, then calling -- execute p v will throw an exception. execute :: (Vector v a, Vector v b, Storable a, Storable b) => Plan a b -> v a -> v b -- | A discrete Fourier transform. The output and input sizes are the same -- (n). -- --
--   y_k = (1/sqrt n) sum_(j=0)^(n-1) x_j e^(-2pi i j k/n)
--   
dft :: Transform (Complex Double) (Complex Double) -- | An inverse discrete Fourier transform. The output and input sizes are -- the same (n). -- --
--   y_k = (1/sqrt n) sum_(j=0)^(n-1) x_j e^(2pi i j k/n)
--   
idft :: Transform (Complex Double) (Complex Double) -- | A forward discrete Fourier transform with real data. If the input size -- is n, the output size will be n `div` 2 + 1. dftR2C :: Transform Double (Complex Double) -- | A normalized backward discrete Fourier transform which is the left -- inverse of dftR2C. (Specifically, run dftC2R . run dftR2C -- == id.) -- -- This Transform behaves differently than the others: -- -- dftC2R :: Transform (Complex Double) Double -- | A type-2 discrete cosine transform. Its inverse is dct3. -- -- y_k = w(k) sum_(j=0)^(n-1) x_j cos(pi(j+1/2)k/n); where -- w(0)=1/sqrt n, and w(k)=sqrt(2/n) for -- k>0. dct2 :: Transform Double Double -- | A type-3 discrete cosine transform which is the inverse of -- dct2. -- -- y_k = (-1)^k w(n-1) x_(n-1) + 2 sum_(j=0)^(n-2) w(j) x_j -- sin(pi(j+1)(k+1/2)/n); where w(0)=1/sqrt(n), and -- w(k)=1/sqrt(2n) for k>0. idct2 :: Transform Double Double -- | A type-4 discrete cosine transform. It is its own inverse. -- --
--   y_k = (1/sqrt n) sum_(j=0)^(n-1) x_j cos(pi(j+1/2)(k+1/2)/n)
--   
dct4 :: Transform Double Double