Discrete Transforms¶
The cvxopt.fftw
module is an interface to the FFTW library and
contains routines for discrete Fourier, cosine, and sine transforms.
This module is optional, and only installed when the FFTW library is made
available during the CVXOPT installation.
Discrete Fourier Transform¶

cvxopt.fftw.
dft
(X)¶ Replaces the columns of a dense complex matrix with their discrete Fourier transforms: if
X
has rows,

cvxopt.fftw.
idft
(X)¶ Replaces the columns of a dense complex matrix with their inverse discrete Fourier transforms: if
X
has rows,
The module also includes a discrete Ndimensional Fourier transform. The input matrix is interpreted as an Ndimensional matrix stored in columnmajor order. The discrete Ndimensional Fourier transform computes the corresponding onedimensional transform along each dimension. For example, the twodimensional transform applies a onedimensional transform to all the columns of the matrix, followed by a onedimensional transform to all the rows of the matrix.

cvxopt.fftw.
dftn
(X[, dims = X.size])¶ Replaces a dense complex matrix with its Ndimensional discrete Fourier transform. The dimensions of the Ndimensional matrix are given by the Ntuple
dims
. The twodimensional transform is computed asdftn(X, X.size)
.

cvxopt.fftw.
idftn
(X[, dims = X.size])¶ Replaces a dense complex Ndimensional matrix with its inverse Ndimensional discrete Fourier transform. The dimensions of the matrix are given by the tuple
dims
. The twodimensional inverse transform is computed asidftn(X, X.size)
.
Discrete Cosine Transform¶

cvxopt.fftw.
dct
(X[, type = 2])¶ Replaces the columns of a dense real matrix with their discrete cosine transforms. The second argument, an integer between 1 and 4, denotes the type of transform (DCTI, DCTII, DCTIII, DCTIV). The DCTI transform requires that the row dimension of
X
is at least 2. These transforms are defined as follows (for a matrix with rows).

cvxopt.fftw.
idct
(X[, type = 2])¶ Replaces the columns of a dense real matrix with the inverses of the discrete cosine transforms defined above.
The module also includes a discrete Ndimensional cosine transform. The input matrix is interpreted as an Ndimensional matrix stored in columnmajor order. The discrete Ndimensional cosine transform computes the corresponding onedimensional transform along each dimension. For example, the twodimensional transform applies a onedimensional transform to all the rows of the matrix, followed by a onedimensional transform to all the columns of the matrix.

cvxopt.fftw.
dctn
(X[, dims = X.size, type = 2])¶ Replaces a dense real matrix with its Ndimensional discrete cosine transform. The dimensions of the Ndimensional matrix are given by the Ntuple
dims
. The twodimensional transform is computed asdctn(X, X.size)
.

cvxopt.fftw.
idctn
(X[, dims = X.size, type = 2])¶ Replaces a dense real Ndimensional matrix with its inverse Ndimensional discrete cosine transform. The dimensions of the matrix are given by the tuple
dims
. The twodimensional inverse transform is computed asidctn(X, X.size)
.
Discrete Sine Transform¶

cvxopt.fftw.
dst
(X, dims[, type = 1])¶ Replaces the columns of a dense real matrix with their discrete sine transforms. The second argument, an integer between 1 and 4, denotes the type of transform (DSTI, DSTII, DSTIII, DSTIV). These transforms are defined as follows (for a matrix with rows).

cvxopt.fftw.
idst
(X, dims[, type = 1])¶ Replaces the columns of a dense real matrix with the inverses of the discrete sine transforms defined above.
The module also includes a discrete Ndimensional sine transform. The input matrix is interpreted as an Ndimensional matrix stored in columnmajor order. The discrete Ndimensional sine transform computes the corresponding onedimensional transform along each dimension. For example, the twodimensional transform applies a onedimensional transform to all the rows of the matrix, followed by a onedimensional transform to all the columns of the matrix.

cvxopt.fftw.
dstn
(X[, dims = X.size, type = 2])¶ Replaces a dense real matrix with its Ndimensional discrete sine transform. The dimensions of the Ndimensional matrix are given by the Ntuple
dims
. The twodimensional transform is computed asdstn(X, X.size)
.

cvxopt.fftw.
idstn
(X[, dims = X.size, type = 2])¶ Replaces a dense real Ndimensional matrix with its inverse Ndimensional discrete sine transform. The dimensions of the matrix are given by the tuple
dims
. The twodimensional inverse transform is computed asidstn(X, X.size)
.