vector-fftw-0.1.3.5: A binding to the fftw library for one-dimensional vectors.

Numeric.FFT.Vector.Invertible

Description

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).

Synopsis

# Creating and executing `Plan`s

run :: (Vector v a, Vector v b, Storable a, Storable b) => Transform a b -> v a -> v b Source

Create and run a `Plan` for the given transform.

plan :: (Storable a, Storable b) => Transform a b -> Int -> Plan a b Source

Create a `Plan` of a specific size. This function is equivalent to `planOfType Estimate`.

execute :: (Vector v a, Vector v b, Storable a, Storable b) => Plan a b -> v a -> v b Source

Run a plan on the given `Vector`.

If `planInputSize p /= length v`, then calling `execute p v` will throw an exception.

# Complex-to-complex transforms

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)`

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)`

# Real-to-complex transforms

A forward discrete Fourier transform with real data. If the input size is `n`, the output size will be `n `div` 2 + 1`.

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:

• Calling `plan dftC2R n` creates a `Plan` whose output size is `n`, and whose input size is `n `div` 2 + 1`.
• If `length v == n`, then `length (run dftC2R v) == 2*(n-1)`.

# Real-to-real transforms

The real-even (DCT) and real-odd (DST) transforms. The input and output sizes are the same (`n`).

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))`

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))]`

A type-2 discrete cosine transform.

`y_k = 2 sum_(j=0)^(n-1) x_j cos(pi(j+1/2)k/n)`

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)]`

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)`

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)`

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)`

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)`

## Discrete sine transforms

A type-1 discrete sine transform.

`y_k = 2 sum_(j=0)^(n-1) x_j sin(pi(j+1)(k+1)/(n+1))`

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))`

A type-2 discrete sine transform.

`y_k = 2 sum_(j=0)^(n-1) x_j sin(pi(j+1/2)(k+1)/n)`

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)]`

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)`

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)`

A type-4 discrete sine transform.

`y_k = sum_(j=0)^(n-1) x_j sin(pi(j+1/2)(k+1/2)/n)`

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)`