pylops_distributed.signalprocessing.FFT¶
-
class
pylops_distributed.signalprocessing.
FFT
(dims, dir=0, nfft=None, sampling=1.0, real=False, fftshift=False, compute=(False, False), chunks=(None, None), todask=(None, None), dtype='float64')[source]¶ One dimensional Fast-Fourier Transform.
Apply Fast-Fourier Transform (FFT) along a specific direction
dir
of a multi-dimensional array of sizedim
.Note that the FFT operator is an overload to the dask
dask.array.fft.fft
(ordask.array.fft.rfft
for real models) in forward mode and to the daskdask.array.fft.ifft
(ordask.array.fft.irfft
for real models) in adjoint mode.Scaling is properly taken into account to guarantee that the operator is passing the dot-test.
Note
For a real valued input signal, it is possible to store the values of the Fourier transform at positive frequencies only as values at negative frequencies are simply their complex conjugates. However as the operation of removing the negative part of the frequency axis in forward mode and adding the complex conjugates in adjoint mode is nonlinear, the Linear Operator FTT with
real=True
is not expected to pass the dot-test. It is thus only advised to use this flag when a forward and adjoint FFT is used in the same chained operator (e.g.,FFT.H*Op*FFT
) such as inpylops_distributed.waveeqprocessing.mdd.MDC
.Parameters: - dims :
tuple
Number of samples for each dimension
- dir :
int
, optional Direction along which FFT is applied.
- nfft :
int
, optional Number of samples in Fourier Transform (same as input if
nfft=None
)- sampling :
float
, optional Sampling step
dt
.- real :
bool
, optional Model to which fft is applied has real numbers (
True
) or not (False
). Used to enforce that the output of adjoint of a real model is real.- fftshift :
bool
, optional Apply fftshift/ifftshift (
True
) or not (False
)- compute :
tuple
, optional Compute the outcome of forward and adjoint or simply define the graph and return a
dask.array.array
- chunks :
tuple
, optional Chunk size for model and data. If provided it will rechunk the model before applying the forward pass and the data before applying the adjoint pass
- todask :
tuple
, optional Apply
dask.array.from_array
to model and data before applying forward and adjoint respectively- dtype :
str
, optional Type of elements in input array.
Raises: - ValueError
If
dims
is not provided and ifdir
is bigger thanlen(dims)
Notes
Refer to
pylops.signalprocessing.FFT
for implementation details.Attributes: Methods
__init__
(dims[, dir, nfft, sampling, real, …])Initialize this LinearOperator. adjoint
()Hermitian adjoint. apply_columns
(cols)Apply subset of columns of operator cond
([uselobpcg])Condition number of linear operator. conj
()Complex conjugate operator div
(y[, niter])Solve the linear problem \(\mathbf{y}=\mathbf{A}\mathbf{x}\). dot
(x)Matrix-vector multiplication. eigs
([neigs, symmetric, niter, uselobpcg])Most significant eigenvalues of linear operator. matmat
(X)Matrix-matrix multiplication. matvec
(x)Matrix-vector multiplication. rmatmat
(X)Adjoint matrix-matrix multiplication. rmatvec
(x)Adjoint Matrix-vector multiplication. todense
()Return dense matrix. tosparse
()Return sparse matrix. transpose
()Transpose this linear operator. - dims :