FourierTransformBase

class odl.trafos.fourier.FourierTransformBase(*args, **kwargs)[source]

Bases: odl.operator.operator.Operator

Discretized Fourier transform between discrete L^p spaces.

This operator is the discretized variant of the continuous Fourier Transform between Lebesgue L^p spaces. It applies a three-step procedure consisting of a pre-processing step of the data, an FFT evaluation and a post-processing step. Pre- and post-processing account for the shift and scaling of the real-space and Fourier-space grids.

The sign convention (‘-‘ vs. ‘+’) can be changed with the sign parameter.

Attributes
adjoint

Adjoint transform, equal to the inverse.

axes

Axes along the FT is calculated by this operator.

domain

Set of objects on which this operator can be evaluated.

halfcomplex

Return True if the last transform axis is halved.

impl

Backend for the FFT implementation.

inverse

Inverse Fourier transform.

is_functional

True if this operator’s range is a Field.

is_linear

True if this operator is linear.

range

Set in which the result of an evaluation of this operator lies.

shifts

Return the boolean list indicating shifting per axis.

sign

Sign of the complex exponent in the transform.

Methods

_call(self, x, out, \*\*kwargs)

Implement self(x, out[, **kwargs]).

clear_fftw_plan(self)

Delete the FFTW plan of this transform.

clear_temporaries(self)

Set the temporaries to None.

create_temporaries(self[, r, f])

Allocate and store reusable temporaries.

derivative(self, point)

Return the operator derivative at point.

init_fftw_plan(self[, planning_effort])

Initialize the FFTW plan for this transform for later use.

norm(self[, estimate])

Return the operator norm of this operator.

__init__(self, inverse, domain, range=None, impl=None, \*\*kwargs)[source]

Initialize a new instance.

All parameters are given according to the specifics of the forward transform. The inverse parameter is used to control conversions for the inverse transform.

Parameters
inversebool

If True, create the inverse transform, otherwise the forward transform.

domainDiscretizedSpace

Domain of the Fourier transform. If the DiscretizedSpace.exponent of domain and range are equal to 2.0, this operator has an adjoint which is equal to its inverse.

rangeDiscretizedSpace, optional

Range of the Fourier transform. If not given, the range is determined from domain and the other parameters. The exponent is chosen to be the conjugate p / (p - 1), which reads as ‘inf’ for p=1 and 1 for p=’inf’.

impl{‘numpy’, ‘pyfftw’}, optional

Backend for the FFT implementation. The ‘pyfftw’ backend is faster but requires the pyfftw package. None selects the fastest available backend.

axesint or sequence of ints, optional

Dimensions along which to take the transform. Default: all axes

sign{‘-‘, ‘+’}, optional

Sign of the complex exponent. Default: ‘-‘

halfcomplexbool, optional

If True, calculate only the negative frequency part along the last axis for real input. If False, calculate the full complex FFT. For complex domain, it has no effect. Default: True

shiftbool or sequence of bools, optional

If True, the reciprocal grid is shifted by half a stride in the negative direction. With a boolean sequence, this option is applied separately to each axis. If a sequence is provided, it must have the same length as axes if supplied. Note that this must be set to True in the halved axis in half-complex transforms. Default: True

Other Parameters
tmp_rDiscretizedSpaceElement or numpy.ndarray, optional

Temporary for calculations in the real space (domain of this transform). It is shared with the inverse.

Variants using this: R2C, R2HC, C2R (inverse)

tmp_fDiscretizedSpaceElement or numpy.ndarray, optional

Temporary for calculations in the frequency (reciprocal) space. It is shared with the inverse.

Variants using this: R2C, C2R (inverse), HC2R (inverse)

Notes

  • The transform variants are:

    • C2C: complex-to-complex. The default variant, one-to-one and unitary.

    • R2C: real-to-complex. This variants adjoint and inverse may suffer from information loss since the result is cast to real.

    • R2HC: real-to-halfcomplex. This variant stores only a half-space of frequencies and is guaranteed to be one-to-one (invertible).

  • The Operator.range of this operator always has the ComplexNumbers as LinearSpace.field, i.e. if the field of domain is the RealNumbers, this operator’s adjoint is defined by identifying real and imaginary parts with the components of a real product space element. See the mathematical background documentation for details.