Transforms

This section describes functions concerning Fourier transform.

dft

template<typename S>
auto castor::dft(matrix<S> const &X, std::size_t n = 0, int dim = 0, bool isinverse = false)

Discrete Fourier Transform of an array.

Y = dft(X) computes the discrete Fourier transform (DFT) of all the N values of array X using a naive algorithm :

Y(k) = sum_{n=0}^(N-1) e^{-2i\pi*k * n/N} X(n).

Y = dft(X,n) returns the n-point DFT. If no value is specified, Y is the dft of all values of X, in linear indexing.

Y = dft(X,n,dim) returns the Fourier transform along the dimension dim. For example, if X is a matrix, then dft(X,n,2) returns the n-point Fourier transform of each row.

Y = dft(X,n,dim,flag) specify is inverse fft is computed.

matrix<float> X = eye(1,4);
disp(fft(X));

See idft, fft.

fft

matrix<std::complex<float>> castor::fft(matrix<ckiss> Xc, std::size_t n = 0, int dim = 0, bool isinverse = false)

Fast Fourier Transform of an array.

Y = fft(X) computes the discrete Fourier transform (DFT) of X using a fast Fourier transform (FFT) algorithm.

Y = fft(X,n) returns the n-point DFT. If no value is specified, Y is the fft of all values of X, in linear indexing.

Y = fft(X,n,dim) returns the Fourier transform along the dimension dim. For example, if X is a matrix, then fft(X,n,2) returns the n-point Fourier transform of each row.

Y = fft(X,n,dim,flag) specify is inverse fft is computed.

WARNING : This is a single-precision floating point implementation.

matrix<float> X = eye(1,4);
auto Y = fft(X);
disp(Y);

See dft, ifft.

idft

template<typename S>
inline auto castor::idft(matrix<S> const &X, std::size_t n = 0, int dim = 0)

Inverse Discrete Fourier Transform of an array.

Y = idft(X) computes the inverse discrete Fourier transform (IDFT) of all the N values of array X using a naive algorithm :

Y(n) = 1/N sum_{k=0}^(N-1) e^{2i\pi*n * k/N} X(k).

Y = idft(X,n) returns the n-point IDFT. If no value is specified, Y is the idft of all values of X, in linear indexing.

Y = idft(X,n,dim) returns the Inverse Fourier transform along the dimension dim. For example, if X is a matrix, then idft(X,n,2) returns the n-point Fourier transform of each row.

matrix<float> X = eye(1,4);
disp(idft(X));

See dft, ifft.

ifft

inline matrix<std::complex<float>> castor::ifft(matrix<ckiss> Xc, std::size_t n = 0, int dim = 0)

Inverse Fast Fourier Transform of an array.

Y = ifft(X) computes the inverse discrete Fourier transform (IDFT) of X using a fast Fourier transform (FFT) algorithm.

Y = ifft(X,n) returns the n-point IDFT. If no value is specified, Y is the ifft of all values of X, in linear indexing.

Y = ifft(X,n,dim) returns the inverse Fourier transform along the dimension dim. For example, if X is a matrix, then ifft(X,n,2) returns the n-point inverse Fourier transform of each row.

WARNING : This is a single-precision floating point implementation.

matrix<float> X = eye(1,512);
auto Y = ifft(X);
disp(Y);

See idft, fft.